TITLE: Evaluating: $\lim_{n\to\infty} \int_{0}^{\pi} e^x\cos(nx)\space dx$
QUESTION [8 upvotes]: 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.

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