<s>[INST] Solving Quadratics Using Continued Fractions/Nonsimple to Simple Continued Fractions Let's say we want to find the continued fraction that solves the equation $x^2 - 2x - 1 = 0$.
Solution:
$$
 x = 2 + \frac1x = 2 + \dfrac1{2 + \dfrac1x} = 2 + \dfrac1{2 + \dfrac1{2 + \dfrac1x}} = [2;\overline2]
$$
However, what happens if the quadratic is a bit more complicated, say, $2x^2 - 5x + 1 = 0$. If we use non-simple continued fractions to solve this, we get
$$
x = \frac52 -\dfrac{\frac12}{\frac52-\dfrac{\frac12}{\frac52-\ddots}} \stackrel{how?}= [ 2; \overline{3, 1, 1} ]
$$
My question is: How to convert non-simple continued fractions to simple continued fractions and in general how to solve quadratics using simple continued fractions?
 [/INST] I believe the methods above overcomplicate things.
If $x = a + \frac{b}{x}$, then $x^2 - ax - b = 0$ which is a quadratic. Dividing both sides of $2x^2-5x+1 =0$ by $2$ gives $x^2 - \frac{5}{2}x + \frac{1}{2}$, and so comparing coefficients, $a = \frac{5}{2}, b = - \frac{1}{2}$.
Thus $x = \frac{5}{2} - \frac{1/2}{x}$ gives both solutions to $x$. We can replace the $x$ in the denominator by itself to get:
$$x = \frac{5}{2} - \frac{1/2}{x}  = \frac{5}{2} - \frac{1/2}{\frac{5}{2} - \frac{1/2}{x}} = \frac{5}{2} - \frac{1/2}{\frac{5}{2} - \frac{1/2}{\frac{5}{2} + \frac{1/2}{x}}}$$
$$= \frac52 -\dfrac{\frac12}{\frac52-\dfrac{\frac12}{\frac52-\ddots}}$$
Assuming that this infinite, periodic continued fraction converges to a limit $L$, then we have $L = \frac{5}{2} - \frac{1/2}{L}$ and we can solve the quadratic.
However, this only converges to one of the roots of the given quadratic. This is the larger root in this case as if $L < \frac{5}{4}$, we have that $\frac{5}{2} - \frac{1/2}{L} < \frac{5}{4} \implies L < \frac{2}{5}$ and the maximum value of L keeps getting smaller each time.
</s>