# Where did I went wrong $\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=0$?

Consider

$$\int_{0}^{\infty}{e^{-x}\over 1+x}\mathrm dx=-eE_i(-1)=0.596347...\tag1$$

$$\int_{0}^{\infty}\left({1\over 1+x}-e^{-x}\right)\cdot{\mathrm dx\over 1+x}=eE_i(-1)=-0.596347...\tag2$$

$$\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=1\tag3$$

$E_i(x)$;Exponential integral

Here is the problem I am so confused with

$(1)+(2)$

$$\int_{0}^{\infty}{e^{-x}\over 1+x}\mathrm dx+ \int_{0}^{\infty}\left({1\over 1+x}-e^{-x}\right)\cdot{\mathrm dx\over 1+x}=0\tag4$$

Simplify $(4)$

$$\int_{0}^{\infty}{\mathrm dx\over (1+x)^2}=0\tag5$$

$(5)$ supposed to $\color{red}1$.

Why did I went wrong?

• $(2)$ cannot be right. The integral of a positive function over $\mathbb{R}^+$ cannot be negative. – Jack D'Aurizio Feb 21 '17 at 20:31
• This looks like one of the usual bugs in programs like Mathematica or whatever is used by Wolfram Alpha, say... – DonAntonio Feb 21 '17 at 20:33
• I check and check on wolfram integrator many times – gymbvghjkgkjkhgfkl Feb 21 '17 at 20:34
• It looks like Houston has a problem the old Houston did not have :D – Jack D'Aurizio Feb 21 '17 at 20:40
• @JackD'Aurizio That just made my day XD Odd that Mathematica would just drop that $+1$ part... – Brevan Ellefsen Feb 21 '17 at 21:02

The value for integral (2) you wrote is not correct. On $[0,\infty)$, we must have $(1+x)^{-1} \ge e^{-x}$, because $$e^x = \sum_{k=0}^\infty \frac{x^k}{k!} \ge 1 + x.$$ Thus, the integrand is strictly nonnegative for all $x \ge 0$.

In Mathematica (Version 10.4 on my system), the command

Integrate[(1/(1 + x) - Exp[-x])/(1 + x), {x, 0, Infinity}]


returns E ExpIntegralEi[-1] which then evaluated numerically gives a negative real number. However,

NIntegrate[(1/(1 + x) - Exp[-x])/(1 + x), {x, 0, Infinity}]


gives 0.403653 which is correct. I suspect the issue has to do with branch cut evaluation. It may have been fixed in subsequent versions. Note that the correct value can be evaluated symbolically with the command

Integrate[1/(1 + x)^2, {x, 0, Infinity}] - Integrate[Exp[-x]/(1 + x), {x, 0, Infinity}]