This question has been asked in a similar format, but not that I've found exactly the same as mine. It may be that they are the same, but I don't understand a fundamental part so would appreciate some guidance.
I am trying to solve this:
$\int_{0}^{\infty}{ \lambda x e^{- \lambda x}} dx$
I have done integration by parts once using $u=x$ and $dv = e^{-\lambda x}$ after taking the $\lambda$ outside the integral, thus getting:
$\lambda$ $( - \dfrac{x e^{- \lambda x}}{ \lambda }$ $\Biggr|_{0}^{\infty}$ $-$ $\int_{0}^{\infty}{\dfrac{e^{-\lambda x}}{\lambda}}dx)$
and simplifying:
$( - x e^{- \lambda x}$ $\Biggr|_{0}^{\infty}$ $-$ $\int_{0}^{\infty}{e^{-\lambda x}}dx)$
Then taking the integral of the second part substituting $u=-\lambda x$ and $du=-\lambda dx$:
$- \dfrac{1}{\lambda e^{\lambda x}}$
From this point I now have:
$- x e^{- \lambda x}$ $\Biggr|_{0}^{\infty}$ $- \dfrac{1}{\lambda e^{\lambda x}}$
What I am confused about from here is that when I take this limits for the first part I get infinity, and then I have no limits to take for the second part any more. I know the answer is $\dfrac{1}{\lambda}$ but I am unsure how to get here.
I have found this question which appears to be asking the same thing: Finding $\int_0^{\infty}xe^{-\lambda x} \, dx$
However I still don't understand how I get the $\dfrac{1}{\lambda}$.
Thank you in advance.
For this case after working out the integral should be:
$-xe^{-\lambda x}-\dfrac{e^{-\lambda x}}{\lambda}$
$=-\dfrac{1}{e^{\lambda x}} \left(x+\dfrac{1}{\lambda} \right) \Biggr|_{0}^{\infty}$
The upper bound gives a value tending to $0$ because the denominator of $\dfrac{1}{e^{\lambda x}}$ increases without bound. At $0$ we have:
$=-\dfrac{1}{e^{\lambda \cdot 0}} \left(0+\dfrac{1}{\lambda} \right)=-\dfrac{1}{\lambda}$
So the result is $0-\left(-\dfrac{1}{\lambda} \right)=\dfrac{1}{\lambda}$
Maybe it's the way you did the integral. Doing the integration by parts should have given:
$I(x)=\lambda x \cdot -\dfrac{e^{-\lambda x}}{\lambda} - \displaystyle \int \lambda \cdot -\dfrac{e^{-\lambda x}}{\lambda}$
$=-xe^{-\lambda x}+\displaystyle \int e^{-\lambda x}$
$=-xe^{-\lambda x}-\dfrac{e^{-\lambda x}}{\lambda}$
$=\color{blue}{\boxed{-e^{-\lambda x}\left(x+ \dfrac{1}{\lambda} \right)}}$
Edit: The integration by parts section was a little wrong. All good now.