Prove that all roots of $z\tan z = k$ lie in $\Bbb R$, where $k$ is a positive, non-zero real number. The question is that given in the title;

Prove that all roots of the equation $z\tan z = k$ lie in $\Bbb R$, where $k$ is a positive non-zero real number.

I attempted a somewhat "brute force" approach by simply letting $z = a + bi$, with $a, b \in \Bbb R$. Under this assumption, if $a = 0$ (that is, $z$ is purely imaginary), we come to the conclusion that $k$ must be of the form
$$-b\tanh b = k.$$
If $b > 0$ then $\tanh b \in (0,1]$ and so $-b\tanh b < 0$. If $b < 0$ then $\tanh b \in [-1, 0)$ since $\tanh$ is odd, and so again, $-b\tanh b < 0$, and so for $k \in \Bbb R_{>0}$, we cannot have purely imaginary $z$. 
Consider then the case that $z = a + bi$ where $a, b \neq 0$. Then after some manipulation, we end up with
$$z\tan z = \frac{\tan a + i\tanh b}{1 - i\tan a \tanh b}.$$
Since both $\tan$ and $\tanh$, with domain restricted to $\Bbb R$, also have codomain $\Bbb R$, this ratio must be complex, since $\tanh b = 0$ iff $b = 0$, which we excluded under assumption, and so $k$ is complex if $z$ is complex.
The only remaining possibility is that $z \in \Bbb R$, the result has been proven.
I think this is somewhat hand-wavy at best; can anyone give me a more satisfactory/elegant proof of this result? 
 A: Edit: As Valent points out in the comment below, it appears the premise is false: the main calculation here omits a factor of $z,$ which changes the problem. This solution is not correct as written!


This is really only a slight tweaking of your argument to remove the casework and fix a few holes. It also shows the result for $k\in\Bbb R$, not just $k\in\Bbb R^+$.


Say $z = a + bi$. Then $$z\tan z = \frac{\tan a + i\tanh b}{1 - i\tan a\tanh b} = \left(\frac{1}{1 + \tan^2 a\tanh^2 b}\right)\left(\tan a(1 - \tanh^2 b) + i\tanh b(1 + \tan^2 a)\right).$$ $\left(\frac{1}{1 + \tan^2 a\tanh^2 b}\right)\in\Bbb R^+$, because $\tan$ and $\tanh$ are real valued when restricted to $\Bbb R$.


Hence, it is enough to show that if $\tan a(1 - \tanh^2 b) + i\tanh b(1 + \tan^2 a)$ is real, then $b = 0$. For this quantity to be real, we need $\tanh b(1 + \tan^2 a) = 0$. This forces either $\tanh b = 0$ or $1 + \tan^2 a = 0$. However, $\tan^2 a\geq 0$, so $1 + \tan^2 a\geq 1$. Thus, if $z\tan z$ is real, we must have $\tanh b = 0$. As you've said, this happens if and only if $b = 0$, which means that $a + bi\in\Bbb R$.

A: (See Real and imaginary part of $\tan(a+bi)$ )
$$\tan(x+iy)=\frac{\sin2x+i\sinh2y}{\cos2x+\cosh2y}$$
$$(x+iy)\tan(x+iy)=\frac{(x\sin2x-y\sinh2y)+i(x\sinh2y+y\sin2x)}{\cos2x+\cosh2y}$$
This shows that $(x+iy)\tan(x+iy)$ is real exactly when
$$x\sinh2y=-y\sin2x.$$
We want to know whether there are solutions with $y\neq0$. If $x=0$, then the real part of the function has the same sign as $-y\sinh2y$, which has the same sign as $-y^2$, which is not positive. So assume $xy\neq0$. Then we have
$$\frac{\sinh2y}{2y}=-\frac{\sin2x}{2x}.$$
But the left side is always greater than $1$, while the right side is always smaller than $1$. So there is no solution here.
Thus $z\tan z$ is a positive real number only when $z$ is real.
A: The solution uses the partial fraction expansion
$$\pi z\cdot  \tan \pi z = \sum_{k \ \textrm{odd integer}} \frac{z^2}{(\frac{k}{2})^2 - z^2}$$
Consider the rational fraction $\phi_a(\cdot)$ with
$$\phi_a(z) = \frac{z}{a-z} = \frac{a}{a-z}-1$$
If $a>0$ then $\phi_a$ invariates the upper (lower) half complex plane, that is $\phi_a(\mathcal{H}_{\pm}) \subset \mathcal{H}_{\pm}$ ( in fact here we have equality). Now the map $z\mapsto z^2$ takes the first open quadrant to the upper half plane $\mathcal{H}_+$,  and the second one to the lower half plane $\mathcal{H}_-$. Therefore, for $a>0$ the  function
$$z\ \mapsto \frac{z^2}{a-z^2}$$
maps the first quadrant to the upper half plane, and the second quadrant to the lower half plane. We conclude that any function of the form
$$f\colon z\mapsto \sum_{a>0} c_a \cdot \frac{z^2}{a- z^2}$$
takes the first quadrant (Re, Im $>0$) to the upper half plane ( Im $>0$) and the second quadrant to the lower half plane.  We conclude that $f^{-1}(\mathbb{R}) = \mathbb{R}$.
$\bf{Added:}$ Another method
We have
$$\tan(x+i y) = \frac{\sin 2x + i \sinh 2y}{\cos 2x + \cosh 2 y}$$
Let us show that $f(z) \colon = z\ \tan z$ takes the first quadrant and third quadrant to the upper half plane. Then using $f(\bar z) = \bar f(z)$ ($f$ real) we see to what half plane will each quadrant go.
For $y\ne 0$ we have $\cosh 2y >1$ so the denominator $\cos 2x + \cosh y>0$. Let us that for $x\cdot y>0$  the imaginary part of
$(x+i y) ( \sin 2 x + i \sinh 2y)$
is $>0$, that is $x \sinh 2y + y \sin 2x>0$. With $2x = s$, $2y = t$, $\ s \cdot t>0$ we have to show that
$s \sinh t + t \sin s > 0$, or
$$\frac{\sinh t}{t} + \frac{\sin s}{s} >0$$
Now
$$\frac{\sinh t}{t} = 1 + \frac{t^2}{3!} + \frac{t^4}{5!}+ \cdots > 1$$
for all $t \in \mathbb{R}$, $t\ne 0$, while
$$1 + \frac{\sin s}{s} = \frac{1}{s} \cdot \int_0 ^s (1 + \cos u) du >0$$
for all $s\in \mathbb{R}$, $s\ne 0$. We are done.
