5

Calculate the limit $$\lim_{n \to +\infty } \int_{0}^{\pi}\frac{x\cos x}{1+\sin^2(nx)}\,\mathrm dx$$

The idea was to get rid of the linear function in the numerator. I made the substitution $x=\pi -t$ and got the limit

$$\lim_{n \to +\infty} \int_{0}^{\pi }{\frac{\cos x}{1+{{\sin }^{2}}(nx)}}\,\mathrm dx$$

Then I made the substitution $t=nx$ and changed the integration limits. I find the integral separately

$$\frac{1}{n} \int_{0}^{n\pi} \frac{\cos\left(\frac{t}{n}\right)}{1+\sin^2 t} \,\mathrm dt$$

Standard trick: split the integral into $n$ elements of length $\pi$

$$\frac{1}{n} \sum_{k=0}^{n-1} \int_{k\pi}^{(k+1)\pi} \frac{\cos\left(\frac{t}{n}\right)}{1+\sin^2 t} \,\mathrm dt$$

In each term we make the replacement $u = t - k\pi$, then $t = u + k\pi$

$$\frac{1}{n} \sum_{k=0}^{n-1} \int_{0}^{\pi} \frac{\cos\left(\frac{u + k\pi}{n}\right)}{1+\sin^2 u} \,\mathrm du$$

If I’m not mistaken, the sum of cosines forms an arithmetic progression, but even after that, how can this integral be calculated? Maybe I started solving it incorrectly, can you show me the right way to solve it?

Rócherz
  • 4,241
  • 1
    The substitution $x\to\pi-x$ does not work here: $$\int_{0}^{\pi}\frac{x\cos x}{1+\sin^2(nx)}dx\overset{x=\pi-t}{=}\int_{0}^{\pi}\frac{(\pi-t)\cos (\pi-t)}{1+\sin^2(nt)},\mathrm dt=\int_{0}^{\pi}\frac{x\cos x}{1+\sin^2(nx)}dx-\int_{0}^{\pi}\frac{\pi\cos x}{1+\sin^2(nx)}dx$$ what gives only $\int_{0}^{\pi}\frac{\pi\cos x}{1+\sin^2(nx)}dx=0$, what is evident w/o calculations. – Svyatoslav Mar 20 '25 at 01:05
  • 1
    Using a bit of asymptotic analysis $$\int_{0}^{\pi}\frac{x\cos (x)}{1+\sin^2(nx)}, dx=-\sqrt2,\Bigg(1+\frac{1}{2 \pi n^2}+O\left(\frac{1}{n^3}\right)\Bigg)$$ – Claude Leibovici Mar 20 '25 at 08:42
  • @ Claude Leibovici Can you prove this? –  Mar 20 '25 at 12:18
  • @Claude Leibovici , I got $$\int_{0}^{\pi}\frac{x\cos (x)}{1+\sin^2(nx)}, dx=-\sqrt2+\left(\frac{\pi^2}{3\sqrt 2}-\frac1\pi\int_0^\pi\frac{x^2}{1+\sin^2x}dx\right)\frac{1}{n^2}+O\left(\frac{1}{n^4}\right)$$ what seems to be correct numerically already at small $n$ ( $n=5$ - https://www.wolframalpha.com/input?i=%5Cint_0%5E%5Cpi+x%5Ccos+%28x%29%2F%281%2B%5Csin%5E2%285x%29%29dx and https://www.wolframalpha.com/input?i=-%5Csqrt2%2B%28%5Cpi%5E2%2F%283%5Csqrt2%29-7.70712%2F%5Cpi%29%2F25 ) – Svyatoslav Mar 21 '25 at 09:35
  • @Svyatoslav. Beautiful ! Would you mind to look at the question I posted this morning ? Thanks in advance – Claude Leibovici Mar 21 '25 at 10:37

3 Answers3

4

A similar question has already been solved in general form General view of the problem. Let us apply for a periodic function $g(x)$ with period $p$:

$$\lim\limits_{n\to\infty}\int\limits\limits_a^bf(x)g(nx)\,\mathrm dx=\frac{1}{p}\int\limits_0^pg(t)\,\mathrm dt\int\limits_a^bf(x)\,\mathrm dx$$

In our case for $a>0$, then

$$\lim\limits_{n\to \infty}\int\limits_0^\pi \dfrac{x\cos x}{a + \sin^2(nx)}\,\mathrm dx=\int\limits_0^\pi x\cos x\,\mathrm dx\,\cdot\,\frac{2}{\pi}\int\limits_0^{\pi/2}\frac{\mathrm dt}{a+\sin^2t}=-\,\frac{2}{\sqrt{a(1+a)}}.$$

If $a=1$, then the limit is $-\sqrt{2}$.

Rócherz
  • 4,241
Parfig
  • 1,594
4

The shortcut to the answer was provided by @Parfig in his nice answer. However it is interesting to find next asymptotic terms of the integral $$I(n)=\int_0^\pi\frac{x\cos x}{1+\sin^2(nx)}dx$$ at $n\to\infty$

The integrand is the product of slow changing and highly oscillating functions; there is also a high level of symmetry. I'm sure there should be more elegant and systematic way of evaluation.

Meanwhile, we can do the following. Using the periodicity of $\sin^2x$ $$I(n)=\frac1n\int_0^{\pi n}\frac {\frac xn\cos\frac xn}{1+\sin^2x}dx=\frac1n\int_0^\pi\left(\sum_{k=0}^{n-1}\frac{x+\pi k}n\cos\frac{x+\pi k}n\right)\frac {dx}{1+\sin^2x}$$ $$=\frac1n\Im\frac{\partial}{\partial\alpha}\bigg|_{\alpha=1}\int_0^\pi e^{i\frac{\alpha x}n}\left(\sum_{k=0}^{n-1}e^{i\frac{\pi\alpha k}n}\right)\frac{dx}{1+\sin^2x}=\frac1n\Im\frac{\partial}{\partial\alpha}\bigg|_{\alpha=1}\int_0^\pi e^{i\frac{\alpha x}n}\frac{e^{\pi i\alpha}-1}{\frac{\pi i\alpha}n}\frac{\frac{\pi i\alpha}n}{e^{\frac{\pi i\alpha}n}-1}\frac{dx}{1+\sin^2x}$$ Using the decomposition $$\frac{\frac{\pi i\alpha}n}{e^{\frac{\pi i\alpha}n}-1}=\sum_{k=0}^\infty \frac{B_k}{k!}\left(\frac{\pi i\alpha}n\right)^k$$ where $B_k$ denotes Bernoulli's numbers. As $B_{2k+1}=0$ for $k=1,2, 3...$, rearranging the integrand a bit $$I(n)=\frac2\pi\Im\frac{\partial}{\partial\alpha}\bigg|_{\alpha=1}\int_0^\pi\frac{\sin\frac{\pi\alpha}2}\alpha\left(\cos\big(\frac xn+\frac\pi2\big)\alpha+i\sin\big(\frac xn+\frac\pi2\big)\right)\times$$ $$\times\left(1-\frac{\pi i\alpha}{2n}+\sum_{k=1}^\infty(-1)^k\frac{B_{2k}}{(2k)!}\left(\frac{\pi\alpha}n\right)^{2k}\right)\frac{dx}{1+\sin^2x}$$ Taking the imaginary part and differentiating, $$=-\frac2\pi\int_0^\pi\left(\cos\frac xn+\Big(\frac xn+\frac\pi2\Big)\sin\frac xn\right)\frac{dx}{1+\sin^2x}$$ $$+\frac1n\int_0^\pi\Big(\frac xn+\frac\pi2\Big)\cos\frac xn\frac{dx}{1+\sin^2x}$$ $$-\frac2\pi\sum_{k=1}^\infty(-1)^k\frac{B_{2k}}{(2k)!}\left(\frac{\pi}n\right)^{2k}\int_0^\pi\left(\cos\frac xn+\Big(\frac xn+\frac\pi2\Big)\sin\frac xn\right)\frac{dx}{1+\sin^2x}$$ $$+\frac2\pi\sum_{k=1}^\infty(-1)^k\frac{B_{2k}}{(2k-2)!}\left(\frac{\pi}n\right)^{2k}\int_0^\pi\cos\frac xn\frac{dx}{1+\sin^2x}$$ The formula looks awkward, but in fact is easy to handle. It allows to find as many asymptotic terms as we want - just decomposing the integrand in the powers $\displaystyle\frac1{n^k}$ and integrating term by term. For several first terms $$I(n)=-\frac2\pi\int_0^\pi\frac{dx}{1+\sin^2x}+\frac1n\int_0^\pi\frac{\frac\pi2-x}{1+\sin^2x}dx$$ $$+\frac1{n^2}\int_0^\pi\left(x-\frac\pi6-\frac{x^2}\pi\right)\frac{dx}{1+\sin^2x}$$ $$+\frac1{n^3}\int_0^\pi\left(\frac{x^3}6-\frac\pi4 x^2-\frac{\pi^2}{12}x\right)\frac{dx}{1+\sin^2x}+O\Big(\frac1{n^4}\Big)$$ Using $$\int_0^\pi\frac x{1+\sin^2x}dx=\frac\pi2\int_0^\pi\frac{dx}{1+\sin^2x}$$ $$\int_0^\pi\frac {x^3}{1+\sin^2x}dx=\frac{3\pi}2\int_0^\pi\frac{x^2}{1+\sin^2x}dx-\frac{\pi^3}4\int_0^\pi\frac{dx}{1+\sin^2x}$$ we see that the second and forth terms equal zero, and finally $$\boxed{\,\,I(n)=-\sqrt 2+\left(\frac{\pi^2}{3\sqrt2}-\frac1\pi\int_0^\pi\frac{x^2}{1+\sin^2x}dx\right)\frac1{n^2}+O\Big(\frac1{n^4}\Big)\,\,}$$ The integral has the closed form in terms of polylogarithm (the similar question is solved here ); numerically $\displaystyle\int_0^\pi\frac{x^2}{1+\sin^2x}dx\approx 7.70712$

Numeric check confirms the answer already at small $n$ ($n=5$ - here and here).

Svyatoslav
  • 20,502
1

With help of Mathematica:

$\int_0^{\pi } \frac{x \cos (x)}{1+\sin ^2(n x)} \, dx=\\\int_0^{\pi } \frac{2 x \cos (x)}{3-\cos (2 n x)} \, dx=\\\int_0^{\pi } 2 x \cos (x) \left(\frac{1}{2 \sqrt{2}}+\sum _{j=1}^{\infty } \frac{\left(3-2 \sqrt{2}\right)^j \cos (2 n j x)}{\sqrt{2}}\right) \, dx=\\-\sqrt{2}+\sum _{j=1}^{\infty } -\frac{2 \sqrt{2} \left(3-2 \sqrt{2}\right)^j \cos (j n \pi ) \left(\left(1+4 j^2 n^2\right) \cos (j n \pi )+2 j n \left(-1+4 j^2 n^2\right) \pi \sin (j n \pi )\right)}{\left(1-4 j^2 n^2\right)^2}=\\\sqrt{2} \left(-1-\sum _{j=1}^{\infty } \frac{2 \left(3-2 \sqrt{2}\right)^j \left(1+4 j^2 n^2\right)}{\left(1-4 j^2 n^2\right)^2}\right)=\sqrt{2} \left(-1+\frac{\left(-3+2 \sqrt{2}\right) \left(\Phi \left(3-2 \sqrt{2},2,1-\frac{1}{2 n}\right)+\Phi \left(3-2 \sqrt{2},2,1+\frac{1}{2 n}\right)\right)}{4 n^2}\right)=\\-\sqrt{2}-\frac{\text{Li}_2\left(3-2 \sqrt{2}\right)}{\sqrt{2} n^2}-\frac{3 \text{Li}_4\left(3-2 \sqrt{2}\right)}{4 \sqrt{2} n^4}-\frac{5 \text{Li}_6\left(3-2 \sqrt{2}\right)}{16 \sqrt{2} n^6}-\frac{7 \text{Li}_8\left(3-2 \sqrt{2}\right)}{64 \sqrt{2} n^8}-\frac{9 \text{Li}_{10}\left(3-2 \sqrt{2}\right)}{256 \sqrt{2} n^{10}}+O\Big(\frac1{n^{12}}\Big)$

where:$\Phi$ is Hurwitz-Lerch transcendent function and $\text{Li}$ is polylogarithm function.