Step by step
The question
Question: find the integral of x² sin x.
1 Choose u and dv
Choose u = x²: its derivative is simpler.
dv is the rest: sin x dx, which we can integrate.
2 Find du and v
du: the derivative of u, times dx.
v: the integral of dv.
sin gives minus cos.
3 Use the rule
The rule: the integral of u dv is u v, minus the integral of v du.
It comes from the product rule, backwards.
u times v, minus the integral of v times du.
Careful!
It is u v minus the integral of v du.
Not plus!
4 Parts again
The new integral has x in it again: parts again.
Choose u = −2x: its derivative is simpler, just a number.
dv is the rest: cos x dx, which we can integrate.
5 Find du and v
du: the derivative of u, times dx.
v: the integral of dv.
cos gives sin.
6 Use the rule
u times v, minus the integral of v times du.
7 The new integral
The new integral is easy: just a number times sin.
sin integrates to minus cos.
Open the bracket.
Put that back in its place.
Open the bracket: a minus in front of a bracket changes the sign of every part inside.
Add C.
So the answer is −x² cos x + 2x sin x + 2 cos x + C.
8 Check
Let's check: take the derivative of our answer.
The product rule on each term: the first's slope times the second, plus the first times the second's slope.
The other terms cancel, and we get x² sin x: the question again.
Right!
Let's look back.
First: choose u and dv.
Then: find du and v.
Then: use the rule.
Then: parts again.
Then: find du and v.
Then: use the rule.
Then: the new integral.
Last: check.