9 May 2026

Compute the following integral: $$ {\rm I} = \lint_0^{\pi/2} \left(1 + \frac{\sin x}{2 + \frac{\sin x}{2 + \frac{\sin x}{2 + \cdots}}}\right) \diff x. $$

Proposed by the user "Saksham Rana" on the website dailyintegral.com.

Notice that the sequence $\{a_k\}_{k=0}^\infty$ given by $$ a_0 = \sin x,\qquad a_{k+1} = \frac{\sin x}{2 + a_k} $$ is monotonic and bounded, because the denominator is always greater than or equal to one. Therefore, it has a limit, for which we can solve to get the integrand as a closed expression with respect to $x$: $$ y = \frac{\sin x}{2 + y} \implies y^2 + 2y - \sin x = 0 \implies y = -1 \pm \sqrt{1 + \sin x}. $$ Since we are integrating from $0$ to $\pi/2$, $\sin x$ is always positive and thus we can drop the negative sign. A simple substitution finishes the problem $$ {\rm I} = \lint_0^{\pi/2} \sqrt{1 + \sin x} \diff x = \left\{\begin{aligned} t &= 1 - \sin x\\ \diff t &= -\cos x\diff x \end{aligned}\right\} = \lint_0^1 \frac{\sqrt{2 - t}}{\sqrt{2t - t^2}} \diff t = \lint_0^1 \frac{\diff t}{\sqrt t} = \color{green} \boxed{2.} $$