Finding $\int_0^{\infty}xe^{-\lambda x} \, dx$

How to integrate:

$$\int_0^\infty x \, \lambda e^{-\lambda x} \, dx$$


I tried using integration by parts:

Let $u = x$ and $dv = \lambda e^{-\lambda x} \, dx$

Then $du = dx$

And $v = - \lambda e ^{-\lambda x}$

Correct so far?

Then

$$\begin{aligned} uv - \int v \, du &= -\lambda x e^{-\lambda x} - \int (- \lambda e^{- \lambda x}) dx \\ &= -\lambda x e^{-\lambda x} - \lambda e^{-\lambda x} \end{aligned}$$


The correct answer from lecture notes

enter image description here


UPDATE 2

Let $u=\lambda x$ and $dv = e^{-\lambda x} dx$

Then $du = \lambda \, dx$

$$dv = e^{-\lambda x} \, dx$$

Let $y = -\lambda x$

Then $dy = -\lambda \, dx$

So $dx = -\frac{1}{\lambda} dy$

$$\begin{aligned} v &= \int e^u \cdot - \frac{1}{\lambda} du \\ &= - \frac{1}{\lambda} e^{-\lambda x} \end{aligned}$$

But here I seem to have an extra $- \frac{1}{\lambda}$ in $v$?

If I continue using integration by parts, I get:

$$-x e^{-\lambda x} + \color{red}{\frac{1}{\lambda}} \int e^{-\lambda x} \, dx$$


Solution 1:

Answer in not just $ -xe^{-\lambda x} $. Correct answer with limits is $ [-xe^{-\lambda x}]^{\infty} _0$ + ${\int^{\infty}_0e^{-\lambda x}dx}$ which turns out to be $1/\lambda.$

Explanation:Applying integration by parts (the correct way)

$${\int{x\lambda}e^{-\lambda x}dx} = {}\lambda x {\int e^{-\lambda x}dx} - {\lambda}{\int}[{d(x)/dx}. {\int e^{-\lambda x}}]dx$$

Now apply limit and calculate $$ = [-xe^{-\lambda x}]^{\infty} _0 + {\int^{\infty}_0e^{-\lambda x}dx} $$ $$=1/\lambda$$

Solution 2:

How to integrate:

$$\int_0^\infty x \, \lambda e^{-\lambda x} \, dx \Longrightarrow -\frac{1}{\lambda}\int_0^\infty u\, e^{u} \, \Longrightarrow (-\frac{1}{\lambda})e^u(u + 1) + C \Longrightarrow -\frac{1}{\lambda}(e^{-\lambda x}(\lambda x - 1) + C)$$

1) Choose $u = -\lambda x$. $-du = \lambda dx$. No need for integration by parts so early.