Q:

Prove that the equation $\tan (z)=z$ has only real roots.

Prove that the equation $\tan(z)=z$ has only real roots. How to do it?
The idea is that the increment of the argument need to look at the boundary of the square with a side of $\pi n$ and another that $\tan(z)-z$ has a pole at $0$. I do not know how to use it. 

A:

Suppose $\tan(x+iy)=x+iy$. Use the expansion $\tan(x+iy)=\frac{\sin2x}{\cos2x+\cosh2y}+i\frac{\sinh 2y}{\cos 2x+\cosh 2y}$ to get: $$\frac{1}{\cos2x+\cosh2y}(\sin2x+i \sinh2y)=x+iy .$$
This means that the 2 vectors $(\sin2x,\sinh2y)$ and $(x,y)$ are proportional, and therefore the determinant of the matrix $\begin{pmatrix}x & y \\ \sin2x &\sinh2y \end{pmatrix}=0$. 
We get $x \sinh2y=y \sin2x$. Using the well-known inequalities $$|\sin t| \leq |t|,|\sinh t| \geq |t|$$ we see that we must have $x=0$ or $y=0$ (this is true because equality holds in the inequalities above iff $t=0$).
The case $y=0$ gives the wanted real solutions, and a small calculation shows that the case $x=0$ gives the one-and-only imaginary solution, namely $z=0$.

