# Why is this integral “inconsistent”?

I am currently working on the following integral: $$\int_{-\infty}^{\infty} xe^{-|x+1|} dx$$ The method I use for it is Integration by Parts. When I calculate the integral $\int_{-\infty}^{\infty} e^{-|x+1|} dx$ separately (by splitting the modulus about $1$), the answer is $2$. However, when I plug it into the question, I get $0$ when the answer (according to the answer key provided) is $-2$. Why is there a disparity?

Steps used for Integration by Parts: $$\int_{-\infty}^{\infty} xe^{-|x+1|} dx=x \int_{-\infty}^{\infty} e^{-|x+1|} dx -\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} e^{-|x+1|} dx dx$$

$$\int_{-\infty}^{\infty} e^{-|x+1|} dx=2$$ Therefore, $$\int_{-\infty}^{\infty} xe^{-|x+1|} dx=2x-2\int_{-\infty}^{\infty} dx = 2x-2x=0$$

• Please show the steps you used in doing it by parts. – coffeemath Aug 24 '15 at 8:05
• The answer key is correct. Why do you think it's $0$? – anomaly Aug 24 '15 at 8:09
• @coffeemath, I have added the steps – Artemisia Aug 24 '15 at 8:11
• The last line doesn't make any sense. For one thing, what's $x$? It's a dummy integration variable on the left side of the first equation, so what does it mean on the right? Revisit integration by parts in the context of definite integrals. – anomaly Aug 24 '15 at 8:16
• @Artemisia You asked your question, got answers, then fell silent. Don't you think that is, at the very least, rude? That's not the way this site works. – 5xum Aug 24 '15 at 9:00

\begin{align}\int_{\mathbb{R}} x e^{-|x+1|}\,dx &= \int_{\mathbb{R}}(u-1)e^{-|u|}\,du\tag{1}\\&=\int_{\mathbb{R}}ue^{-|u|}\,du-\int_{\mathbb{R}}e^{-|u|}\,du\tag{2}\\&=-2\int_{0}^{+\infty}e^{-u}\,du\tag{3}\\&=\color{red}{-2}.\end{align} Explanation:

• $(1)$: use the substitution $x=u-1$;
• $(2)$: split the integral and recall that the integral of an odd, integrable function over a symmetric domain with respect to the origin is zero, while the integral of an even integrable function over the same set is just twice the integral over the positive part of the set;
• $(3)$: compute a simple integral.

Sorry to say this, but what you wrote down looks like a total mess.

You say:

$$\int_{-\infty}^{\infty} xe^{-|x+1|} dx=x \int_{-\infty}^{\infty} e^{-|x+1|} dx -\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} e^{-|x+1|} dx dx$$

Can you explain how this is correct? How did you get the double integral on the right? Why do you integrate over the same variable twice (which is impossible to do)? How does the equality

$$\int_{-\infty}^{\infty} e^{-|x+1|} dx=2$$

follow from anything you wrote above?

You say:

Therefore, $$\int_{-\infty}^{\infty} xe^{-|x+1|} dx=2x-2\int_{-\infty}^{\infty} dx = 2x-2x=0$$

Can you explain exactly why the first equality would be correct?

If you first substitute $x=u-1,$ the integrand becomes $(u-1)e^{|u|}$ which may then be multiplied into two functions, one being an odd function (integral $0$) and the other $-e^{|u|}$ which comes out the $-2.$ [Note no need to change the integration limits for this substitution]