# Thread: What's wrong with that integral

1. ## What's wrong with that integral

$\displaystyle \int xe^{-x} dx$
$\displaystyle u=x$
$\displaystyle du=dx$
$\displaystyle v=e^x$
$\displaystyle dv=e^{-x}dx$
$\displaystyle \int xe^{-x} dx=xe^{-x} - \int e^{-x} dx = xe^{-x}-e^{-x}+C$
mathbook gives: $\displaystyle -xe^{-x}-e^{-x}+C$
where does that minus come from ?

2. Originally Posted by totalnewbie
$\displaystyle \int xe^{-x} dx$
$\displaystyle u=x$
$\displaystyle du=dx$
$\displaystyle v=e^x$
$\displaystyle dv=e^{-x}dx$
$\displaystyle \int xe^{-x} dx=xe^{-x} - \int e^{-x} dx = xe^{-x}-e^{-x}+C$
mathbook gives: $\displaystyle -xe^{-x}-e^{-x}+C$
where does that minus come from ?
You essentially got it right, just (I assume) two small typos that screwed you up.

$\displaystyle dv=e^{-x}dx$ so $\displaystyle v=-e^{-x}$.

Make the new substitution and everything will work out.

$\displaystyle \int xe^{-x} dx = xe^{-x} - e^{-x}+C$
According to your work, the sign of the $\displaystyle e^{-x}$ term should have been a "+", which is why you got the sign of that term correct.