Integration by parts
Substitution undoes the chain rule. Integration by parts undoes The product rule, and it helps with products such as x e to the power x, where neither factor is the derivative of something inside the other.
Where it comes from
The product rule says that the derivative of u v is u prime v plus u v prime. Integrating both sides gives back u v on the left:
Moving the last integral across gives the rule:
One factor, u prime, is integrated to u; the other, v, is differentiated to v prime. The rule swaps one integral for another, so it only helps when the new one is easier.
Which factor is which
Let v be the factor that gets simpler when differentiated, and u prime one that doesn't get worse when integrated. A power of x shrinks when differentiated, and e to the power x, sine of x and cosine of x stay about the same when integrated. So in
v is x, with v prime equals 1, and u prime is e to the power x, with u equals e to the power x. The rule gives
and the new integral is easy:
The other choice, v equals e to the power x and u prime equals x, would give x squared over 2 inside the new integral: worse, not better.
ln x the other way round
ln of x is the exception: it is hard to integrate, but its derivative, 1 over x, is simple. So with ln of x in a product, let v be ln of x. In the integral of x times ln of x d x, u prime is x, with u equals x squared over 2:
The new integral is the integral of x over 2 d x, which is x squared over 4. So the answer is x squared over 2 times ln of x minus x squared over 4 plus C.
Twice
With x squared, one round leaves x, so the rule is used again:
The new integral is twice the one above, 2 the quantity x e to the power x minus e to the power x. Mind the minus in front of it, which goes to both terms:
∫u′v dx = uv − ∫uv′ dx. Let v be the power of x, which shrinks, and u′ be eˣ, sin x or cos x; with ln x, let v be ln x.