TITLE: Continued fraction for $\tan(nx)$
QUESTION [13 upvotes]: 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.

REPLY [2 votes]: After the answer from Paul Enta it appears that the approach at the end of my question is also the same. The denominator of $\dfrac{\tan nx} {n\tan x} $ is $$1+\sum_{r=1}^{\infty} (-\tan^2x)^{r}\binom{n}{2r}$$ and ignoring first term the ratio of $(r+1)$'th term to $r$'th term is $$-\frac{(n-2r)(n-2r-1)}{2(2r+1)(r+1)}\tan^2x$$ which is a rational function in $r$ so that the series can be expressed as a hypergeometric function. The above ratio can be rewritten as $$\dfrac{\left(r+\dfrac{-n}{2}\right)\left(r+\dfrac{-n+1}{2}\right)} {\left(r+\dfrac{1}{2}\right)(r+1)} (-\tan^2x)$$ and thus the denominator of $\dfrac{\tan nx} {n\tan x} $ is $${} _{2}F_{1}\left(\frac{-n}{2},\frac{-n+1}{2};\frac{1}{2};-\tan^2x\right)$$ and in similar fashion the numerator can be written as $${} _{2}F_{1}\left(\frac{-n}{2}+1,\frac{-n+1}{2};\frac{3}{2};-\tan^2x\right)$$ and the proof is now complete via Gauss' continued fraction.