Substitution (lesson 2.6.1) undoes the chain rule. Integration by parts undoes the product rule. It turns the integral of a product into a different integral, in which one factor has been differentiated and the other integrated.
Call the two factors u and v. The product rule (lesson 2.3.2) says (uv)′=u′v+uv′.
Integrate both sides: the left side gives back uv, so uv=∫u′vdx+∫uv′dx. Move one integral across and
∫uv′dx=uv−∫u′vdx
The shorthand dv=v′dx and du=u′dx, as in lesson 2.6.1, gives the usual form.
Rule: Integration by parts
∫udv=uv−∫vdu
Split the integrand into u, a factor to differentiate, and dv, a factor to integrate. Then du=u′dx, and v is any antiderivative of dv; the +C waits until the end. The method helps when ∫vdu is easier than the integral you started with.
A first example: xex
In ∫xexdx, differentiating x gives 1, which is simpler. Integrating ex gives ex again, which is no worse. So choose u=x and dv=exdx.
1
u=x,dv=exdxdu=dx,v=ex
2
∫xexdx=xex−∫exdx
3
∫xexdx=xex−ex+C=(x−1)ex+C
Check with the product rule: dxd[(x−1)ex]=ex+(x−1)ex=xex.
Numbers agree too. With F(x)=(x−1)ex, the area under tet from 0 to x is F(x)−F(0)=(x−1)ex+1 (lesson 2.5.3). A numerical integral gives the same values.
right edge x
0.5
1
2
area from 0 to x, by quad
0.175639
1
8.389056
(x−1)ex+1
0.175639
1
8.389056
Try it
quad(f, a, b) (lesson 2.5.3) integrates numerically; [0] keeps the value. The loop prints both rows of the table.
SymPy then integrates xex by itself and gets the same antiderivative.
⌘/Ctrl + Enter runs the cell
The area picture
Lesson 2.3.2 drew the product uv as the area of a rectangle. Integration by parts splits that rectangle into two pieces, one for each integral.
Take ∫1elnxdx with u=lnx and v=x. As x runs from 1 to e, the point (v,u)=(x,lnx) traces a curve from (1,0) to (e,1).
The rectangle out to (e,1) has area e. The curve u=lnv splits it into ∫udv=1, under the curve, and ∫vdu=e−1, beside it.
Under the curve, measured along the v axis, is ∫udv=∫1elnxdx, the integral we want.
Beside the curve, measured along the u axis, is ∫vdu. Here u runs from 0 to 1 and v=eu, so this area is ∫01eudu=e−1.
Together they fill the rectangle e×1. The value uv at the start is 1×0=0, so nothing is cut off there.
So ∫1elnxdx=e−(e−1)=1. In general [uv] is the rectangle at the end minus the rectangle at the start, and the two integrals share what is left.
Choosing the parts
Choose u to be the factor that gets simpler when you differentiate it. Choose dv to be a factor you can integrate, and that does not get worse. Each line of the table leaves out the +C.
integrand
u
dv
antiderivative
xe2x
x
e2xdx
4(2x−1)e2x
xe−x
x
e−xdx
−(x+1)e−x
lnx
lnx
dx
xlnx−x
xlnx
lnx
xdx
2x2lnx−4x2
A log goes in u. Its derivative x1 is simpler, and it is hard to integrate. For lnx alone, the other factor is an unseen 1, so dv=dx and v=x.
Otherwise a power of x goes in u. Each derivative lowers its power by one.
Watch the sign of v. For dv=e−xdx, v=−e−x: dividing by k=−1, as in lesson 2.5.2. So ∫xe−xdx=−xe−x+∫e−xdx=−(x+1)e−x+C.
The other choice for xex shows what goes wrong. With u=ex and dv=xdx, v=2x2 and the new integral is ∫2x2exdx. The power of x went up, so the integral got harder.
Try it
The cell differentiates each answer in the table and subtracts the integrand. A check of 0 means the answer is right.
The last line is the bad choice: the integral it leaves behind contains x2, a higher power than before.
⌘/Ctrl + Enter runs the cell
Parts with limits
For a definite integral, evaluate uv at both limits, as in the fundamental theorem (lesson 2.5.3).
Rule: Parts with limits
∫abudv=[uv]ab−∫abvdu
[uv]ab means uv at b minus uv at a. Both terms use the same limits.
That is about 0.264241. The figure's integral works the same way: ∫1elnxdx=[xlnx]1e−∫1e1dx=e−(e−1)=1.
Repeated parts
One round of parts lowers a power of x by one. If a power is still left, use parts again.
For ∫x2exdx, take u=x2 and dv=exdx. Then ∫x2exdx=x2ex−∫2xexdx. The new integral is twice the first example, 2(x−1)ex, so
∫x2exdx=(x2−2x+2)ex+C
With limits, ∫01x2exdx=(1−2+2)e−2=e−2≈0.718282. A cube needs three rounds: ∫x3exdx=(x3−3x2+6x−6)ex+C.
An integral that comes back
Sometimes parts brings back the integral you started with. Then treat it as an unknown and solve for it, as in lesson 0.3.2.
Call I=∫xlnxdx. Take u=lnx and dv=x1dx, so du=x1dx and v=lnx. Parts gives
I=(lnx)2−∫xlnxdx=(lnx)2−I
Add I to both sides: 2I=(lnx)2, so I=2(lnx)2+C. Substitution found the same answer in lesson 2.6.1.
The best-known case is ∫exsinxdx, where two rounds bring it back. It needs the slopes of sinx and cosx from lesson 2.3.5: cosx and −sinx. The answer is 21ex(sinx−cosx)+C.
Try it
The cell checks the two repeated-parts answers, the integral that came back, and the exsinx answer, each by differentiating. Then it computes ∫01x2exdx.
SymPy writes e as E, so e−2 appears as -2 + E.
⌘/Ctrl + Enter runs the cell
When parts does not help
Parts needs a factor you can integrate. In ∫xex2dx, the choice u=x would need v=∫ex2dx, which has no formula. Substitution (lesson 2.6.1) does it in one line: 21ex2+C.
Some integrals defeat both methods. For ∫ex2dx, parts with u=ex2 and dv=dx gives xex2−∫2x2ex2dx, which is worse. Lesson 2.6.3 finds areas under the related bell curve e−x2 by other means.
A rule of thumb: first look for an inside and its derivative (substitution). If there is none, and the integrand is a power or a log times something you can integrate, try parts. Lesson 2.6.3 uses parts to find the area under xe−x out to infinity.
Common mistakes
Choose u to get simpler. With u=ex and dv=xdx, the new integral ∫2x2exdx is harder.
Keep the minus sign in uv−∫vdu.
Get the sign of v right. For dv=e−xdx, v=−e−x, not e−x.
Use both limits on uv.[uv]ab is the value at b minus the value at a, even when the second is not 0.
Keep going while a power is left.∫x2exdx needs two rounds.
When the integral comes back, solve for it.I=(lnx)2−I gives 2I=(lnx)2.
Try substitution first when an inside and its derivative are both there.
Integration by parts
0 of 12 correct
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
How to type answers
Powers with ^: x^7, 2^(1/3), a^-2.
Multiply with * or by writing side by side: 3x^2, 2(x+1).
ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
Your first answer to each question is saved: it counts towards your score and brings the question back for review.
Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.
Summary card
Integration by parts reverses the product rule: ∫udv=uv−∫vdu.
Choose u to get simpler when differentiated (a log first, then a power of x) and dv easy to integrate.
With limits: ∫abudv=[uv]ab−∫abvdu. As areas, [uv] is a rectangle split between the two integrals.
Repeat while a power of x is left; if the starting integral comes back, solve for it.
∫xexdx=(x−1)ex+C and ∫lnxdx=xlnx−x+C.
Try substitution first when an inside and its derivative are both present.