The chain rule (lesson 2.3.3) differentiates a function inside a function. Take the slope of the outer function, then multiply by the slope of the inner one. So an integrand of that shape, an outer function f applied to g(x) and multiplied by g′(x), is a derivative you can recognise.
Take (x2+1)4. The inner function x2+1 has slope 2x, so the chain rule gives
dxd(x2+1)4=4(x2+1)3⋅2x=8x(x2+1)3
Read backwards, ∫8x(x2+1)3dx=(x2+1)4+C. Dividing by 4 gives ∫2x(x2+1)3dx=4(x2+1)4+C.
Renaming the inside
Substitution does this reading backwards for you. Call the inner function u=x2+1.
Its slope is dxdu=2x, written du=2xdx. A small step dx in x moves u by 2x times as much: the stretch factor of lesson 2.3.3.
Now each piece of the integrand has a u version: (x2+1)3 is u3, and 2xdx is du. The integral becomes one in u alone:
∫2x(x2+1)3dx=∫u3du=4u4+C=4(x2+1)4+C
Rule: Substitution
∫f(g(x))g′(x)dx=∫f(u)duwith u=g(x),du=g′(x)dx
Choose the inner function as u. Replace g′(x)dx by du, so that no x is left. Integrate in u, put u=g(x) back, and check by differentiating.
A missing constant
In ∫xex2dx the inner function is the exponent, u=x2. Its derivative is 2x, but the integrand has only x. A missing constant can be fixed: du=2xdx gives xdx=21du.
1
u=x2,du=2xdxxdx=21du
2
∫xex2dx=21∫eudu
3
21eu+C=21ex2+C
Check with the chain rule: dxd21ex2=21ex2⋅2x=xex2.
Only a constant can be fixed this way. In ∫ex2dx there is no x in front to turn into du, and substitution fails (see the last section).
Choosing u
Look for a function sitting inside something else: inside a power, an exponent, a root, a log or the bottom of a fraction. Then check that its derivative appears as a factor, up to a constant. Each line of the table leaves out the +C.
integrand
u
du
antiderivative
(3x+1)5
3x+1
3dx
18(3x+1)6
x2+1x
x2+1
2xdx
21ln(x2+1)
xlnx
lnx
x1dx
2(lnx)2
xx2+9
x2+9
2xdx
3(x2+9)3/2
xe−x2
−x2
−2xdx
−21e−x2
(5−2x)3
5−2x
−2dx
−8(5−2x)4
The first row has a linear inner function, u=3x+1. Its derivative is the constant 3, so it is always there: dx=31du, and the answer gains a factor 31. This is the rule ∫ekxdx=kekx+C of lesson 2.5.2, now for any outer function.
In the second row ln(x2+1) needs no absolute value (lesson 2.5.2), because x2+1 is always positive. In the third, the log itself is the inner function, and x1 is its derivative.
The last two rows have inner functions that fall, with negative slope. The minus sign in du comes through to the answer. Lesson 2.6.3 meets xe−x2 again, under the bell curve.
Try it
The cell differentiates each answer in the table, and the first example, then subtracts the integrand. A check of 0 means the answer is right.
SymPy writes ln as log. sp.Rational(3, 2) is the exact fraction 23.
⌘/Ctrl + Enter runs the cell
Definite integrals: change the limits
A definite integral can be finished in two ways, and they give the same number.
Change the limits. Turn each limit into a value of u and finish in u, without going back to x.
Switch back. Find the antiderivative in x first, then use the original limits, as in lesson 2.5.3.
Take ∫01x2+12xdx with u=x2+1 and du=2xdx. At x=0, u=1; at x=1, u=2. So
∫01x2+12xdx=∫12u1du=ln2−ln1=ln2
Switching back gives the same: [ln(x2+1)]01=ln2−ln1=ln2.
Rule: Substitution with limits
∫abf(g(x))g′(x)dx=∫g(a)g(b)f(u)du
The new limits are the values of u at the old ones. The value from the old lower limit stays at the bottom, even when it is the larger one.
One area, two curves
Substitution does not change an area; it redraws it. The two integrals above measure regions under different curves, over different intervals, and the regions have the same area.
The same area before and after the substitution u=x2+1. The highlighted strip is wider on the u side and lower by the same factor, so its area, 0.0843, does not change.
A strip of width dx becomes a strip of width du=2xdx, so it is 2x times as wide. Its height x2+12x becomes u1, which is 2x times lower. The two factors cancel, and every strip keeps its area.
Midpoint sums (lesson 2.5.1) with equal strips show it in numbers. The two curves have different shapes, so the sums differ at first, but both settle on ln2≈0.693147.
strips
4
10
100
1000
∫01x2+12xdx
0.698429
0.693982
0.693156
0.693147
∫12u1du
0.69122
0.692835
0.693144
0.693147
Try it
mid(f, a, b, n) is the midpoint sum with n strips. The loop prints both sides of the table, then ln2.
The last line measures the highlighted strip on each side: 0.084341 both times.
⌘/Ctrl + Enter runs the cell
When the new limits run backwards
In ∫01x(1−x2)3dx, take u=1−x2. Then du=−2xdx, so xdx=−21du. At x=0, u=1, and at x=1, u=0: the new integral runs from 1 down to 0.
∫01x(1−x2)3dx=−21∫10u3du=21∫01u3du=81
Swapping the limits flips the sign (lesson 2.5.3), which cancels the minus sign from du.
Switching back instead
For ∫1exlnxdx, the table gives the antiderivative 2(lnx)2. With the original limits, 2(lne)2−2(ln1)2=21−0=21. Changing the limits instead gives ∫01udu=21.
Try it
Each line computes an integral in x and again in u with the new limits. They agree.
The last line keeps the old limits by mistake: ∫01u3du=41, not the correct 415.
⌘/Ctrl + Enter runs the cell
When substitution does not help
Substitution needs the derivative of the inside to be in the integral. Here are three cases where it is not.
The missing factor is not a constant.∫ex2dx has nothing to pair with du=2xdx. Forcing u=x2 gives ∫2ueudu, which is no easier. In fact ex2 has no antiderivative made of familiar functions; SymPy needs a new one, erfi.
There is a simpler route.∫(x2+1)2dx lacks the 2x, but multiplying out (lesson 2.5.2) gives 5x5+32x3+x+C.
A product of two kinds of function, such as xex. Neither factor is the derivative of an inside. Lesson 2.6.2 handles these with integration by parts.
Dividing by a missing 2x does not work either. The derivative of 2xex2 is (1−2x21)ex2, not ex2. Lesson 2.6.3 meets the close relative e−x2, whose area is found another way.
Try it
SymPy's answer for ex2 uses erfi, a function defined by this very integral. The second line multiplies out instead.
The third line differentiates the wrong answer 2xex2. SymPy writes the result as x2(x2−21)ex2, the same as above.
⌘/Ctrl + Enter runs the cell
Case study 2.6.5 uses a substitution to turn part of an option price into an area under the bell curve.
Common mistakes
Convert dx as well.∫(3x+1)5dx is 18(3x+1)6+C, not 6(3x+1)6+C, whose derivative is 3(3x+1)5.
Leave no x behind. An integral with both u and x in it cannot be done in u.
Only a constant can be fixed.2xex2 is not an antiderivative of ex2.
Keep the minus sign from a falling inner function: ∫xe−x2dx=−21e−x2+C.
Change the limits with the variable.∫012x(x2+1)3dx=∫12u3du=415. Keeping the old limits gives 41.
Keep the new limits in order. When u falls, the new lower limit is the larger number. Swap them only if you also flip the sign.
Choose one way to finish. After changing the limits, finish in u; do not also put x back.
Substitution
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
Substitution reverses the chain rule: ∫f(g(x))g′(x)dx=∫f(u)du with u=g(x) and du=g′(x)dx.
Choose an inner function whose derivative is also there; a missing constant can be fixed, a missing x cannot.
A linear inside ax+b always works: the answer gains a factor a1.
For a definite integral, change the limits to u=g(a) and u=g(b), or switch back to x and use the old ones.
The substitution redraws the area under a new curve; the area itself does not change.
It fails when the derivative of the inside is missing, as for ex2, or when the integrand is a product like xex.