In connection with this question about computing integrals of the form $$\mathcal{I}_n=\int_0^\infty f_n(x)\,\mathrm{d}x=\int_0^\infty \frac{\mathrm{d}x}{e^x+x^n}$$ I noticed an interesting trend while plotting the integrand for $n\to\pm\infty$.
On the left, the blue curve is a plot of the integrand with $n=-1000$; on the right, $n=1000$. The orange dashed curve is $e^{-x}$.
I would think $$\lim_{n\to-\infty}\mathcal{I}_n=\int_0^\infty e^{-x}\,\mathrm{d}x=1\\ \lim_{n\to\infty}\mathcal{I}_n=\int_0^\infty 0\,\mathrm{d}x=0$$ yet the plots suggest otherwise; namely, that $$\lim_{n\to-\infty}f_n(x)=e^{-x}\theta(x-1)\\ \lim_{n\to\infty}f_n(x)=e^{-x}\theta(1-x)$$ where $\theta(x)$ is the Heaviside step function, which in turns suggests $$\lim_{n\to-\infty}\mathcal{I}_n=\frac{1}{e}\\ \lim_{n\to\infty}\mathcal{I}_n=1-\frac{1}{e}$$ If I had to guess, my "intuition" of interchanging the limit and integration fails, but what's the precise reason as to why?