Re: Complex arithmetic identity question
- To: mathgroup at smc.vnet.net
- Subject: [mg118889] Re: Complex arithmetic identity question
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sat, 14 May 2011 03:08:44 -0400 (EDT)
On 5/13/11 at 6:24 AM, ralph.dratman at gmail.com (Ralph Dratman) wrote:
>Hi. I am new to the mailing list, trying to learn how to persuade
>Mathematica to perform helpful algebraic manipulations.
>Here is a very very simple example. I think this should be easy, but
>so far I have not been able to figure it out.
>Suppose c + I d = 1/(a +I b), where a, b, c, d are reals. Solve for
>c and d in terms of a and b.
>For a human, the solution is easy. Multiply top and bottom by the
>complex conjugate, then set real part equal to real part, imaginary
>part equal to imaginary part.
>The result is c -> a/(a^2+b^2), d -> -b/(a^2+b^2). But is there a
>simple way to get Mathematica to give me that answer in one step?
in one step? Yes. But simple, is in the eye of the beholder. A
one liner solution is:
In[11]:= Solve[
Thread[List @@ (c + I d) == List @@ ComplexExpand[1/(a + I
b)]], {c,
d}]
Out[11]= {{c -> a/(a^2 + b^2), d -> -(b/(a^2 + b^2))}}
ComplexExpand converts 1/(a + b I) to x + I y format
List@@ is short hand for Apply[List, ...] and simply replaces
head Plus with head List. That is it converts x +I y to {x, I y}
The Thread part sets up two equations, equating the real and
complex parts.
Finally, Solve simply solves for c and d.