       Re: Separating real part and imaginary part from each other

• To: mathgroup at smc.vnet.net
• Subject: [mg101231] Re: Separating real part and imaginary part from each other
• From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
• Date: Sat, 27 Jun 2009 06:04:46 -0400 (EDT)
• References: <h2295a\$hoj\$1@smc.vnet.net>

```In:= f[z_] = (a*z + b)/(c*z + d)

Out= (b + a z)/(d + c z)

In:= g = f[x + I*y]

Out= (b + a (x + I y))/(d + c (x + I y))

In:= ComplexExpand[Re[g] + I*Im[g]]

Out= (b d)/((d + c x)^2 + c^2 y^2) + (
b c x)/((d + c x)^2 + c^2 y^2) + (a d x)/((d + c x)^2 + c^2 y^2) + (
a c x^2)/((d + c x)^2 + c^2 y^2) + (
a c y^2)/((d + c x)^2 + c^2 y^2) +
I (-((b c y)/((d + c x)^2 + c^2 y^2)) + (
a d y)/((d + c x)^2 + c^2 y^2))

Then Together[] on the real and imaginary parts and you get:

(b d + b c x + a d x + a c x^2 + a c y^2)/(
d^2 + 2 c d x + c^2 x^2 + c^2 y^2) +
I ((-b c y + a d y)/(d^2 + 2 c d x + c^2 x^2 + c^2 y^2))

Cheers -- Sjoerd

On Jun 26, 12:50 pm, Alexander <alexander.erl... at gmail.com> wrote:
> Hi,
>
> suppose I have the expression
>
> f(z) = (a*z+b) / (c*z+d) with z=x+I*y
>
> I did the calculation by hand and was able to separate real part fom
> imag. part to obtain something like this:
>
> g=f(x+I*y) = Re(g) + I * Im(g)
>
> But I don't know how to do this in Mathematica. I tried FullSimplify,
> Together, Apart, they didn't work. Can you help me?
>
> Alexander

```

• Prev by Date: Re: Separating real part and imaginary part from each
• Next by Date: Re: The Principle "Everything is an expression"
• Previous by thread: Re: Separating real part and imaginary part from each other
• Next by thread: Simple question about named variables.