I'd like Mathematica to to show that two complex numbers $a + b i$ and $c + d i$ (with real coefficients $a, b, c, d$) are equal if and only if $a = c$ and $b = d$.
The obvious thing does not quite work:
Clear[a, b, c, d]
Solve[a + b I == c + d I && {a, b, c, d} \[Element] Reals, {a, b}]
(* {{a -> ConditionalExpression[c, (d | c) \[Element] Reals],
b -> ConditionalExpression[d, (d | c) \[Element] Reals]}} *)
Similarly, using Reduce instead of Solve gives output:
(* (d | c) \[Element] Reals && a == c && b == d *)
While the results above are correct, they include obviously superfluous conditions. I want to obtain output simply:
{{a -> c, b -> d}}
How else can this be obtained — without explicitly invoking Re and Im (whose use would, in essence, beg the question)?
I realize that if one has specific real numbers assigned to c and d, there is no issue. For example:
Solve[a + b I == -2 + 3 I && a \[Element] Reals && b \[Element] Reals, {a, b}]
(* {{a -> -2, b -> 3}} *)
Assuming[{c, d} \[Element] Reals, Refine[ Reduce[a + b I == c + d I && {a, b} \[Element] Reals]]]also works withSolve. – N.J.Evans Sep 15 '15 at 14:31Refinethat's bothering me in that method, but rather having to duplicate the reality condition oncanddin the enclosingAssuminginstead of keeping it inside theReduce(orSolve). – murray Sep 15 '15 at 14:38c,din theSolveorReduce, and only apply them after the fact. (which also works for Artes soln.) This makes me think that those functions ignore the conditions you've set on the variables you're not solving for. Maybe someone with a better understanding of how Solve and Reduce work will chime in. – N.J.Evans Sep 15 '15 at 15:10