TITLE: Computing $\lim\limits_{n\to+\infty}n\int_{0}^{\pi/2}xf(x)\cos ^n xdx$
QUESTION [24 upvotes]: 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?

REPLY [4 votes]: 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$.