Showing $\lvert\cos z\rvert^2=a\cos2x+b\cosh2y$, where $z=x+iy$, for numbers $a$ and $b$ to be determined 
Show that, for $z=x+iy$,
  $$\lvert\cos z\rvert^2=a \cos2x+b\cosh2y$$
  where $a$ and $b$ are numbers to be determined.

My incomplete solution:
$$\begin{align}
\lvert z\rvert &= \sqrt{z^*z} \\
\lvert\cos(z)\rvert^2&=\frac{1}{4}e^{2iz}+\frac{1}{4}e^{-2iz}+\frac{1}{2}\\
a\cos(2x)+b\cosh(2y)&= \frac{a}{2} e^{2ix}+\frac{a}{2}e^{-2ix}+\frac{b}{2}\left(e^{2y}+e^{-2y}\right)
\end{align}$$
 A: \begin{align}\lvert\cos z\rvert^2&=\cos(z).\overline{\cos(z)}\\&=\cos(z).\cos\left(\overline z\right)\\&=\cos(x+yi)\cos(x-yi)\\&=\bigl(\cos(x)\cosh(y)-\sin(x)\sinh(y)i\bigr)\bigl(\cos(x)\cosh(y)+\sin(x)\sinh(y)i\bigr)\\&=\cos^2(x)\cosh^2(y)+\sin^2(x)\sinh^2(y)\\&=\cos^2(x)\cosh^2(y)+\bigl(1-\cos^2(x)\bigr)\bigl(\cosh^2(y)-1\bigr)\\&=\cos^2(x)+\cosh^2(y)-1\\&=\frac12\bigl(2\cos^2(x)-1+2\cosh^2(y)-1\bigr)\\&=\frac12\cos(2x)+\frac12\cosh(2y).\end{align}
A: You're not quite on the right track. Here are some hints.


*

*Find what the real and imaginary parts of $\cos z$ are.

*Remember that $\cos(A+B)=\cos A \cos B -\sin A\sin B$.

*Remember that $\cos i\theta = \cosh\theta$ and $\sin i\theta = i\sinh\theta$.

*Remember that $|u + iv|^2 = u^2 + v^2$, where $u$ and $v$ are real.
With these hints, you should be able to massage your expression for $|\cos z|^2$ to get it into the desired form.
A: Be careful that $\lvert\cos(z)\rvert^2\ne(\cos(z))^2$, in general, but
$$
\lvert\cos(z)\rvert^2=\cos(z)\,\overline{\cos(z)}
$$
The fact you may use is that $\overline{\cos(z)}=\cos(\bar{z})$, which follows from $\overline{e^z}=e^{\bar{z}}$ or, if you prefer, from the fact that the Talor series for $\cos(z)$ has real coefficients (the same for $e^z$). Now
$$
\lvert\cos(z)\rvert^2=\cos(z)\cos(\bar{z})=
\frac{e^{iz}+e^{-iz}}{2}\frac{e^{i\bar{z}}+e^{-i\bar{z}}}{2}=
\frac{e^{i(z+\bar{z})}+e^{-i(z+\bar{z})}}{2}+
\frac{e^{i(z-\bar{z})}+e^{-i(z-\bar{z})}}{2}
$$
Since $z+\bar{z}=2x$ and $z-\bar{z}=2iy$, you get
$$
\lvert\cos(z)\rvert^2=\cos(2x)+\cosh(2y)
$$
