MathGroup Archive 2005

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

Search the Archive

Re: Complex Variables

wwolfe18 at wrote:
> This has been annoying me for a while.
> Is there a way to declare symbols to be real so that
> Re[x + i y]  gives x and Conjugate[x + i y] gives x - i y etc?
> Warren Wolfe
In[1]:= $Post = ComplexExpand[#1, TargetFunctions -> {Re, Im}] & ;
In[2]:= Re[(x - I*y)^3]
Out[2]= x^3 - 3*x*y^2
In[3]:= Re[x + I*y]
Out[3]= x
In[4]:= Conjugate[a - I*(x + I*y)]
Out[4]= a + I*x + y

If you're _really_ sure you want this expansion everytime you use
Mathematica, you can put "$Post=... " into your init.m file (Mathematica
 book A.7.2 & A.8.2)
Peter Pein

  • Prev by Date: Re: Complex Variables
  • Next by Date: Re: TrigExpand - Odd behavior
  • Previous by thread: Re: Complex Variables
  • Next by thread: Re: Complex Variables