Solve by integration by part

Integrate x²cos3xdx

1/3 x³sin3x - 1/9 x²cos3x + C