To integrate the function x² cos x, we can use the method of integration by parts, which is based on the formula:
∫u dv = uv – ∫v du
Here, we will choose:
- u = x² (which means du = 2x dx)
- dv = cos x dx (which means v = sin x)
Now applying the integration by parts formula:
∫x² cos x dx = x² sin x – ∫sin x (2x) dx
The remaining integral, ∫sin x (2x) dx, still requires integration by parts. So, we apply it again:
- u = 2x (thus du = 2 dx)
- dv = sin x dx (therefore v = -cos x)
Using the integration by parts formula again:
∫(2x) sin x dx = -2x cos x + ∫2 cos x dx
The integral of cos x is straightforward:
∫2 cos x dx = 2 sin x
Now putting everything together:
∫x² cos x dx = x² sin x – (-2x cos x + 2 sin x)
So, we simplify that:
∫x² cos x dx = x² sin x + 2x cos x – 2 sin x + C
Here, C is the constant of integration. Therefore, the final answer is:
∫x² cos x dx = x² sin x + 2x cos x – 2 sin x + C