<s>[INST] Separate f(z) into real and imaginary parts I'm doing some practice problems about complex numbers.  I want to break $f(z)=(1-z)/(1+z)$ into real and imaginary parts $u(x,y)$ and $v(x,y)$ such that $f(z)=u+iv$.  I did a different problem like this correctly, so I think it's more the algebra than the complex number aspect that's hard for me here.  I know the answer is 
$$u=\frac{1-x^2-y^2}{(1+x)+y^2}, v=\frac{-2y}{(1+x)^2+y^2}$$
$z=x+iy$, so $$f(z)=\frac{1-(x+iy)}{1+(x+iy)}=\frac{1-x-iy}{1+x+iy}$$
I get that it needs to be split into two fractions so that the $i$ can be pulled out.  I just have no idea how to make that work.  Or the rest of the algebra for that matter.
 [/INST] What I would do is this:
Given
$f(z) = \dfrac{1 -z}{1 + z}, \tag 1$
multiply both the numerator and denominator by 
$\overline{1 + z} = 1 + \bar z; \tag 2$
this will cause the denominator to become real; with
$z = x + iy, \tag 4$
we have
$(1 + z)(1 + \bar z) = (1 + x + iy)(1 + x - iy) = (1 + x)^2 + y^2; \tag 5$
also,
$(1 - z)(1 + \bar z) = (1 - x - iy)(1 + x - iy) = 1 + x - iy - x - x^2 + ixy - iy- ixy - y^2 = (1 - x^2 - y^2) -2iy; \tag 6$
thus,
$f(z) = f(x, y) = u(x, y) + iv(x, y) = \dfrac{1 - x^2 - y^2}{(1 + x)^2 + y^2} - i\dfrac{2y}{(1 + x)^2 + y^2}. \tag 7$
</s>