Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2324 > unrolled thread
| Started by | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| First post | 2011-05-13 10:26 +0000 |
| Last post | 2011-05-14 07:14 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Complex arithmetic identity question Ralph Dratman <ralph.dratman@gmail.com> - 2011-05-13 10:26 +0000
Re: Complex arithmetic identity question Bert RAM Aerts <bert.ram.aerts@gmail.com> - 2011-05-14 07:13 +0000
Re: Complex arithmetic identity question Peter Pein <petsie@dordos.net> - 2011-05-14 07:14 +0000
| From | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| Date | 2011-05-13 10:26 +0000 |
| Subject | Complex arithmetic identity question |
| Message-ID | <iqj0vu$rag$1@smc.vnet.net> |
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?
If I help by solving for c by hand and plugging that in, Mathematica knows
how to finish the job:
In[22]:= Solve[1/(a + I b) == a/(a^2 + b^2) + I d, d]
Out[22]= {{d -> -(b/(a^2 + b^2))}}
But I was hoping Mathematica would be able to go all the way from the
equation to the solution in one step, with the use of Solve or something
similar.
Is this possible, and if so, how? If not, why not?
Thank you.
Ralph Dratman
[toc] | [next] | [standalone]
| From | Bert RAM Aerts <bert.ram.aerts@gmail.com> |
|---|---|
| Date | 2011-05-14 07:13 +0000 |
| Message-ID | <iqla1u$9v8$1@smc.vnet.net> |
| In reply to | #2324 |
On 13 mei, 12:26, Ralph Dratman <ralph.drat...@gmail.com> 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?
>
> If I help by solving for c by hand and plugging that in, Mathematica knows
> how to finish the job:
>
> In[22]:= Solve[1/(a + I b) == a/(a^2 + b^2) + I d, d]
>
> Out[22]= {{d -> -(b/(a^2 + b^2))}}
>
> But I was hoping Mathematica would be able to go all the way from the
> equation to the solution in one step, with the use of Solve or something
> similar.
>
> Is this possible, and if so, how? If not, why not?
>
> Thank you.
>
> Ralph Dratman
ComplexExpand[1/(a + b I)]
[toc] | [prev] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2011-05-14 07:14 +0000 |
| Message-ID | <iqla5i$a0e$1@smc.vnet.net> |
| In reply to | #2324 |
Am 13.05.2011 12:26, schrieb Ralph Dratman:
> 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?
>
> If I help by solving for c by hand and plugging that in, Mathematica knows
> how to finish the job:
>
> In[22]:= Solve[1/(a + I b) == a/(a^2 + b^2) + I d, d]
>
> Out[22]= {{d -> -(b/(a^2 + b^2))}}
>
>
> But I was hoping Mathematica would be able to go all the way from the
> equation to the solution in one step, with the use of Solve or something
> similar.
>
>
> Is this possible, and if so, how? If not, why not?
>
>
> Thank you.
>
> Ralph Dratman
Hi Ralph,
you have to tell Solve, that a, b, c, d are real numbers:
Simplify[Solve[c + d*I == 1/(a + I*b) &&
Element[a | b | c | d, Reals] && (a != 0 || b != 0),
{c, d}], Element[a | b, Reals]]
or you calculate directly:
{Thread[{c, d} -> ComplexExpand[Through[{Re, Im}[1/(a + b I)]]]]}
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web