How would I integrate the following by parts:

Integral of: (x^2)(sin (ax))dx, where a is any constant.

Just like you did x^2 exp(x) below.

Also partial integration is not the easiest way to do this integral. You can also use this method.

Evaluate first:

integral of sin(ax)dx = -1/a cos(ax)

Differentiate both sides twice w.r.t. the parameter a.

To integrate the expression (x^2)(sin(ax))dx using integration by parts, you can follow these steps:

Step 1: Choose the u and dv for the integration by parts formula. In this case, let's set:

u = x^2 (taking u as the "algebraic" function)
dv = sin(ax)dx (taking dv as the trigonometric function)

Step 2: Find the du and v by differentiating and integrating u and dv, respectively.

du = (d/dx)(x^2)dx = 2x dx
v = ∫sin(ax)dx = -1/a cos(ax)

Step 3: Apply the integration by parts formula:

∫ (x^2)(sin(ax))dx = u*v - ∫v*du

Plugging in the values we found:

∫ (x^2)(sin(ax))dx = (x^2)*(-1/a cos(ax)) - ∫ (-1/a cos(ax))*(2x dx)

Step 4: Simplify and evaluate the integral:

The first term on the right-hand side, (x^2)*(-1/a cos(ax)), can be simplified to (-x^2/a cos(ax)).

Now, let's evaluate the remaining integral, ∫ (-1/a cos(ax))*(2x dx). This integral can be further simplified using the trigonometric identity: cosθ dθ = sinθ + C.

∫ (-1/a cos(ax))*(2x dx) = -2/a ∫ xcos(ax) dx

Here we have another integral, but it's similar to the initial integral we were trying to solve. We can use integration by parts again on this integral. Let's repeat the previous steps for this integral:

Step 1: Choose u and dv:

u = x (taking u as the "algebraic" function)
dv = cos(ax)dx (taking dv as the trigonometric function)

Step 2: Find du and v:

du = (d/dx)(x)dx = dx
v = ∫cos(ax)dx = (1/a) sin(ax)

Step 3: Apply the integration by parts formula:

∫ xcos(ax) dx = u*v - ∫ v*du

Plugging in the values:

∫ xcos(ax) dx = x*(1/a)sin(ax) - ∫ (1/a)sin(ax) dx

Step 4: Simplify and evaluate the integral:

The first term on the right-hand side, x*(1/a)sin(ax), simplifies to (x/a)sin(ax).

Now, let's evaluate the remaining integral, ∫ (1/a)sin(ax) dx, which is similar to the integral we evaluated earlier.

∫ (1/a)sin(ax) dx = (1/a)[-1/a cos(ax)] = -1/(a^2) cos(ax)

Putting it all together:

∫ (x^2)(sin(ax))dx = (-x^2/a cos(ax)) - (-2/a) [(x/a)sin(ax) - (-1/(a^2) cos(ax))]

Simplifying further:

∫ (x^2)(sin(ax))dx = (-x^2/a cos(ax)) + (2/a^2) (x/a)sin(ax) - (1/(a^2) cos(ax))

This is the final result of the integration.

To integrate the function (x^2)(sin(ax))dx using integration by parts, we follow these steps:

Step 1: Choose u and dv:
Let u = x^2 and dv = sin(ax)dx.

Step 2: Find du and v:
Differentiate u with respect to x to find du:
du/dx = 2x
Integrate dv with respect to x to find v:
dv/dx = sin(ax)
Integrating both sides with respect to x:
∫dv = ∫sin(ax)dx
v = (-1/a)cos(ax)

Step 3: Apply the integration by parts formula:
The integration by parts formula states:

∫udv = uv - ∫vdu

Applying this formula to our integral:

∫(x^2)(sin(ax))dx = x^2 * (-1/a)cos(ax) - ∫(-1/a)cos(ax) * 2x dx

Step 4: Simplify and evaluate the remaining integral:
Now, we simplify the integral on the right:

∫(-1/a)cos(ax) * 2x dx = (-2/a)∫x cos(ax) dx

Since integrating ∫x cos(ax) dx by parts would be complicated, you mentioned there's an alternative method to solve this integral. You can differentiate both sides of the integral of sin(ax)dx with respect to the parameter a twice.

Let's apply the alternative method:

Differentiating dv with respect to a:
d^2v/dx^2 = -a^2sin(ax)

Differentiating both sides of the integral dv = sin(ax)dx with respect to a:
d^2v/dx^2 = -d^2x/dx^2
-a^2sin(ax) = -d^2x/dx^2

Step 5: Solve for d^2x/dx^2:
d^2x/dx^2 = a^2sin(ax)

Step 6: Substitute d^2x/dx^2 back into the simplified integral:
Substituting d^2x/dx^2 = a^2sin(ax) into the integral:

(-2/a)∫x cos(ax)dx = (-2/a)∫x d^2x/dx^2 dx
= (-2/a) ∫x a^2sin(ax) dx

Step 7: Simplify and evaluate the remaining integral:
Now, we simplify the integral on the right:

= (-2a/a^2) ∫x sin(ax)dx
= (-2/a) ∫x sin(ax)dx

Note that we have evaluated the integral of x sin(ax)dx, but it is the same form as the original integral.

So, we can substitute the result back into the earlier step:

∫(x^2)(sin(ax))dx = x^2 * (-1/a)cos(ax) - (-2/a) ∫x sin(ax)dx

= -x^2 * (1/a)cos(ax) + (2/a) ∫x sin(ax)dx

This is the final result of the integration of (x^2)(sin(ax))dx using integration by parts.