Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2369 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2011-05-14 07:13 +0000 |
| Last post | 2011-05-14 07:13 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Complex arithmetic identity question Bill Rowe <readnews@sbcglobal.net> - 2011-05-14 07:13 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2011-05-14 07:13 +0000 |
| Subject | Re: Complex arithmetic identity question |
| Message-ID | <iqla3j$9vr$1@smc.vnet.net> |
On 5/13/11 at 6:24 AM, ralph.dratman@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.
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web