∫ x^2 sin x dx let's use integration by parts
Let u = x^2 ∴ du = 2x dx and dv = sin x ∴ v = -cos x
Substituting u and dv in the formula ∫ u dv = u•v - ∫ v du
∫ x^2 sin x dx = x^2 (- cos x) - ∫ - 2x cos x dx
= - x^2 cos x + 2 ∫ x cos x dx
Again integrating ∫ x cos x dx using integration by parts, let u = x ∴ du= dx and dv = cos x dx ∴ v = sin x
= - x^2 cos x + 2 [ x sin x - ∫ sin x dx ]
= - x^2 cos x + 2 [ x sin x - ( - cos x ) ] + C
= - x^2 cos x + 2 x sin x + 2 cos x + C
= 2 x sin x + 2 cos x - x^2 cos x + C.