I'm interested in evaluating the following definite integral
\begin{equation} I_n = \int_0^{\gamma} F_n(x)\:dx \end{equation}
Where $\gamma \gt 0$ and $F_n(x)$ is based on the recurrence relationship:
\begin{equation} F_{n + 1}(x) = \frac{1}{1 + F_n(x)} \end{equation}
Here $F_0(x) = f(x)$ where $f$ is a continuous function on $\left[0,\gamma\right]$. My first task was to find a general solution for $F_n(x)$ and this is where I've become unstuck.
I started by letting $F_n(x) = \frac{\alpha_n(x)}{\beta_n(x)}$. Applying it to the recurrence relationship we have:
\begin{equation} F_{n + 1}(x) = \frac{\alpha_{n+1}(x)}{\beta_{n+1}(x)} = \frac{\beta_n(x)}{\alpha_n(x) + \beta_n(x)} \end{equation}
And so we have a recurrence relationship over both $\alpha_n(x)$ and $\beta_n(x)$ with $F_0(x) = f(x) = \frac{\alpha_0(x)}{\beta_0(x)}$.
To begin with I'm focused on $f(x) = \sec(x)$ with $\alpha_0(x) = 1$ and $\beta_0(x) = \cos(x)$ and $\gamma = \frac{\pi}{2}$.
With a few iterations via Wolframalpha the pattern that emerges is that $F_n(x)$ takes the form:
\begin{equation} F_n(x) = \frac{\alpha_n(x)}{\beta_n(x)} = \frac{a_n\cos(x) + b_n}{c_n \cos(x) + d_n} \end{equation}
Where $a_n, b_n, c_n, d_n \in \mathbb{N}$ Here I would like to be able to solve for each but I'm not sure how to start.
Does anyone have any good starting points/references that I can use to begin?
Edit: Changed the definition of $I_n$ to have generalised upper limit of $\gamma$.
Update Thanks to hypernova's comment's below, it can be seen that $\beta_n(x)$ follows a Fibonacci Sequence:
\begin{equation} \beta_{n + 1}(x) = \beta_n(x) + \alpha_n(x) = \beta_n(x) + \beta_{n - 1}(x) \end{equation}
And so we can now represent $F_n(x)$ as:
\begin{equation} F_n(x) = \frac{\alpha_n(x)}{\beta_n(x)} = \frac{\beta_{n-1}(x)}{\beta_n(x)} \end{equation} for $n \geq 2$.
For the specific example above we have:
\begin{equation} F_n(x) = \frac{\alpha_n(x)}{\beta_n(x)} = \frac{a_{n-1}\cos(x) + b_{n-1}}{a_n \cos(x) + b_n} \end{equation} Where $a_n$ and $b_n$ are Fibonacci Sequences with $b_0 = 0$, $b_1 = 1$ and $a_0 = 1$, $a_1 = 1$. We see that $a_n \gt b_n$ (this will be important later)
So, we may now evaluate the integral
\begin{equation} I_n = \int_0^{\tfrac{\pi}{2}}\frac{a_{n-1}\cos(x) + b_{n-1}}{a_n \cos(x) + b_n}\:dx \end{equation}
I will here employ the Weierstrass substitution $t = \tan\left(\frac{x}{2} \right)$:
\begin{align} I_n &= \int_0^{\tfrac{\pi}{2}}\frac{a_{n-1}\cos(x) + b_{n-1}}{a_n \cos(x) + b_n}\:dx = \int_0^1 \frac{a_{n-1}\frac{1 - t^2}{1 + t^2} + b_{n-1}}{a_n \frac{1 - t^2}{1 + t^2} + b_n}\frac{2\:dt}{1 + t^2} \\ &= 2\int_0^1 \frac{a_{n - 1}\left(1 - t^2\right) + b_{n - 1}\left(1 + t^2\right)}{\left(1 + t^2\right)\left(a_n\left(1 - t^2\right) + b_n\left(1 + t^2\right)\right)}\:dt \\ &= 2\int_0^1 \frac{\left(b_{n - 1} - a_{n-1}\right)t^2 + \left(b_{n-1} + a_{n-1}\right)}{\left(1 + t^2\right)\left(\left(b_n - a_n\right)t^2 + \left(b_n + a_n\right)\right)}\:dt \\ &= 2\left(\frac{b_{n - 1} - a_{n-1}}{b_n - a_n}\right) \int_0^1 \frac{t^2 - \theta_{n - 1}}{\left(1 + t^2\right)\left(t^2 + \theta_n\right)}\:dt \end{align}
Where
\begin{equation} \theta_n = \frac{b_n + a_n}{b_n - a_n} \end{equation}
As $a_n \gt b_n \geq 0$ we see that $\theta_n \lt 0$. Hence:
\begin{align} I_n &= 2\left(\frac{b_{n - 1} - a_{n-1}}{b_n - a_n}\right) \int_0^1 \frac{t^2 - \left|\theta_{n - 1}\right|}{\left(1 + t^2\right)\left(t^2 - \left| \theta_n\right)\right|}\:dt \\ &= 2\left(\frac{b_{n - 1} - a_{n-1}}{b_n - a_n}\right)\left[ \frac{1}{\left|\theta_n\right| + 1} \left[\left(\left|\theta_{n-1}\right| + 1 \right) \arctan(x) + \frac{\left|\theta_{n-1}\right| - \left|\theta_{n}\right|}{\sqrt{\left|\theta_n\right|}}\operatorname{arctanh}\left(\frac{x}{\sqrt{\left|\theta_n\right|}} \right)\right]\right]_0^1 \\ &=2\left(\frac{b_{n - 1} - a_{n-1}}{b_n - a_n}\right)\left(\frac{1}{\left|\theta_n\right| + 1} \right)\left[\left(\left|\theta_{n-1}\right| + 1 \right) \frac{\pi}{4} + \frac{\left|\theta_{n-1}\right| - \left|\theta_{n}\right|}{\sqrt{\left|\theta_n\right|}}\operatorname{arctanh}\left(\frac{1}{\sqrt{\left|\theta_n\right|}} \right)\right] \end{align}
Note $b_n = a_{n - 1}$ and thus:
\begin{align} I_n &=2\left(\frac{b_{n - 1} - a_{n-1}}{b_n - a_n}\right)\left(\frac{1}{\left|\theta_n\right| + 1} \right)\left[\left(\left|\theta_{n-1}\right| + 1 \right) \frac{\pi}{4} + \frac{\left|\theta_{n-1}\right| - \left|\theta_{n}\right|}{\sqrt{\left|\theta_n\right|}}\operatorname{arctanh}\left(\frac{1}{\sqrt{\left|\theta_n\right|}} \right)\right] \\ &= \frac{a_{n - 1}}{a_n}\frac{\pi}{2} + \left[1 - \frac{a_{n + 1}\left(a_{n - 1} - a_{n - 2} \right)}{a_n\left(a_n - a_{n - 1} \right)} \right]\sqrt{\frac{a_n - a_{n - 1}}{a_{n + 1}}}\operatorname{arccoth}\left(\sqrt{\frac{a_{n + 1}}{a_n - a_{n - 1}}} \right) \end{align}