Finding the roots of $\tanh(x)-\tan(x)=0$ I solved this equation by Wolfram Alpha. How can I solve it analytically to find all roots $$\tanh(x)-\tan(x)=0$$ 
 A: There is a root in each interval $((n-1/2) \pi, (n+1/2)\pi)$, because $\tanh(x)$ is bounded there while $\tan(x)$ goes from $-\infty$ to $+\infty$.  If we take
$x = n \pi + t$ and $z = \exp(-2 \pi n)$, then 
$$\tan(t) = \tan(x) = \tanh(n \pi + t) = \dfrac{1 - e^{-2\pi n - 2 t} }{1 + e^{-2 \pi n - 2 t}}  = \dfrac{1 - z e^{-2t}}{1 + z e^{-2t}}$$
There is a series solution 
$$ t = \dfrac{\pi}{4} - e^{-\pi/2} z - 2 e^{-\pi} z^2 - \dfrac{17}{3} e^{-3 \pi/2} z^3 - \dfrac{56}{3} e^{-2\pi} z^4 + \ldots
 $$
That's the closest you'll come to an "analytical" solution, I think.
A: The $n$-th positive roots of $\tan(x)=\tanh(x)$  will be noted $r_n$ with $n>0$. 
Since the functions are odd the negative roots are  $r_{-n}=-r_n$. Obviously $r_0=0$
For $n$ large, $\tanh(r_n)$ is close to $1$. So, $\tan(r_n)$ is close to 1. As a consequence $r_n$ is close to $\pi n+\frac{\pi}{4}$.
Let $x=\pi n+\frac{\pi}{4}+\epsilon$.
The series expansion of $$f(\epsilon)=\tan\big(\pi n+\frac{\pi}{4}+\epsilon\big)-\tanh\big(\pi n+\frac{\pi}{4}+\epsilon\big)$$ leads to a first approximate of $\epsilon$ so that $f(\epsilon)\sim 0$. This is a boring task. The result is :
$$r_n\simeq\pi n+\frac{\pi}{4}-\frac{1+e^{\frac{\pi}{2}(4n+1)}}{1+e^{\pi(4n+1)}}$$
It should be an harder and even more boring task to compute the next term of the series, now starting from $x=\pi n+\frac{\pi}{4}-\frac{1+e^{\frac{\pi}{2}(4n+1)}}{1+e^{\pi(4n+1)}}+\epsilon$
Nevertheless, the first approximate $R_n$ of the $n$-th root is already very accurate :
$$r_n\simeq R_n=\pi n+\frac{\pi}{4}-\frac{1+e^{\frac{\pi}{2}(4n+1)}}{1+e^{\pi(4n+1)}}$$
$\tan(R_1)-\tanh(R_1)=3.02\space 10^{-7}$ with $R_1=3.92660246314$
$\tan(R_2)-\tanh(R_2)=1.05\space 10^{-12}$ with $R_2=7.068582745629$
$\tan(R_3)-\tanh(R_3)=1.78\space 10^{-15}$ with $R_3=10.210176122813$
