# Computing $\lim\limits_{n\to+\infty}n\int_{0}^{\pi/2}xf(x)\cos ^n xdx$

I got stuck at the following problem.

Let $f\in C([0,\pi/2])$, then compute $$\lim_{n\to+\infty}n\int\limits_{0}^{\pi/2}xf(x)\cos ^n xdx$$

Could you suggest a helpful idea?

-

Note that $|x-\sin x|\ll x$ when $x\to0$. Hence, as soon as the function $f:[0,\pi/2]\to\mathbb R$ is

1. measurable bounded,  2.  continuous at $0$,

(no other property being necessary for the proof below to hold), there exists a function $g:[0,\pi/2]\to\mathbb R$ such that

1. $g$ is measurable bounded,  2.  $g(x)\to0$ when $x\to0$,

and such that, for every $x$ in $[0,\pi/2]$, $$xf(x)=f(0)\sin x+g(x)\sin x.$$ Thus, the $n$th integral one is interested in is $$I_n=\dfrac{n}{n+1}(f(0)\,J_n+K_n),$$ with $$J_n=(n+1)\int_0^{\pi/2}\sin x\,(\cos x)^n\,\mathrm dx=\left[-(\cos x)^{n+1}\right]_0^{\pi/2}=1,$$ and $$K_n=(n+1)\int_0^{\pi/2}g(x)\sin x\,(\cos x)^n\,\mathrm dx.$$ By (1.), there exists $C$ such that $|g(x)|\leqslant C$ for every $x$. By (2.), for every $\varepsilon\gt0$, there exists $x_\varepsilon\gt0$ such that $|g(x)|\leqslant\varepsilon$ for every $x\leqslant x_\varepsilon$. Hence, $$|K_n|\leqslant\varepsilon J_n+(n+1)C\int_{x_\varepsilon}^{\pi/2}\sin x(\cos x)^n\,\mathrm dx=\varepsilon+C\,(\cos x_\varepsilon)^{n+1}.$$ When $n\to\infty$, $(\cos x_\varepsilon)^{n+1}\to0$ because $x_\varepsilon\gt0$, hence $\limsup\limits_{n\to\infty}|K_n|\leqslant\varepsilon$. This holds for every $\varepsilon\gt0$ hence $\lim\limits_{n\to\infty}K_n=0$. Finally, $$\lim\limits_{n\to\infty}I_n=f(0).$$

-

Here is a statistical solution. Let $X_1,\dots, X_n$ be i.i.d. random variables on $[0,\pi/2]$ with density $f_X(x)=\sin(x)$. The distribution function of $X$ is $F(x)=1-\cos(x)$. Now let $M=\min(X_1,\dots, X_n)$; its density function is $$f_M(x)=n(1-F(x))^{n-1}f_X(x)=n\,\cos^{n-1}(x)\sin(x).$$ Also, it is not hard to see that $M\to 0$ in distribution as $n\to\infty$. Now $$\int_0^{\pi/2} n \cos(x)^n xf(x)\,dx =\int_0^{\pi/2} f_M(x) \,\cos(x)\,{x\over \sin(x)}f(x)\,dx =\mathbb{E}\left(\cos(M)\,{M\over \sin(M)}\,f(M)\right).$$ Since $f$ is continuous, this converges to $\cos(0)\cdot1\cdot f(0)=f(0)$ as $n\to\infty$.

-
+1 Nice. Why did you call this a statistical, as opposed to a probabilistic solution? –  Sasha Aug 13 '12 at 1:29
@Sasha Well, the problem made me think of order statistics. –  Byron Schmuland Aug 13 '12 at 2:34
This is neat. But I don't know probability well enough to accept this solution. –  Norbert Aug 13 '12 at 7:13
@Norbert OK. I hope this gives you a new perspective. It may be worth learning the basics of weak convergence of probability measures. –  Byron Schmuland Aug 13 '12 at 15:12

By the Weierstraß approximation theorem, we can approximate $f$ arbitrarily well (in the supremum norm) by a polynomial. For a polynomial $p$, we have

\begin{align} n\int_0^{\pi/2}xp(x)\cos ^n x\,\mathrm dx &= \int_0^{\pi/2}\frac{x\cos x}{\sin x}p(x)n\sin x\cos ^{n-1} x\,\mathrm dx \\ &= \left[-\frac{x\cos x}{\sin x}p(x)\cos^n x\right]_0^{\pi/2}+\int_0^{\pi/2}\left(\frac{x\cos x}{\sin x}p(x)\right)'\cos^n x\,\mathrm dx\;. \end{align}

The boundary term evaluates to $p(0)$ for all $n$, and the integral goes to $0$, so the limit is $p(0)$. Now

\begin{align} \left|n\int_0^{\pi/2}xf(x)\cos ^n x\,\mathrm dx-n\int_0^{\pi/2}xp(x)\cos ^n x\,\mathrm dx\right| &= n\int_0^{\pi/2}x|f(x)-p(x)|\cos ^n x\,\mathrm dx \\ &\le \epsilon n\int_0^{\pi/2}x\cos ^n x\,\mathrm dx\;, \end{align}

which is just $\epsilon$ times the desired integral for $f\equiv1$ and thus by the above goes to $\epsilon$ for $n\to\infty$. Since both the function values at $0$ and the limits of the integrals differ at most by $\epsilon$, which can be made arbitrarily small, the desired limit is $f(0)$.

-
Could we then approximate $f$ with a polynomial and finish this? –  clark Aug 13 '12 at 0:03
@clark: I started writing out that same idea, then realized that we can't argue that the integral goes to $0$ because $p$ might have to depend on $n$ to control the error. –  joriki Aug 13 '12 at 0:04
Call your integral $J(f)$. Note that if $|f(x) - p(x)| < \epsilon$, $|J(f) - J(p)| \le \epsilon J(1)$ –  Robert Israel Aug 13 '12 at 0:06
@joriki: $$\left|\int_0^{\pi/2} x (f(x) - p(x)) \cos(x)^n\ dx \right| \le \int_0^{\pi/2} x |f(x) - p(x)| \cos(x)^n\ dx \le \epsilon \int_0^{\pi/2} x \cos(x)^n\ dx$$ because $x \cos(x)^n \ge 0$ on $[0,\pi/2]$. –  Robert Israel Aug 13 '12 at 0:15
If $\lim_{n \to \infty} n J(p) = p(0)$ for all polynomials $p$, and $|f - p| < \epsilon$ on $[0,\pi/2]$, then $|n J(f) - n J(p)| < \epsilon n J(1) < 2 \epsilon$ for $n$ sufficiently large. –  Robert Israel Aug 13 '12 at 0:30

Call $I_n =n \int_0^{\frac{\pi}{2}} xf(x)\cos^n xdx$. You can rewrite it $I_n = \int_0^{\frac{\pi}{2}} \frac{xf(x)}{\sin x}n \sin x \cos^n xdx$, and now if we make the change of variable $u = \cos^{n+1}x$, we have $du = -(n+1)\sin x \cos^n x dx$, and $x = \arccos(u^{1/n})$. So now we can rewrite $I_n$:

$$I_n = \int_0^1 \frac{\arccos(u^{1/n}) }{\sin(\arccos(u^{1/n}))} f(\arccos(u^{1/n}))\frac{n}{n+1} du$$

We have the quantity $\frac{\arccos(u^{1/n}) }{\sin(\arccos(u^{1/n}))} f(\arccos(u^{1/n}))\frac{n}{n+1}$ that goes towards $f(0)$ when $n$ goes towards $+\infty$, so by virtue of the dominated convergence, $I_n \rightarrow \int_0^1 f(0) du = f(0)$

-

We have

$$\int_{0}^{\pi/2}xf(x)\cos^n x \,dx = \int_0^{\pi/2} x f(x) \exp\Bigl(n\log \cos x\Bigr)\,dx.$$

The quantity $\log \cos x$ has a maximum at $x = 0$ and

$$\log \cos x = -\frac{x^2}{2} + O(x^4)$$

as $x \to 0$, so it can be shown by the Laplace method that

$$\int_{0}^{\pi/2}xf(x)\cos^n x \,dx \sim \int_0^\infty x f(0) e^{-nx^2/2}\,dx = \frac{f(0)}{n}$$

as $n \to \infty$.

-