# Math Help - What's wrong with that integral

1. ## What's wrong with that integral

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

2. Originally Posted by totalnewbie
$\int xe^{-x} dx$
$u=x$
$du=dx$
$v=e^x$
$dv=e^{-x}dx$
$\int xe^{-x} dx=xe^{-x} - \int e^{-x} dx = xe^{-x}-e^{-x}+C$
mathbook gives: $-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.

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

Make the new substitution and everything will work out.

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