# Explain U-substititution with $\int_0^{\infty}\frac{e^x}{e^{2x} +1}\mathrm dx$

The integral does not diverge.

Choose $u = e^x$ so $\mathrm dx = \frac{\mathrm du}{e^x}$ so $\int_0^{\infty}(\frac{e^x}{e^{2x}+1})\mathrm dx$ becomes $\int_1^{\infty}( \frac{\mathrm du}{u^2 +1})$ but it diverges.

What is the fallacy here? I clearly made some mistake in changing the base but I cannot spot it.

-
In your second link, you integrated with respect to $x$. This works fine. – Dylan Moreland Aug 22 '11 at 16:05
By the way, it's the integral that doesn't diverge. There's no equation in sight. – Hans Lundmark Aug 22 '11 at 18:37

The fallacy is the claim that $\int_1^{\infty}\frac{du}{u^2+1}$ diverges.
\begin{align*} \int_1^{\infty}\frac{du}{u^2+1} &= \lim_{t\to\infty}\int_1^t\frac{du}{u^2+1}\\ &= \lim_{t\to\infty}\left(\arctan(u)\Bigm|_{1}^{t}\right)\\ &= \lim_{t\to\infty}\left(\arctan(t) - \arctan(1)\right)\\ &= \lim_{t\to\infty}\left(\arctan(t) - \frac{\pi}{4}\right)\\ &= \frac{\pi}{2} - \frac{\pi}{4} = \frac{\pi}{4}. \end{align*}