Q:

Modulus of tangent of complex number

I need to find real, imaginary parts of $\tan(x+yi)$ and the modulus of it.  I have: 
$$\operatorname{Re}(\tan(x+yi))={\frac{\sin2x}{\cos2x+\cosh2x}}$$
and
$$\operatorname{Im}(\tan(x+yi))={\frac{\sinh2y}{\cos2x+\cosh2x}}$$
I know that $|Z|={\sqrt{\operatorname{Re}^2+\operatorname{Im}^2}}$. But when I calculate with the results I've got, I don't get the actual answer on the book, which is $${\sqrt{{\frac{\cosh2y-\cos2x}{\cosh2y+\cos2x}}}}$$

A:

You can observe that
\begin{align}
\sin^22x+\sinh^22y
&=1-\cos^22x+\cosh^22y-1\\
&=\cosh^22y-\cos^22x\\
&=(\cosh2y+\cos2x)(\cosh2y-\cos2x)
\end{align}

