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


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$$
 A: 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$$
A: 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.
A: Of course, $\lambda > 0$ must be assumed.
Another way: 
$$ \lambda x e^{-\lambda x} = - \lambda \dfrac{\partial}{\partial\lambda}  e^{-\lambda x}$$
$$ \eqalign{\int_0^R \lambda x e^{-\lambda x} \; dx &= 
- \lambda \dfrac{d}{d\lambda} \int_0^R e^{-\lambda x}\; dx = -\lambda \dfrac{d}{d\lambda} \left(\dfrac{1}{\lambda} - \dfrac{e^{-\lambda R}}{\lambda}\right) = \dfrac{1}{\lambda} + (\ldots) e^{-\lambda R}\cr
&\to \dfrac{1}{\lambda} \text{ as } R \to \infty\cr}
$$
And yet another, and more general:
The Maclaurin series for $g(s) = \int_0^\infty e^{(s-1) \lambda x}\; dx$  is
$$ g(s) = \int_0^\infty \sum_{n=0}^\infty \dfrac{s^n \lambda^n x^n}{n!} e^{-\lambda x}\; dx = \sum_{n=0}^\infty \dfrac{s^n}{n!} \int_0^\infty \lambda^n x^n e^{-\lambda x}\; dx$$
But $$g(s) = \dfrac{1}{(1-s)\lambda} = \frac{1}{\lambda} \sum_{n=0}^\infty s^n$$
so for nonnegative integers $n$
$$\int_0^\infty \lambda^n x^n e^{-\lambda x}\; dx = \dfrac{n!}{\lambda}$$
