Continued fraction for $\tan(nx)$ I found this beautiful continued fraction expansion of $\tan(nx)$, $n$ being a positive integer, online but I don't remember the source now:
$\displaystyle \tan(nx) = \cfrac{n\tan x}{1 -\cfrac{(n^{2} - 1^{2})\tan^{2}x}{3 -\cfrac{(n^{2} - 2^{2})\tan^{2}x}{5 -\cfrac{(n^{2} - 3^{2})\tan^{2}x}{7 -\cdots}}}}$
the last term in the continued fraction being $\dfrac{(n^{2} - (n - 1)^{2})\tan^{2}x}{(2n - 1)} = \tan^{2}x$. For example for $n = 3$ we have
$\displaystyle \tan 3x = \cfrac{3\tan x}{1 -\cfrac{8\tan^{2}x}{3-\cfrac{5\tan^{2}x}{5}}}$
which is correct and can be verified easily. I would like to know a simple proof via elementary trigonometry and algebra.
I had asked this question long back on NRICH(https://nrich.maths.org/discus/messages/153904/145455.html) but did not get any helpful answer. The reason I wish to know the proof is that it will lead me to an elementary proof of continued fraction expansion of $\tan z$. Putting $nx = z$ where $z$ is kept constant and $n$ is made to tend to $\infty$ (so that $x \to 0$) we get
$\displaystyle \tan z = \cfrac{z}{1-\cfrac{z^{2}}{3 -\cfrac{z^{2}}{5-\cfrac{z^{2}}{7-\cdots}}}}$
instead of the complicated proof by Lambert given in my blog http://paramanands.blogspot.com/2011/04/continued-fraction-expansion-of-tanx.html
I have got another formula from an exercise in "A Course of Pure Mathematics" by G. H. Hardy:
$$\cos nx = 1 - \frac{n^{2}}{2!}\sin^{2}x - \frac{n^{2}(2^{2} - n^{2})}{4!}\sin^{4}x - \frac{n^{2}(2^{2} - n^{2})(4^{2} - n^{2})}{6!}\sin^{6}x - \cdots$$
I will try to find out if this formula can be used to prove the continued fraction expansion of $\tan(nx)$.
Update: This question was originally posed by Euler in 1813. See Chrystal's Algebra Vol 2 (page 526, problem 31).
Further Update: The following approach looks promising but I don't know how to complete it.
We have $\tan nx=A/B$ where $$A=\binom{n} {1}\tan x-\binom{n}{3}\tan ^3x+\dots$$ and $$B=\binom{n} {0}-\binom{n}{2}\tan ^2x+\dots$$ and thus $$\frac{\tan nx} {n\tan x} =\frac{C} {B} =\dfrac{1}{1+\dfrac{B-C}{C}}$$ where $$C=1-\frac{(n-1)(n-2)}{3!}\tan^2x+\dots$$ Next $$B-C=-\frac{n^2-1^2}{1!3}\tan^2x+\frac{(n^2-1^2)(n-2)(n-3)}{3!5}\tan^4x-\dots$$ and this can be rewritten as $$-\frac{n^2-1^2}{3}\tan^2x\left(1-\frac{(n-2)(n-3)}{2!5}\tan^2x+\dots\right)$$ If the expression in large parentheses above is $D$ then we have $$\frac{\tan nx} {n\tan x} =\dfrac{1}{1-\dfrac{(n^2-1^2) \tan^2x}{3+\dfrac{3C-3D}{D}}}$$ The problem now is to put $B, C, D$ into a common pattern so that we can easily get the next expressions like $E, F, \dots$.
Thanks to user Paul Enta (and his wonderful answer) the above approach is completed via the use of hypergeometric series. See my answer for details. 

This continued fraction can be obtained from the Gauss' continued fraction for the ratio of two hypergeometric fractions after some preparation. One can express
\begin{equation}
 \tan nx = \frac{\sin nx}{\sin x}\frac{\cos x}{\cos nx}\tan x
\end{equation} 
Using the Chebyshev polynomials of the first and of the second kind, with $z=\cos x$,
\begin{align}
 T_n(z)&=\cos nx\\
 U_{n-1}(z)&=\frac{\sin nx}{\sin x}
\end{align} 
one may express
\begin{equation}
  \tan nx = n\tan x\frac{zU_{n-1}(z)}{nT_n(z)}
\end{equation} 
Denoting
\begin{equation}
 A=\frac{zU_{n-1}(z)}{nT_n(z)}
\end{equation} 
we introduce the representation of the polynomials in terms of hypergeometric functions here and here:
\begin{equation}
 A=z\frac{{}_2F_1\left(-n+1,n+1;\frac{3}{2};\frac{1-z}{2}  \right)}{{}_2F_1\left(-n,n;\frac{1}{2};\frac{1-z}{2}  \right)}
\end{equation} 
Now, to change the variable in order to obtain $-\tan^2x$, we use the quadratic transformation of the functions DLMF:
\begin{equation}
 {}_2F_1\left(a,b;\frac{1}{2}(a+b+1);u\right)=(1-2u)^{-a}{}_2F_1\left(\frac{1}{2}a,%
\frac{1}{2}a+\frac{1}{2};\frac{1}{2}(a+b+1);\frac{4u(u-1)}{(1-2u)^{2}}%
\right)
\end{equation} 
and thus
\begin{equation}
 A=\frac{{}_2F_1\left( \frac{-n+1}{2},-\frac{n}{2}+1;\frac{3}{2};-\frac{1-z^2}{z^2} \right)}{{}_2F_1\left( \frac{-n}{2},\frac{-n+1}{2};\frac{1}{2};-\frac{1-z^2}{z^2} \right)}
\end{equation} 
which can be written as
\begin{equation}
 A=\frac{{}_2F_1\left( a,b+1;c+1;v \right)}{{}_2F_1\left(a,b;c;v\right)}
\end{equation} 
where $a=(1-n)/2,b=-n/2,c=1/2,v=-\tan^2x$.
This ratio can be expressed as a Gauss's continued fraction:
\begin{equation}
\frac{{}_2F_1\left(a,b;c;z\right)}{{}_2F_1\left(a,b+1;c+1;z\right)}=t_{0%
}-\cfrac{u_{1}z}{t_{1}-\cfrac{u_{2}z}{t_{2}-\cfrac{u_{3}z}{t_{3}-\cdots}}}
\end{equation} 
where
\begin{align}
 t_k&=c+k\\
 u_{2k+1}&=(a+k)(c-b+k)\\
 u_{2k}&=(b+k)(c-a+k)
\end{align}
Here
\begin{align}
 t_k&=\frac{2k+1}{2}\\
 u_{2k+1}&=\frac{1}{4}\left( (2k+1)^2 -n^2\right)\\
 u_{2k}&=\frac{1}{4}\left( 4k^2 -n^2\right)
\end{align}
then $u_p=\frac{1}{4}(p^2-n^2)$. We can express
\begin{equation}
 A^{-1}=\frac{1}{2}-\cfrac{\frac{n^2-1^2}{4}\tan^2x}{\frac{3}{2}-\cfrac{(n^2-2^2)/4\tan^2x}{\frac{5}{2}-\cfrac{(n^2-3^2)/4\tan^2x}{\frac{7}{2}-\cdots}}}
\end{equation} 
or
\begin{equation}
  A^{-1}=1-\cfrac{(n^2-1^2)\tan^2x}{3-\cfrac{(n^2-2^2)\tan^2x}{5-\cfrac{(n^2-3^2)\tan^2x}{7-\cdots}}}
\end{equation} 
Finally, 
\begin{equation}
 \tan nx=\cfrac{n\tan x}{1-\cfrac{(n^2-1^2)\tan^2x}{3-\cfrac{(n^2-2^2)\tan^2x}{5-\cfrac{(n^2-3^2)\tan^2x}{7-\cdots}}}}
\end{equation} 
EDIT: The quadratic transform is valid for $(1-z)/2<1/2$ or $\cos x>0$. However the decomposition $\tan nx=An\tan x$ shows that $A$ must be invariant through the change $x\to \pi+x$, so we can assume $z>0$ in the transform.
