Re: Complex numbers

• To: mathgroup at smc.vnet.net
• Subject: [mg5445] Re: Complex numbers
• From: ianc (Ian Collier)
• Date: Sat, 7 Dec 1996 00:26:21 -0500
• Organization: Wolfram Research, Inc.
• Sender: owner-wri-mathgroup at wolfram.com

```In article <57tvhr\$k0f at dragonfly.wolfram.com>, Wouter Dobbelaere
<Wouter.Dobbelaere at rug.ac.be> wrote:

> Hi,
>
> Is there a way to calculate the real or imaginary part of a complex
> expression symbolically (assuming real numbers as parameters) like:
>
> Re[x + I y] = x
>
> The standard Re function doesn't seem to allow that. Maybe some
> extensions exist?
>
> Regards,
> Wouter Dobbelaere

You can use Complex Expand to do what you want:

In[2]:=
expr= Re[x + I y]

Out[2]=
-Im[y]+Re[x]

In[4]:=
?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[3]:=
ComplexExpand[expr]

Out[3]=
x

I hope this helps.

--Ian

-----------------------------------------------------------
Ian Collier
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217) 398-0700   fax:(217) 398-0747    ianc at wolfram.com