# Real and Imaginary Parts of tan(z)

This is where I'm at:

I know $$\cos(z) = \frac{e^{iz} + e^{-iz}}{2} , \hspace{2mm} \sin(z) = \frac{e^{iz} - e^{-iz}}{2i},$$ where $$\tan(z) = \frac{\sin(z)}{\cos(z)}.$$ Applying the above, with a little manipulation, gives me: $$\tan(z) = \frac{i\left(e^{-iz} - e^{iz}\right)}{e^{iz} + e^{-iz}}.$$

My thoughts are that I could use $e^{z} = e^{x+iy} = e^x\left(\cos(y) + i\sin(y) \right)$ to express both the numerator and denominator in trig form. Then I could times both by the denominator's complex conjugate as to get a real denominator, which would then, in turn, allow me to express the function in its real and imaginary parts.

However, as I'm sure you'd agree, this is messy, and it's hard to shake the idea that I'm missing something far more elegant.

• The best thing you can do is multiply the numerator and the denominator by $e^{iz}$. Then, you'll have to expand using $e^{2iz} = e^{2x} (\cos (2y) + i\sin (2y))$. – user258700 Apr 7 '16 at 14:31
• $-i$, not $i$. In the RHS of the $tan(z)$ equation. – tilper Apr 7 '16 at 14:32
• FIrst off, you have the sign wrong for your expression for $\tan(z)$. – Mark Fischler Apr 7 '16 at 14:33
• Ahmed Hussein, I am not sure what is gained by multiplying by $e^{iz}$? – Garland Apr 7 '16 at 14:40
• @Garland, then you only have two complex exponentials to worry about instead of four. – tilper Apr 7 '16 at 14:58

## 2 Answers

I think that the simpler way is to write: $$\sin z=\sin(x+iy)=\sin x \cos (iy)+\cos x \sin(iy)=\sin x \cosh y +i \cos x \sinh y$$ $$\cos z=\cos(x+iy)=\cos x \cos (iy)+\sin x \sin(iy)=\cos x \cosh y -i \sin x \sinh y$$ $$\tan z= \frac{\sin x \cosh y +i \cos x \sinh y}{\cos x \cosh y -i \sin x \sinh y} \cdot\frac{\cos x \cosh y +i \sin x \sinh y}{\cos x \cosh y +i \sin x \sinh y} =$$ $$=\frac{\sin x \cos x +i \sinh y \cosh y}{\cosh^2 y - \sin^2 x} =\frac{\sin 2x +i \sinh 2y }{2\cosh^2 y - 2\sin^2 x+1-1}=\frac{\sin 2x +i \sinh 2y }{\cos 2x+\cosh2y}$$

Your way seems also good but a bit more complicated.
Edit note: x was written y by mistake in two of expressions which I corrected so that no confusion is encountered.

\begin{align} \tan(x+iy) &=\overbrace{i\frac{e^{y-ix}-e^{ix-y}}{e^{y-ix}+e^{ix-y}}}^{\tan(z)=i\frac{e^{-iz}-e^{iz}}{e^{-iz}+e^{iz}}}\overbrace{\frac{e^{y+ix}+e^{-ix-y}}{e^{y+ix}+e^{-ix-y}}}^1\\ &=i\frac{e^{2y}-e^{-2y}+e^{-2ix}-e^{2ix}}{e^{2y}+e^{-2ix}+e^{2ix}+e^{-2y}}\\[3pt] &=\frac{\sin(2x)+i\sinh(2y)}{\cosh(2y)+\cos(2x)} \end{align}