Evaluating: $\lim_{n\to\infty} \int_{0}^{\pi} e^x\cos(nx)\space dx$ Evaluate the limit:
$$\lim_{n\to\infty} \int_{0}^{\pi} e^x\cos(nx)\space dx$$
W|A tells that the limit is $0$, but i'm not sure why is that result or if this is the correct result.
 A: Here's the standard non-integration by parts form of the intergral, using Euler's identity:
$$\begin{align}
\int_0^\pi e^x \cos(nx)\ dx  &= \mathfrak{Re}\left(\int_0^\pi e^x e^{inx}\ dx \right) \\
&= \mathfrak{Re}\left(\int_0^\pi e^{(1+in)x}\ dx \right) \\
&= \mathfrak{Re}\left( \left. \frac{1}{1+in}e^{(1+in)x} \right |_0^\pi\right) \\
&= \mathfrak{Re}\left( \left. \frac{1-in}{1+n^2}e^{(1+in)x} \right |_0^\pi\right) \\
\end{align}$$
and it's relatively straightforward to find an explicit form for the latter term using Euler's identity the 'other way', but not even necessary; from here all the exponential terms in $n$ are clearly going to wind up as $\sin(nx)$ and $\cos(nx)$ terms before evaluating, and so they're drowned out by the $O(1/n)$ factor in front of the evaluation.
A: The intuitive reason why this is true is that successive half-waves of the cosine cancel each other out, since every other half-wave is the negative of its neighbor.
The canceling is not perfect because two neigboring half-waves get multiplied by different parts of the $e^x$ factor. But $e^x$ is continuous, which means that it is "almost constant" when we look only at small $x$ intervals. As $n$ increases, the partial canceling-out of neighboring half-waves takes place across shorter and shorter $x$ intervals, which means the the $e^x$ multipliers become more and more the same between neighboring half-waves.
In the $n\to\infty$ limit, the cancellation becomes perfect.
A: This might be the more mechanical solution. André's is very clever.
Let $$I(n) =\int_0^\pi e^x \cos nx dx$$
The $nx = u$, we get
$$I(n) =\frac{1}{n} \int_0^{\pi n} e^{u/n} \cos u du$$
$$I(n) =\frac{1}{n} \int_0^{\pi n} e^{\alpha u} \cos u du$$
with $\alpha =1/n$.
We have that
$$\int_0^{\pi n} {{e^{\alpha u}}} \cos udu = \left. {{e^{\alpha u}}\frac{{\alpha \cos u + \sin u}}{{1 + {\alpha ^2}}}} \right|_0^{\pi n} = {e^\pi }\frac{{\cos \pi n + n\sin \pi n}}{{n + \frac{1}{n}}} - \frac{1}{{n + \frac{1}{n}}}$$
So that
$$\int_0^\pi  {{e^x}} \cos nxdx = {e^\pi }\frac{{\cos \pi n + n\sin \pi n}}{{{n^2} + 1}} - \frac{1}{{{n^2} + 1}}$$
From this it is evident
$$\mathop {\lim }\limits_{n \to \infty } \int_0^\pi  {{e^x}} \cos nxdx = {e^\pi }\mathop {\lim }\limits_{n \to \infty } \frac{{\cos \pi n + n\sin \pi n}}{{{n^2} + 1}} - \mathop {\lim }\limits_{n \to \infty } \frac{1}{{{n^2} + 1}} = 0$$
A: Hint: Integrate by parts, letting $u=e^x$ and $dv=\cos nx \,dx$. 
To get an explicit antiderivative, you will have to do two cycles of integration by parts. However, for the limit calculation, one cycle will do, and is in a sense more informative. 
Added: We get $du=e^x\,dx$ and can take $v=\frac{1}{n}\sin nx$. Since $uv$ vanishes at both ends, we find that
$$\int_0^\pi e^x \cos nx \,dx=-\frac{1}{n}\int_0^\pi e^x\sin nx \,dx.$$
But $|e^x\sin nx|\le e^x$. 
A: This is a consequence of the much more general Riemann-Lebesgue lemma, which (in one version) says that for any $L^1(\mathbb R)$ function $f$ we have
$$\lim\limits_{n\to\infty}\int_{-\infty}^\infty f(x)\cos(nx)dx=0.$$
In your case, the function $f$ is 
$$f(x)=\begin{cases}
e^x &\text{if  }\; 0\leq x\leq\pi\\
0 &\text{otherwise}
\end{cases}$$
which is certainly in $L^1(\mathbb R)$. This lemma can be proven for characteristic functions of intervals by integrating by parts, then using linearity of integration extended to step functions, and finally proven by using the density of step functions in $L^1(\mathbb R)$.
