# Unclear Infinite Integration by parts: $\int_0^{\infty} xe^{-x}~dx$

I came across this example:

$$\int_0^{+\infty}xe^{-x} \ dx$$

I calculated it like this:

$$\int_0^{+\infty} xe^{-x} \ dx = \left[ -xe^{-x} \right]_0^{+ \infty} - \int_0^{+ \infty} e^{-x}dx$$

$$0 - \left[ e^{-x} \right]^{+\infty}_0 = 0-0 = 0$$

$$lim_{x \rightarrow \infty} \frac{x}{e^x}\biggr\vert^\beta_0 = \lim_{\beta \rightarrow \infty} \frac{\beta}{e^\beta} \quad L'H \\ lim_{\beta \rightarrow \infty} \frac{1}{e^\beta} = 0 \\$$

But my sample solution says:

$$\int^{\infty}_0 xe^{-x} dx = \left[ - \frac{x}{e^x}-e^{-x}\right]\biggr\vert^\infty_0 = 0-0+1 = 1$$

I dont understand where the $1$ comes from, my understanding is that the limit of that function should go to zero but instead a $1$ appears.

Can someone clear this up ?

• Note that $e^{0}=1$ – projectilemotion Aug 22 '17 at 15:04
• ...in $0-[e^{-x}]_0^{+\infty}$ – Blex Aug 22 '17 at 15:07
• I also suspect you've made a typo, but this is not a problem because you seem to have fixed it later: $$\int_0^{+\infty} xe^{-x} \ dx = \left[ -xe^{-x} \right]_0^{+ \infty} \color{red}{+} \int_0^{+ \infty} e^{-x}dx$$ – projectilemotion Aug 22 '17 at 15:15
• @projectilemotion oops, thanks for the catch, totally missed that. post an answer and I'll accept – zython Aug 22 '17 at 15:16

First of all, you seem to have made a typo, but this is not a problem because you seem to have fixed it after integrating $e^{-x}$: \begin{align}\int_0^{+\infty} xe^{-x} \ dx &= \left[ -xe^{-x} \right]_0^{+ \infty} \color{red}{+} \int_0^{+ \infty} e^{-x}dx \\&=\left[ -xe^{-x} \right]_0^{+ \infty}-\left[e^{-x}\right]_0^{+\infty}\\&=0-\left[e^{-x}\right]_0^{+\infty} \tag{1}\end{align}
Apart from that, the only mistake you made is when evaluating the right-hand side of $(1)$. Note that $e^0\neq 0$, but $e^0=1$, hence giving: $$\int_0^{+\infty} xe^{-x}~dx=0-(0-1)=1$$
• Integration by parts states that: $$\int u~dv=uv-\int v~du$$ In your case, $u=x$ and $dv=e^{-x}~dx$. Note that as a result, $v=\color{red}{-}e^{-x}$, since: $$\int e^{-x}~dx=-e^{-x}+C$$ – projectilemotion Aug 22 '17 at 15:41