Evaluate a limit involving definite integral Evaluate the following limit:
$$\lim_{n \to \infty} \left[n - n^2 \int_{0}^{\pi/4}(\cos x - \sin x)^n dx\right]$$
I've tried to rewrite the expression as follows:
$$\lim_{n \to \infty} \left[n - n^2 \sqrt{2}^n \int_{0}^{\pi/4}\sin^n \left( \frac{\pi}{4} - x \right) dx\right]$$
However, this doesn't seem to help too much. Thank you!

We may go through Laplace's method. $\cos(x)-\sin(x)$ is positive and concentrated in a right neighbourhood of the origin; by expanding $\log(\cos(x)-\sin(x))$ as a Taylor series we get $\cos(x)-\sin(x)= e^{-x-x^2+O(x^3)}$. In particular the first two terms of the asymptotic expansion of
$$ I(n) = \int_{0}^{\pi/4}\left(\cos(x)-\sin(x)\right)^n\,dx $$
are the same as
$$ J(n) = \int_{0}^{+\infty}\exp\left(-nx-nx^2\right)\,dx = \frac{1}{n}-\frac{2}{n^2}+O\left(\frac{1}{n^3}\right)$$
and the wanted limit is $\color{red}{\large 2}$. In terms of hypergeometric functions we are stating that
$$ \lim_{n\to +\infty}\left[n-\frac{n^2}{n+1}\;\phantom{}_2 F_1\left(\frac{1}{2},1;\frac{n+3}{2};-1\right)\right]=2.$$
