*To*: mathgroup@smc.vnet.net*Subject*: [mg10607] RE: [mg10492] Re[a + I b] = a*From*: Ersek_Ted%PAX1A@mr.nawcad.navy.mil*Date*: Mon, 26 Jan 1998 04:42:38 -0500

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