Evaluate using Integration by Parts.

x^2 cos(3x) dx

Integration by parts is just the product rule in reverse:

d(uv) = u dv + v du

∫u dv = uv - ∫ v du
Let
u = x^2
du = 2x dx

dv = cos(3x) dx
v = 1/3 sin(3x)

∫x^2 cos(3x) dx
= (x^2)(1/3 sin(3x)) - (2/3)∫x sin(3x)
dx

Let
u = x
du = dx

dv = sin(3x) dx
v = -1/3 cos(3x)

∫x sin(3x) dx
= (x)(-1/3 cos(3x)) + ∫-1/3 cos(3x) dx

Now just put it all together. You can verify your answer at wolframalpha.com

To evaluate the given integral ∫x^2 cos(3x) dx using the technique of integration by parts, we need to apply the integration by parts formula:

∫u dv = uv - ∫v du

In this case, we can choose:

u = x^2 (as our first function)
dv = cos(3x) dx (as our second function)

Now, we need to find du and v:

Differentiating u, we get:
du/dx = 2x

Integrating dv, we get:
v = ∫cos(3x) dx

To evaluate v, we can use the substitution method. Let's make the substitution:
Let u = 3x, then du = 3 dx

∫cos(3x) dx = (1/3) ∫cos(u) du

Using the integral of cos(u), we get:
∫cos(u) du = sin(u) + C

Substituting back, we have:
v = (1/3)sin(3x)

Now, we can apply the integration by parts formula:

∫x^2 cos(3x) dx = u * v - ∫v * du
= x^2 * (1/3)sin(3x) - ∫(1/3)sin(3x) * (2x) dx

Simplifying, we have:
∫x^2 cos(3x) dx = (1/3)x^2 sin(3x) - (2/3) ∫x sin(3x) dx

At this point, we have a new integral on the right side, which we can evaluate similarly using the integration by parts method.

Let's proceed with integrating by parts again:

Choosing:
u = x (as our first function)
dv = sin(3x) dx (as our second function)

Differentiating u, we get:
du/dx = 1

Integrating dv, we get:
v = - (1/3) cos(3x)

Now, we can apply the integration by parts formula again:

∫x(sin(3x)) dx = u * v - ∫v * du
= x * (-1/3) * cos(3x) - ∫(-1/3)cos(3x) * 1 dx
= - (1/3) * x cos(3x) + (1/3) ∫cos(3x) dx

We already found that ∫cos(3x) dx = (1/3) sin(3x), so substituting that in, we have:

∫x^2 cos(3x) dx = (1/3)x^2 sin(3x) - (2/3) * [-(1/3)x cos(3x) + (1/3)sin(3x)] + C
= (1/3) [x^2 sin(3x) + 2x cos(3x) - 2/9 sin(3x)] + C

Thus, the final result of the integration is:
∫x^2 cos(3x) dx = (1/3) [x^2 sin(3x) + 2x cos(3x) - 2/9 sin(3x)] + C, where C represents the constant of integration.