Re: Trick for getting the comples conjugate in symbolic calculations?
- To: mathgroup at smc.vnet.net
- Subject: [mg30320] Re: Trick for getting the comples conjugate in symbolic calculations?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sat, 11 Aug 2001 03:39:43 -0400 (EDT)
- References: <9kqj1m$4bo$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Norbert,
By default, Mathematica assumes that variables denote complex numbers, so
for example
Conjugate[z(x+I y)]
Conjugate[(x + I*y)*z]
This could be expanded to (Conjugate[x] - I*Conjugate[y])*Conjugate[z] but
it is left to the user to make choices.
To deal with such situations we have the functions ComplexExpand,
FunctionExpand and the package Algebra`ReIm`. These can be looked up in the
HelpBrowser.
Here are some examples
ComplexExpand[Conjugate[(x+I y)z]] (*x,y,z are assumed real*)
x*z - I*y*z
ComplexExpand[Conjugate[(x+I y)z],{z}] (*z, only is assumed complex*)
(-y)*Im[z] + x*Re[z] - I*(x*Im[z] + y*Re[z])
FunctionExpand[Conjugate[(x+I y)z]] (*x,y,z are assumed complex*)
(Conjugate[x] - I*Conjugate[y])*Conjugate[z]
<<Algebra`ReIm`
This allows some expansion, under the default assumption that x,y,z are
complex.
Conjugate[z(x+I y)]
(Conjugate[x] - I*Conjugate[y])*Conjugate[z]
We can declare z to be real ( note z:/ --- this setting is tagged by z, not
Im)
z/:Im[z]=0;
Conjugate[(x+I y)z]
z*(Conjugate[x] - I*Conjugate[y])
This declaration overides the beviour of ComplexExpand
ComplexExpand[Conjugate[(x+I y)z],{z}]
x*z - I*y*z
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
<riefler at iwt.uni-bremen.de> wrote in message
news:9kqj1m$4bo$1 at smc.vnet.net...
> Hi
>
> I read in the older news that the numeric functions real / Re and imag
> / Im for / Mathematica won't do its job because of some
> ambiguity. The same holds for the complex conjugate conj / Conjugate.
>
> Is there a trick to get anyway the algebraic solution of for example
> (x1+i*y1)*conj(x2+i*y2) / (x1+i*y1)*Conjugate(x2+i*y2) in Mathematica?
>
>
> Thanks a lot
>
> Norbert
>