How does one come up with the continued fraction for the arctangent? $\arctan x=\frac{x}{1+}\frac{x^2}{3+}\frac{(2x)^2}{5+}\cdots$ $\newcommand{\K}{\operatorname{\large{K}}}$The question has already been asked here. However, I find the accepted answer unsatisfactory since it details all the parts which are, in my opinion, trivial, and the one step it doesn't elaborate on is precisely the step I consider non-trivial. I am a bit stuck, so I'd like to ask here. I’ll be using Gauss’ Kettenbrücher K-notation for continued fractions, analogous to the $\sum,\prod$ notations.
We know that: $$\arctan x=x-\frac{x^3}{3}+\frac{x^5}{5}-\cdots$$For $|x|\lt1$ and we know Euler's continued fraction formula: $$a_0\left(1+\K_{n=1}^\infty\frac{-a_n}{1+a_n}\right)^{-1}=a_0+a_0a_1+a_0a_1a_2+\cdots$$So it is quite easy to find $a_0=x,\,a_n=-\frac{2n-1}{2n+1}x^2$ as suitable for the arctangent, to get: $$\arctan x=x\left(1+\K_{n=1}^\infty\frac{\frac{2n-1}{2n+1}x^2}{1-\frac{2n-1}{2n+1}x^2}\right)^{-1}=\cfrac{x}{1+\cfrac{\frac{1}{3}x^2}{1-\frac{1}{3}x^2+\cfrac{\frac{3}{5}x^2}{1-\frac{3}{5}x^2+\cdots}}}$$And by clearing the denominators we obtain: $$\tag{1}\arctan x=\cfrac{x}{1+\cfrac{x^2}{3-x^2+\cfrac{(3x)^2}{5-3x^2+\cdots}}}$$But the accepted answer to the linked post claims a different fraction follows. Apparently, if one uses Euler's formula - with the same coefficients I used - it is a matter of simple algebra to arrive at: $$\tag{2}x\left(1+\K_{n=1}^\infty\frac{\frac{2n-1}{2n+1}x^2}{1-\frac{2n-1}{2n+1}x^2}\right)^{-1}\overset{?}{=}\cfrac{x}{1+\cfrac{x^2}{3+\cfrac{(2x)^2}{5+\cfrac{(3x)^2}{7+\cdots}}}}$$
This is corroborated by Wikipedia. Unfortunately I am at a complete loss as to how to go from $(1)$ to $(2)$. One thing I have noticed - it suffices to show: $$\K_{n=1}^\infty\frac{(nx)^2}{2n+1}=\K_{n=1}^\infty\frac{((2n-1)x)^2}{(2n+1)-(2n-1)x^2}=\K_{n=1}^\infty\frac{(n^2x-(n-1)^2x)^2}{(n+1)^2-n^2-(nx)^2+((n-1)x)^2}$$As $2n-1=n^2-(n-1)^2$, which seems half-promising, but I just don't see the trick needed to procede.
Other than equivalence transformations given by clearing denominators, I don't know how to manipulate continued fractions. What are we supposed to do here?
Note: I see that it is also possible to prove this result, and many others, using the Gauss continued fraction identities for the hypergeometric functions. I have never studied the hypergeometric functions: if you can answer using them, I’d really appreciate it if the answer was written in such a way that avoids the general theory. But, that shouldn’t be necessary, since the accepted answer to the linked post claims the result follows from “algebra”.
 A: For reference, here is a computation using generating functions. We show that $$\cfrac{z}{1+\cfrac{z^2}{3+\cfrac{(2z)^2}{5+\cfrac{(3z)^2}{7+\dots}}}}$$ exists and equals $\arctan z$ for $z\in\mathbb{C}$ with $1+z^2\notin\mathbb{R}_{\leqslant 0}$.
The above equals $\lim\limits_{n\to\infty}(P_n/Q_n)$, where the vectors $R_n=(P_n,Q_n)$ satisfy $$R_0=(0,1),\quad R_1=(z,1),\quad R_{n+1}=(2n+1)R_n+(nz)^2 R_{n-1}\quad(n>0)$$ or, if we put $R_n=n!S_n$, so that $S(t)=\sum_{n=0}^\infty S_n t^n$ exists if $|t|$ is small enough, $$(n+1)S_{n+1}=(2n+1)S_n+nz^2 S_{n-1}\quad(n>0)$$ which, multiplied by $t^n$ and summed over $n$, gives $$S'(t)-S_1=2tS'(t)+S(t)-S_0+z^2\big(t^2 S'(t)+tS(t)\big),$$ i.e. $(1-2t-z^2 t^2)S'(t)-(1+z^2 t)S(t)=S_1-S_0$. The solution with $S(0)=S_0$ is $$S(t)=\frac1{\sqrt{1-2t-z^2 t^2}}\left(S_0+(S_1-S_0)\int_0^t\frac{d\tau}{\sqrt{1-2\tau-z^2\tau^2}}\right)$$ (let's postpone the computation of the integral). The singularities (branch points) of $S(t)$ are $$t_\pm=\frac1{1\pm\sqrt{1+z^2}},\qquad|t_+|<|t_-|;$$ the singularity analysis of $S(t)$ as $t\to t_+$ (as covered in Analytic Combinatorics by P. Flajolet and R. Sedgewick, chapter VI) shows that $\lim\limits_{n\to\infty}S_n/(t_+^n\sqrt{n})$ exists, and if $S(t)=\big(P(t),Q(t)\big)$ then $$\lim_{n\to\infty}\frac{P_n}{Q_n}=\lim_{t\to t_+}\frac{P(t)}{Q(t)}=z\int_0^{t_+}\frac{d\tau}{\sqrt{1-2\tau-z^2\tau^2}},$$ with $t\to t_+$ radially (say). Now it's time to evaluate the integral and get the expected result.
