I'm returning to graduate school 20+ years after taking calculus. As part of a homework assignment in my statistics class, I need to find:
$$\int_0^\infty xe^{-\lambda_1x}\; dx$$
Finding this integral is one step in finding the expected value of a given continuous distribution function, whose solution is the answer to the homework question.
Now, I've had a gentle nudge by the instructor that I should use integration by parts to solve this, but even that and some looking around online hasn't helped me. I found:
$$\int f(x) g'(x) \; dx = f(x) g(x) - \int f'(x) g(x) \;dx$$
or
$$\int u \,dv = uv - \int v\, du$$
Choosing $u, dv$ and solving for $du, v$, I get:
$$u=x, du = dx, dv=e^{-\lambda_1x} \, dx, v=\int e^{-\lambda_1x}=-\frac{1}{\lambda_1} e^{-\lambda_1x}$$
I am not at all certain that I got $v$ correct, but using that, I get:
$$\int xe^{-\lambda_1x} \, dx =\frac{-1}{\lambda_1}e^{-\lambda_1x}$$
But when I plug that back into the original formula to answer the original question, I get an answer that doesn't make sense.
Can you help me find my mistake?
You have $u=x$, $du=dx$, $dv = e^{-\lambda_1x}dx$ and $v= -\frac{1}{\lambda_1}e^{-\lambda_1x}$
Plug those into the formula:
Formula: $\displaystyle \int u\,dv = uv - \int v \,du$
\begin{align*} \int x e^{-\lambda_1x}dx &= x \left(-\frac{1}{\lambda_1}e^{-\lambda_1x}\right) - \int -\frac{1}{\lambda_1}e^{-\lambda_1x} dx \\ \\ &=x \left(-\frac{1}{\lambda_1}e^{-\lambda_1x}\right) -\frac{1}{(\lambda_1)^2}e^{-\lambda_1x} \end{align*}