Convergence of a sequence defined by an integral Let me state the problem first. It is one of my calculus exercises.
$$a_n = \int_0^{\pi/2} \frac{\sin^2x}{1+\sin^2 nx}dx$$ Show that $a_n$ converges and find its limit.
The only theorem I know about the convergence of the sequence is monotone convergence theorem, but I cannot find out whether $a_n$ is monotone. The sequences defined by integral ususally gives the recurrence relation by IBP, but in this approach, effective choice of $u$ and $v'$ seems to be unclear.
Thanks in advance for all solutions, ideas, and hints.
 A: 1st Solution. Intuitively, the integral of the product of two functions, one having low frequency and the other having high frequency, tends to "decorrelate", since the low-frequency function stays almost constant over any one-period of the high-frequency function.
A more precise statement is as follows:

Proposition. Suppose

*

*$f : [a, b] \to \mathbb{R}$ is integrable, and

*$g : \mathbb{R} \to \mathbb{R}$ is $\alpha$-periodic, locally integrable, and bounded.

Then
$$ \lim_{n\to\infty} \int_{a}^{b} f(x) g(nx) \, \mathrm{d}x = \biggl( \int_{a}^{b} f(x) \, \mathrm{d}x \biggr)\biggl( \frac{1}{\alpha} \int_{0}^{\alpha} g(x) \, \mathrm{d}x \biggr). $$
Proof. Write $\overline{g} = \frac{1}{\alpha} \int_{0}^{\alpha} g(x) \, \mathrm{d}x$. Then it is easy to show that $\int_{a}^{b} g(nx) \, \mathrm{d}x \to (b - a) \overline{g} $.
Next, assume that $f(x) = \sum_{i=1}^{k} c_i \mathbf{1}_{[a_i, b_i]}$ is a step function, then
\begin{align*}
\int_{a}^{b} f(x) g(nx) \, \mathrm{d}x
= \sum_{i=1}^{k} c_i \int_{a_i}^{b_i} g(nx) \, \mathrm{d}x
\to \sum_{i=1}^{k} c_i (b_i - a_i) \overline{g}
= \biggl( \int_{a}^{b} f(x) \, \mathrm{d}x \biggr) \overline{g}.
\end{align*}
Finally, the general case follows by approximating $f$ by step functions in $L^1$-norm and then passing to the limit. $\square$

From this lemma, we find that $(a_n)$ converges to
$$ \biggl( \int_{0}^{\frac{\pi}{2}} \sin^2 x \, \mathrm{d}x \biggr)\biggl( \frac{1}{\pi} \int_{0}^{\pi} \frac{\mathrm{d}x}{1+\sin^2 x} \biggr) = \frac{\pi}{4\sqrt{2}}. $$

2nd Solution. Using the double-angle formula, we can write
$$ \frac{1}{1 + \sin^2 nx} = \frac{2}{3 - \cos (2nx)}. $$
Comparing this with the Poisson kernel for the unit disk,
$$ \sum _{k=-\infty}^{\infty} r^{|n|} e^{ik\theta} = \frac{1 - r^{2}}{1 - 2r\cos\theta + r^{2}}, \qquad |r| < 1, $$
it follows that
$$ \frac{1}{1 + \sin^2 nx}
= \frac{1}{\sqrt{2}} \sum_{k=-\infty}^{\infty} r^{|k|} e^{2kinx}
= \frac{1}{\sqrt{2}} + \sqrt{2} \sum_{k=1}^{\infty} r^{|k|} \cos(2knx) $$
for $r = 3-2\sqrt{2}$. Since this sum converges uniformly, we may perform term-by-term integration to get
$$ a_n
= \frac{1}{\sqrt{2}} \int_{0}^{\frac{\pi}{2}} \sin^2 x \, \mathrm{d}x
+ \sqrt{2} \sum_{k=1}^{\infty} r^{|k|} \int_{0}^{\frac{\pi}{2}} (\sin^2 x) \cos(2knx) \, \mathrm{d}x. $$
However, a simple trig integral shows that
$$ \int_{0}^{\frac{\pi}{2}} (\sin^2 x) \cos(2px) \, \mathrm{d}x = \begin{cases}
\pi/4, & p = 0, \\
-\pi/8, & p = 1, \\
0, & p = 2, 3, \ldots
\end{cases} $$
Therefore
$$ a_n = \left( \begin{cases}
\frac{\pi}{2} - \frac{\pi}{2\sqrt{2}}, & n = 1, \\[0.25em]
\frac{\pi}{4\sqrt{2}}, & n \geq 2
\end{cases} \right)
\quad \xrightarrow[n\to\infty]{} \quad \frac{\pi}{4\sqrt{2}}. $$
