<s>[INST] Imaginary numbers and polynomials question I have a task which I do not understand:
Consider $w = \frac{z}{z^2+1}$ where $z = x + iy$, $y \not= 0$ and $z^2 + 1 \not= 0$.
Given that Im $w = 0$, show that $| z | = 1$.
Partial solution (thanks to @ABC and @aranya):
If I substitute $z$ with $x + iy$ then we have $w = \frac{x + iy}{x^2+2xyi-y^2+1}$ or written slightly different $w= \frac{x + iy}{x^2-y^2+1+2xyi}$ or $w= \frac{x + iy}{(x^2-y^2+1)+(2xyi)}$.
In this format we can multiply with complex conjugate $w= \frac{x + iy}{(x^2-y^2+1)+(2xyi)}\cdot\frac{(x^2-y^2+1)-(2xyi)}{(x^2-y^2+1)-(2xyi)}$.
Then we get $w=\frac{x^3+xy^2-x^2yi-y^3i+x+iy}{(x^2+^2+1)^2-(2xyi)^2} = \frac{(x^3+xy^2+x)+(-x^2yi-y^3i+iy)}{(x^2+^2+1)^2+(2xy)^2} = \frac{(x^3+xy^2+x)+i(-x^2y-y^3+y)}{(x^2+^2+1)^2+(2xy)^2}$.
And as stated above, imaginary part of $w = 0$ meaning $\frac{-x^2y-y^3+y}{(x^2+^2+1)^2+(2xy)^2} = 0$.
As denominator can't be zero, means nominator is zero $-x^2y-y^3+y=0$. Or $y\cdot(-x^2-y^2+1)=0$. As $y\not=0$ implies $-x^2-y^2+1=0$ or $x^2+y^2=1$.
What now?
 [/INST] You're basically done, since $x^2+y^2=\left|z\right|^2$.
</s>