$\displaystyle \int x^2 cos(mx) dx$

I have trouble solving this. I know that i have to integrate by parts, but somehow i always get the wrong answer.... I put it into Wolframalpha, but im having a hard time following its solution

any help would be appreciated