Showing that $\displaystyle\lim_{n \to +\infty}(-1)^n\frac{n^n + \ln n}{\cos(n\pi)(n + \pi)^n} = e^{-\pi}$

How to evaluate the limit $$\lim_{n \to +\infty}(-1)^n\frac{n^n + \ln n}{\cos(n\pi)(n + \pi)^n}$$?

I was suspecting that the sequence does not converge, but the ratio test, which is the only one that I know, turned out to be useless. The limit of the ratio $\frac{a_{n+1}}{a_n}$ is $1$, so the test is inconclusive.

It turns out the result is $\boxed{\displaystyle e^{-\pi}}$, but I fail to see how one would reach it.

Any suggestions?

• $(-1)^n$ and $\cos(n\pi)$ cancel out, $\log n$ gives a smallish contribute. Then, what is the limit $$\lim_{n\to +\infty}\left(\frac{n}{\pi +n}\right)^n$$? – Jack D'Aurizio Jan 10 '15 at 11:47
• @JackD'Aurizio: Thanks, I hadn't realized that $(-1)^n$ and $\cos(n\pi)$ represent the same thing! – rubik Jan 10 '15 at 12:03

Observe that $\cos(\pi n)=(-1)^n$, hence $$(-1)^n\frac{n^n+\log n}{\cos(\pi n)(n+\pi)^n}=\frac{n^n+\log n}{(n+\pi)^n}=\frac{1+\frac{\log n}{n^n}}{\left(1+\frac{\pi}{n}\right)^n}$$ Now the numerator goes to $1$, and the denominator is a notable limit, it goes to $e^{\pi}$, hence you get what you wanted.