MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Complex Numbers

  • To: mathgroup at
  • Subject: [mg47438] RE: [mg47425] Complex Numbers
  • From: "Florian Jaccard" <florian.jaccard at>
  • Date: Mon, 12 Apr 2004 03:44:52 -0400 (EDT)
  • Reply-to: <florian.jaccard at>
  • Sender: owner-wri-mathgroup at

ComplexExpand[expr] expands expr assuming that all variables are real.
So if you want that a and b are assumed to be real, you have first to take
the real part, and then ComplexExpand !

ComplexExpand[Re[ Exp[a I] Exp[b I]]]


You often will have to use the option :

ComplexExpand[... ,TargetFunctions->{Re,Im}]

to obtain what you really want.

You can also use Simplify and tell Mathematica that all your variables are
real :

Simplify[Re[Exp[a*I]*Exp[b*I]], Element[_, Reals]]

Cos[a + b]


Florian Jaccard

-----Message d'origine-----
De : Alejandro Vizcarra [mailto:gebankos at]
Envoyé : dim., 11. avril 2004 10:44
À : mathgroup at
Objet : [mg47425] Complex Numbers


I always have problems when dealing with complex numbers.  How can i
work with Mathematica in such a way that every expression will
be considered real unless it is declared explicitly complex (like a = 3 + 4
I ) ?

For example if I type

Re[ComplexExpand[ Exp[a I] Exp[b I]]]

I get the answer

-Im[Sin[ a+b]]+Re[Cos[a+b]]

Instead of simply Cos[a+  b]


Alejandro Vizcarra

  • Prev by Date: Re: FindRoot
  • Next by Date: Re: Is there any productive way to use Mathematica + pdfLaTeX?
  • Previous by thread: RE: Complex Numbers
  • Next by thread: Re: Complex Numbers