MathGroup Archive 1998

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

Search the Archive

RE: Re[a + I b] = a




Markus wrote:
 ----------
|how can I tell mathematica that the variable a and b is real, so that
|Re[a+ I  b] results to a?
|or: n a integer number and Sin[n x] results to 0? |
This is how:

In[1]:=
?ComplexExpand
"ComplexExpand[expr] expands expr assuming that all variables are real. 
ComplexExpand[expr, {x1, x2, ... }] expands expr assuming that
variables  matching any of the xi are complex."


In[2]:=
ComplexExpand[ Re[a+b I] ]

Out[2]=
a


If you some of the variables can be complex, use the following.

In[3]:=
ComplexExpand[ Re[a+b I+z], {z} ]

Out[3]=
a+Re[z]


     Ted Ersek




  • Prev by Date: Diamond Video card problems?
  • Next by Date: Re: Complex -> List does not work
  • Prev by thread: Re[a + I b] = a
  • Next by thread: Re: Re[a + I b] = a