Originally Posted by

**TheMathTham** So I have two integration by parts problems that I am having trouble with. For both of these problems, I have the answer but I cannot figure out how to get there.

The first one is $\displaystyle \int x^2 cos(x)dx$. First off, I made u = x^2 and dv = cos(x)dx. Next step, I found that du = 2xdx and v = sin(x). So going off of $\displaystyle u*v - \int v*du$, I got $\displaystyle x^2 sin(x) - \int sin(x)*2xdx$. Simplifying that down further leaves me with $\displaystyle x^2 sin(x) + 2cos(x)$. However, the answer is $\displaystyle (x^2 - 2) sin(x) + 2cos(x)$. What did I mess up?