MathGroup Archive 1998

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

Search the Archive

ComplexExpand



Hi Group;

I have found ComplexExpand useful and sometimes necessary. (Try  DSolve[
u''[t]+u'[t]+u[t]==0,u[t],t] to see why something like  ComplexExpand
is necessary.)  The reason for this post is that I would like to share
with those interested in these things, some uses that I have found for
ComplexExpand that do not seem to be explicit in the literature that I
have seen. Here are a group of functions that assume all variable are
real unless explicitly stated to the contrary in the manner of
ComplexExpand.  

(1)  RealPart[z_] := ComplexExpand[ Re[z] ]

(2)  ImaginaryPart[z_] := ComplexExpand[ Im[z] ]
     
(3)  From these two functions it is easy to define, AbsoluteValue,
CartesianForm and ComplexConjugate to supplement the limitations of the
built-in functions Abs and Conjugate. For example,

CartesianForm[z_] := RealPart[z]+I*ImaginaryPart[z]  

These functions have some amusing features.  Here is one trivial
example. When ComplexExpand is applied to (1+2I)*Exp[I*x]  we get the
mildly unsatisfactory 
	
	(1+2I)*Cos[x]-(2-I)*Sin[x]    

(I have been unable to use any form of Collect or Expand to separate the
real and imaginary parts.)  However,

CartesianForm[(1+2I)*Exp[I*x]] -> Cos[x]-2Sin[x]+I(2Cos[x]+Sin[x])
 
does the job nicely.

I have tested these functions fairly extensively and found they work
without untoward surprises. But in doing so I have run into a minor
"weaknesses" of ComplexExpand that I would like to see Wolfram
incorporate into some later version.  In particulular, ComplexExpand
does not simplify Abs[x+I*y] nor does it simplify 
Cos[Arg[Cos[x]+I*Sin[x]]].  I would like to see this:

ComplexExpand[Abs[x+I*y]] -> Sqrt[x^2+y^2]

and 

ComplexExpand[Cos[Arg[Cos[x]+I*Sin[x]]]] -> x

as well as similar identities using Sin or Tan in place of the first Cos
in the latter formula.

I have incorporated these and similar rules into my use of  RealPart
etc. and founda substantial simplification is possible.  Consider, 

ComplexExpand[(Cos[x]+I*Sin[x])^(1/3)]

with and without these simmplification rules!

Oh yes.  After using DSolve as above, try out 

RealPart[u[t]/."output of DSolve"]

I hope this is useful to someone.  If anyone out there has done some
thinking about these issues and would like to share them with me and
the group, I would be delighted.  I am most interested in corrections
and improvements!  

Jack Goldberg




  • Prev by Date: Re: COMBINING LISTS
  • Next by Date: Re: COMBINING LISTS
  • Prev by thread: Re: Black-Scholes option pricing model
  • Next by thread: Re: ComplexExpand