# Solving Complex Equation Over Reals

I want to solve the equation $\frac{abi}{a+bi}=4-2i$, where $a$ and $b$ are real numbers. I know from hand-solving the answer is $a=5$, $b=-10$. How do I get Mathematica to tell me this?

I tried:

Solve[a b I/(a + b I) == 4 - 2 I, {a, b}]


but this returns

{{b -> -(((2 + 4 I) a)/((-4 + 2 I) + a))}}.


I tried

Solve[a b I/(a + b I) == 4 - 2 I, {a, b},Reals]


but this returns

Solve[a b I/(a + b I) == 4 - 2 I, {a, b},Reals].


Is there a simple way of getting Mathematica to solve this, without knowing lots of special Mathematica commands? In searching out the answer on this site, I see workarounds that a newbie to MMA would never think of themselves, nor understand what they are doing that gives the right answer.

• Solve[a b I/(a + b I) == 4 - 2 I && (a | b) ∈ Reals, {a, b}]. This might be slightly related: Solve an equation in R+. Dec 18, 2013 at 14:18
• That works - thanks! What does (a | b) mean? Specifically, what's the pipe? Dec 18, 2013 at 14:21
• See Alternatives. You can use Solve[a b I/(a + b I) == 4 - 2 I && a ∈ Reals && b ∈ Reals, {a, b}] as well. Dec 18, 2013 at 14:23
• @Artes If you make your comment an answer I'd mark it as my favorite. The one given currently is essentially the same, but yours is more succinct and, imo, more intuitive. Dec 19, 2013 at 11:39
• I'm glad I could help, but I think you could accept the answer given by Alexei since that one is quite appropriate. On the other hand you might find helpful more detailed discussion of Reduce and Solve: What is the difference between Reduce and Solve?. Dec 19, 2013 at 15:27

Reduce[a b I/(a + b I) == 4 - 2 I && a ∈ Reals &&