Express $w=f(z)=\frac{1}{(1-z)^2}$ in the form $w=u(x,y)+iv(x,y)$ I start by writing $f(z)$ as $$\frac{1}{(1-(x+iy))^2}$$
and then I expand the bottom to get $$\frac{1}{(1-2x+x^2-y^2) + i(2y-2xy)}$$
The answer says $$w=\frac{(1+x^2-2x-y^2)-(i(2xy-2y)}{(1+x^2-2x-y^2)^2+(2xy-2y)^2}$$
How do I get to this stage?

$$
\begin{align*}
\frac{1}{(1 - (x + iy))^2}
&= \frac{1}{1-2(x+iy)+(x+iy)^2}
= \frac{1}{1+x^2-y^2-2x + i(2xy - 2y)} \\
&= \frac{1 +x^2-y^2-2x-i(2xy - 2y)}{\left[ (1+x^2-y^2-2x)+i(2xy-2y) \right]\left[ (1+x^2-y^2-2x)-i(2xy-2y) \right]} \\
&= \frac{(1+x^2-y^2-2x) - i(2xy - 2y)}{(1+x^2-y^2-2x)^2 + (2xy-2y)^2}
\end{align*}
$$
