Integration by parts is the product rule read backwards. Since (fg)′=f′g+fg′, integrating gives fg back, so an integral of fg′ can be traded for an integral of f′g plus a boundary term. This helps when differentiating f makes it simpler while g′ is easy to integrate.
Put u=f(x) and v=g(x). As x runs from a to b, the point (u,v) traces the curve from (u1,v1) to (u2,v2). The area below the curve is ∫vdu and the area to its left is ∫udv; together they fill the large rectangle minus the small one, so ∫udv+∫vdu=u2v2−u1v1. With u1=f(a),u2=f(b) and so on, this is the second form of the formula. The picture assumes increasing positive f and g; the formula does not.
The differential notation dg=g′(x)dx rewrites the same product-rule integral. It identifies which factor is differentiated; it does not make dg an unrelated integration variable.
The choice of f and g′ decides whether the method helps. For ∫xexdx, taking f(x)=x turns the new integrand into ex. The opposite choice f(x)=ex,g′(x)=x is a common slip: it leads to 2x2ex−∫2x2exdx, which is harder than the original.
The same step proves the recursion Γ(x+1)=xΓ(x) of the gamma function. If the integrand is not defined at an endpoint, first work away from that endpoint and then take a limit, as in the second Example; this procedure also applies to improper integrals.
Choose f(x)=x and g′(x)=ex. Then f′(x)=1 and g(x)=ex, so ∫xexdx=xex−ex+C=(x−1)ex+C.
The expression x2lnx is not defined at zero but tends to 0 there, so it has a continuous extension to [0,1]. To evaluate its integral, apply integration by parts first on [ε,1], with f(x)=lnx and g(x)=x3/3:
∫ε1x2lnxdx=[3x3lnx]ε1−31∫ε1x2dx.
Since ε3lnε→0 as ε↓0, the integral equals −1/9.
Integrating by parts twice and solving for the integral
Compute I=∫0πexsinxdx.
First integration by parts
Take f(x)=sinx and g′(x)=ex, so f′(x)=cosx and g(x)=ex:
I=[exsinx]0π−∫0πexcosxdx=0−J,
where J=∫0πexcosxdx, because sinπ=sin0=0.
Second integration by parts, same choice of g′
Now take f(x)=cosx and again g′(x)=ex:
J=[excosx]0π+∫0πexsinxdx=−eπ−1+I.
Solve for I
Substituting J into I=−J gives I=eπ+1−I, so
I=2eπ+1.
Takeaway. When integrating by parts twice brings back the integral you started with, treat it as an unknown and solve the equation. Keep g′=ex in both rounds; switching to g′=cosx the second time undoes the first step.
Integration by PartsDifferentialDifferentiation RulesDefinite IntegralIndefinite IntegralIntegration by Substitution Type 1Integration by Substitution Type 2Antiderivative