<s>[INST] Prove that for any $a,b\in \mathbb{N}$, $\sqrt{a^2+b}=a+\frac{b}{2a+\frac{b}{2a+...}}$. Prove that for any natural numbers $a$ and $b$,   $$\sqrt{a^2+b}=a+\frac{b}{2a+\frac{b}{2a+...}}.$$
This question is taken from Spivak's Calculus Chapter 22 on Infinite sequences, Problem 22-7(c).  Part (b) proves the continued fraction expansion for $\sqrt{2}$.  I cannot seem to generalize.
EDIT:  Some answers are assuming that the limit exists, however proving that the limit exists is the part I really need a solution for.  
 [/INST] You get the continued fraction as limit of $x_{n+1}=a+\frac{b}{a+x_n}$, $x_0=a$, if that limit exists. As rational iterations are not that easy to analyze, linearize them by setting $p_0=a$, $q_0=1$, and separate numerator and denominator in
$$
\frac{p_{n+1}}{q_{n+1}}=a+\frac{b}{a+\frac{p_n}{q_n}}=a+\frac{bq_n}{aq_n+p_n}
=\frac{ap_n+(a^2+b)q_n}{aq_n+p_n}
$$
to get the linear iteration
$$
\begin{bmatrix}p_{n+1}\\q_{n+1}\end{bmatrix}
=
\begin{bmatrix}a&a^2+b\\1&a\end{bmatrix}
\cdot
\begin{bmatrix}p_n\\q_n\end{bmatrix}
$$
with eigenvalues $ a\pm\sqrt{a^2+b}$ and eigenvectors $[\sqrt{a^2+b},\pm 1]^T$.
The resulting sequence of partial fractions is thus
$$
x_n=\sqrt{a^2+b}\cdot\frac{(a+\sqrt{a^2+b})^{n+1}+(a-\sqrt{a^2+b})^{n+1}}{(a+\sqrt{a^2+b})^{n+1}-(a-\sqrt{a^2+b})^{n+1}}
$$
and as $|a+\sqrt{a^2+b}|>|a-\sqrt{a^2+b}|$, this always converges to $\sqrt{a^2+b}$.
</s>