Limit of a sequence of integrals involving continued fractions The following question was asked in a calculus exam in UNI, a Peruvian university. It is meant to be for freshman calculus students.

Find $\lim_{n \to \infty} A_n $ if 
$$ A_1 = \int\limits_0^1 \frac{dx}{1 + \sqrt{x} }, \; \; \; A_2 =
 \int\limits_0^1 \frac{dx}{1 + \frac{1}{1+\sqrt{x}} }, \; \; \; A_3 =
 \int\limits_0^1 \frac{dx}{1 + \frac{1}{1+\frac{1}{1+\sqrt{x}}} },
 ...$$

First of all, I think this is a hard question for a midterm exam, but anyway, notice that we can calculate $A_1$ by making $t=\sqrt{x}$
$$ A_1 = \int\limits_0^1 \frac{2 t dt }{1+t} = 2 \int\limits_0^1 dt - 2 \int\limits_0^1 \frac{dt}{1+t}=2-2(\ln2)=2-\ln2^2 $$
Now, as for $A_2$ I would do $t = \frac{1}{1+\sqrt{x}}$ which gives $d t = \frac{ dx}{2 \sqrt{x} (1+\sqrt{x})^2} = \frac{t^2 dx}{2 (t-1)}$ thus upon sustituticion we get 
$$ A_2 = - \int\limits_1^{1/2} \frac{2 (t-1) }{t^2(1+t) } dt $$
which can easily solved by partial fractions or so. But, apparently this is not the way this problem is meant to be solved as this exam contained 4 questions to be solved in an hour. What is the trick, if any, that can be used to solve this problem without doing the unellegant  partial fractions?
 A: Let $A_n = \int\limits_0^1 f_n(x) dx$. First show that each $f_n$ is a monotonically increasing or decreasing function in the range $[0,1]$, and hence $A_n$ lies between $f_n(0)$ and $f_n(1)$. Then note that
$f_n(0) = 1, \frac{1}{2}, \frac{2}{3}, \frac{3}{5}, \dots$
are the convergents of the continued fraction expansion of $\phi$, and $f_n(1) = f_{n+1}(0)$. So we have
$\frac{1}{2} \le A_1 \le 1$
$\frac{1}{2} \le A_2 \le \frac{2}{3}$
$\frac{3}{5} \le A_3 \le \frac{2}{3}$
and so on.
So the sequence $A_n$ is squeezed between consecutive convergents of the continued fraction expansion of $\phi$. And so $\lim_{n \to \infty} A_n = \phi$.
A: If I were taking that exam, I'd speculate covergence and write the integrand for $A_\infty$ as 
$$ S_\infty(x) = \frac{1}{  1 + \frac{1}{1+\frac{1}{1+\frac{1}{\ddots} }}} = \frac{1}{1+S_\infty(x)}$$
Solve the resulting quadratic for $S_\infty^2(x) + S_\infty(x) -1 = 0$ for $S_\infty(x)=\frac{-1+\sqrt{5}}{2}$. Then we immediately have $A_\infty = S_\infty$.
Then, I'd sit there and wonder what they intended for me to actually show on a freshman calculus exam.
A: $\sqrt{x}$
is a McGuffin.
More generally,
let
$f_1 =  \frac{1}{1 + g(x) }
$
where
$g'(x) > 0,
g(0) = 0
$,
$f_n(x)
 =\frac{1}{1+f_{n-1}(x)}
$,
and
$A_n = \int_0^1 f_n(x) dx
$.
Then
$f_n(x)
\to \dfrac{\sqrt{5}-1}{2}
$.
Note:
I doubt that any of this
is original,
but this was all done
just now by me.
Proof.
$\begin{array}\\
f_n(x)
&=\frac{1}{1+\frac{1}{1+f_{n-2}(x)}}\\
&=\frac{1+f_{n-2}(x)}{1+f_{n-2}(x)+1}\\
&=\frac{1+f_{n-2}(x)}{2+f_{n-2}(x)}\\
\end{array}
$
Therefore,
if $f_{n-2}(x) > 0$
then
$\frac12 < f_n(x)
\lt 1$.
Similarly,
if $f_{n-1}(x) > 0$
then
$0 < f_n(x)
\lt 1$.
$\begin{array}\\
f_n(x)-f_{n-2}(x)
&=\dfrac{1+f_{n-2}(x)}{2+f_{n-2}(x)}-f_{n-2}(x)\\
&=\dfrac{1+f_{n-2}(x)-f_{n-2}(x)(2+f_{n-2}(x))}{2+f_{n-2}(x)}\\
&=\dfrac{1-f_{n-2}(x)-f_{n-2}^2(x)}{2+f_{n-2}(x)}\\
\end{array}
$
$\begin{array}\\
f_n(x)+f_n^2(x)
&=\dfrac{1+f_{n-2}(x)}{2+f_{n-2}(x)}+(\dfrac{1+f_{n-2}(x)}{2+f_{n-2}(x)})^2\\
&=\dfrac{(1+f_{n-2}(x))(2+f_{n-2}(x))}{(2+f_{n-2}(x))^2}+\dfrac{1+2f_{n-2}(x)+f_{n-2}^2(x)}{(2+f_{n-2}(x))^2}\\
&=\dfrac{2+3f_{n-2}(x)+f_{n-2}^2(x)+1+2f_{n-2}(x)+f_{n-2}^2(x)}{(2+f_{n-2}(x))^2}\\
&=\dfrac{3+5f_{n-2}(x)+2f_{n-2}^2(x)}{(2+f_{n-2}(x))^2}\\
\text{so}\\
1-f_n(x)-f_n^2(x)
&=\dfrac{4+4f_{n-2}(x)+f_{n-2}^2(x)-(3+5f_{n-2}(x)+2f_{n-2}^2(x))}{(2+f_{n-2}(x))^2}\\
&=\dfrac{1-f_{n-2}(x)-f_{n-2}^2(x)}{(2+f_{n-2}(x))^2}\\
\end{array}
$
Therefore
$1-f_n(x)-f_n^2(x)$
has the same sign as
$1-f_{n-2}(x)-f_{n-2}^2(x)$.
Also,
$|1-f_n(x)-f_n^2(x)|
\lt \frac14|1-f_{n-2}(x)-f_{n-2}^2(x)|
$
so
$|1-f_n(x)-f_n^2(x)|
\to 0$.
Let
$p(x) = 1-x-x^2$
and
$x_0 = \frac{\sqrt{5}-1}{2}
$
so
$p(x_0) = 0$,
$p'(x) < 0$ for $x \ge 0$.
Since
$f_n(x) > 0$,
$f_n(x)
\to x_0$.
A: As requested by the OP in a comment deleted by a moderator, switching of limit and integral sign is avoided as it requires a higher-than-expected level of knowledge for justification. Thus, a ‘simpler’ approach is presented.
By the substitution $t=\sqrt x$,
$$A_n=\int^1_0f_n(t^2)(2tdt)$$
$f_n(t^2)$ is of the form
$$f_n(t^2)=\frac{a_n+b_nt}{c_n+d_nt}$$
We have the recurrence relation
$$a_{n+1}=c_n$$
$$b_{n+1}=d_n$$
$$c_{n+1}=a_n+c_n$$
$$d_{n+1}=b_n+d_n$$
Or
$$c_{n+1}=c_n+c_{n-1}$$
$$d_{n+1}=d_n+d_{n-1}$$
which are the Fibonacci recurrence with initial conditions 
$$c_0=1, c_1=1$$
$$d_0=0, d_1=1$$
I think you can now proceed.
Also, the general term of Fibonacci sequence $0,1,1,\cdots$ is 
$$\frac{\phi^n-\overline\phi^n}{\sqrt5}$$ where $\phi=\frac{1+\sqrt 5}2$.
