Proving upper bound $|\tan(z)| < 2$ on a contour I have to find an upper bound as described in the title. First I'll give some background of the question.
For $k \in \mathbb{N}$, let $\alpha_k$ be the boundary of the square with vertices $k\pi(1+i)$, $k\pi(-1+i)$, $k\pi(-1-i)$ and $k\pi(1-i)$. Furthermore let $D = \{ z \in \mathbb{C}: z \neq 0 \quad \text{and} \quad \cos z \neq 0\}$ and define $f:D \rightarrow \mathbb{C}$ :
\begin{equation}
f(z) = \frac{\tan z}{z^2}.
\end{equation}

I have to show that $|\tan z|<2$ on $\alpha_k$ for all k.

So I thought of first writing the tangent as a quotient of the sine and cosine and then write it with complex powers of $e$. So I end up with:
\begin{equation}
\tan z = \frac{1}{i} \frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}}.
\end{equation}
Then I assumed that $z = x + iy$ and after a lot of of trigonometric formulas I've found that:
\begin{equation}
|\tan z| = |\tan (x+iy)| = \sqrt{\frac{1}{(\cosh(2y)+\cos(2x))^2}\left( \sin^2(2x) + \sinh^2(2y) \right)}.
\end{equation}
And here I got stuck. Perhaps we can use the fact that we have to show this upper bound on the contour $\alpha_k$ and use that the maximum modulus of z there is $k\pi$, but I don't see how we can arrive on the bound 2 from here.
Does anyone have an idea how we can proceed or can tell me if I'm on the right track with this attempt?
Thanks in advance!
-DS
 A: In THIS ANSWER, I showed that for all $N\in \mathbb{N}$, $|\cot(\pi z)|<2$ for $|z|=N+1/2$.  Following a similar approach, we can write  
$$\begin{align}
\bbox[5px,border:2px solid #C0A000]{|\tan(z)|=\sqrt{1-\frac{2\cos(2 x)}{\cosh(2 y)+\cos(2 x)}}} \tag 1
\end{align}$$
We now restrict $z$ to be on the rectangular contour with vertices at $(k\pi, k\pi)$, $(-k\pi, k\pi)$, $(-k\pi, -k\pi)$, and $(k\pi, -k\pi)$.  
Since $|\tan(z)|$ is even in both $x$ and $y$, we need only analyze the part of the contour in the first quadrant.
For $x=k\pi$ and $0\le y\le k\pi$, we have
$$\begin{align}
|\tan(z)|&=\sqrt{1-\frac{2}{\cosh(2y)+1}}\\\\
&<1
\end{align}$$
For $y=k\pi$ and $0\le x\le k\pi$, we have
$$\begin{align}
|\tan(z)|&=\sqrt{1-\frac{2\cos(2x)}{\cosh(2k\pi )+\cos(2x)}}\\\\
&<\sqrt{1+\frac{2}{\cosh(2k\pi)-1}}\\\\
&<\sqrt{1+\frac{2}{\cosh(2\pi)-1}}\\\\
&<1.04
\end{align}$$
And we are done!
A: On the vertical sides of any square $\alpha_k$ the tangent function is bounded by $1$ (the tangent is periodic with period $\pi$). So it remains to derive bounds on the horizontal sides.
The tangent function maps the interval $(-\pi/2, \pi/2)$ onto the real line. By $$\tan(x + i y) = \frac{\tan(x) + \tan(i y)}{1 - \tan(x) \tan(i y)}$$ it follows that for real $y > 0$ it maps the line given by $\operatorname{Im}(z)=y$ onto a circle, namely the image of $\mathbb{R} \cup \{\infty\}$ under the Möbius transformation $$z\mapsto \frac{z + \tan(i y)}{1 - \tan(i y)\, z}.$$ (This circle has its center on the imaginary axis and intersects the unit circle orthogonally.)  From this it follows that the modulus of tangent on the line $\operatorname{Im}(z)=y$ is bounded by the modulus of the top point on this circle, which is $-1/\tan(i y) = i \coth(y)$.
Combining all this shows that $\lvert \tan(z) \rvert \leq \coth(\pi)$ on each square $\alpha_k$. 
