Integrate by substitution
The antiderivatives of topic 6.8 cover basic functions, their sums and their constant multiples. An integrand such as \(2x\cos\left(x^2\right)\) is none of these, yet by the chain rule it is the derivative of \(\sin\left(x^2\right)\). This topic reverses the chain rule. It changes the variable of an integral from \(x\) to \(u=g(x)\), the inner function of a composition. It also moves the bounds of a definite integral with the variable.
Each strip keeps its area
A wavy curve above a horizontal axis. The region under it from a to b is shaded teal and cut into twelve thin strips, every other one darker, and orange lines mark its ends. One strip is orange, and an orange bar under the axis marks its width. A slider slides every point x of the axis to the point u = g(x). Each strip moves with its points: it narrows where g prime is less than 1 and widens where g prime is greater than 1, and its height changes by the opposite factor, so the strips end under the graph of y = f(u), from g(a) to g(b). A button removes the factor g prime of x: the curve turns red, and after the slide it lies below a dashed curve y = f(u) where the strips widened and above it where they narrowed.
In Figure 1, the teal region lies under the graph of \(y=f\big(g(x)\big)\,g'(x)\), and two orange lines mark its ends, at \(x=\cy{a}\) and \(x=\cy{b}\). Here \(f\) is positive and continuous, and \(g\) has a positive, continuous derivative. The region is cut into thin strips. Move the slider under the figure to change the axis from \(x\) to \(u=g(x)\). Each point \(x\) slides to the point \(g(x)\), and each strip slides with its points.
The orange strip runs from \(x\) to \(x+\cy{\Delta x}\). It is almost a rectangle of height \(f\big(g(x)\big)\,g'(x)\), so its area is about \(f\big(g(x)\big)\,g'(x)\,\Delta x\). It slides to the interval from \(g(x)\) to \(g(x+\Delta x)\). By the tangent line approximation (topic 4.6), the width \(\cy{\Delta u}\) of this interval is about \(g'(x)\,\Delta x\). Above this interval, the graph of \(y=f(u)\) has height about \(f\big(g(x)\big)\), so the region between them has about the same area as the orange strip:
As the strip slides, the figure turns it into this piece of the region under \(y=f(u)\). The strip becomes about \(g'(x)\) times as wide, and its height is divided by the same factor. Where \(g'(x)<1\), a strip becomes narrower and taller, and where \(g'(x)>1\), it becomes wider and shorter. The readouts under the figure show that the orange strip changes its width but not its area. At the end of the slide, the strips fill the region under \(y=f(u)\) from \(u=\cy{g(a)}\) to \(u=\cy{g(b)}\), where the end lines stand. Adding the strips and letting \(\Delta x\) approach 0 suggests that the two regions have the same area. The first area is the integral of \(f\big(g(x)\big)\,g'(x)\) from \(a\) to \(b\), and the second is the integral of \(f(u)\) from \(g(a)\) to \(g(b)\).
A proof with the chain rule covers every \(g\) with a continuous derivative, increasing or not, and every continuous \(f\), positive or not. Let \(f\) be continuous on an interval that contains every value of \(g\) on \([a,b]\). On that interval, the Fundamental Theorem of Calculus, Part 1 (topic 6.4), gives \(f\) an antiderivative \(F\). By the chain rule,
so \(F\big(g(x)\big)\) is an antiderivative of the integrand in \(x\). Both integrands are continuous, the one in \(x\) because \(f\), \(g\) and \(g'\) are, and the one in \(u\) because \(f\) is. The Fundamental Theorem, Part 2 (topic 6.7), therefore evaluates each integral with its antiderivative:
The two integrals are equal. If \(g(a)\) is greater than \(g(b)\), as when \(g\) decreases, the second integral has its bounds in reverse order. Part 2 still evaluates it, by the definition of an integral with reversed bounds (topic 6.6).
Without bounds, the same antiderivatives give \(\int f\big(g(x)\big)\,g'(x)\,dx=F\big(g(x)\big)+C\), which is \(\int f(u)\,du=F(u)+C\) with \(g(x)\) in place of \(u\). This result is the substitution rule, and the method that uses it is often called \(u\)-substitution. To use it, write \(u=g(x)\) and \(du=g'(x)\,dx\), where \(du\) is called the differential of \(u\). The equation \(du=g'(x)\,dx\) is the approximation \(\Delta u\approx g'(x)\,\Delta x\) of Figure 1, written in the notation of integrals. It looks like \(du/dx=g'(x)\) multiplied by \(dx\), but \(du/dx\) is a limit, not a fraction, as topic 3.1 noted. Here it is a rule for rewriting the integral, and the chain rule makes the rewrite correct.
The argument needs the factor \(g'(x)\) in the integrand. Use the button under Figure 1 to remove it, which leaves the red curve \(y=f\big(g(x)\big)\). Then change the axis to \(u\). Each strip keeps its area, so its height is still divided by \(g'(x)\), but no factor \(g'(x)\) cancels the division. The red curve ends below the dashed graph of \(y=f(u)\) where the strips widen, because \(g'(x)>1\) there, and above it where they narrow. The new integrand is \(f(u)/g'(x)\), not \(f(u)\).
Choosing the inner function
To choose \(u\), look for an inner function whose derivative is also a factor of the integrand. A constant multiple of the derivative is enough. If the integrand is \(f\big(g(x)\big)\,p(x)\) with \(g'(x)=k\,p(x)\) for a constant \(k\ne 0\), then \(du=k\,p(x)\,dx\), so \(p(x)\,dx=\frac1k\,du\). The constant \(\frac1k\) moves in front of the integral (topics 6.6 and 6.8). For \(x\cos\left(x^2\right)\), the inner function \(x^2\) has \(du=2x\,dx\), so \(x\,dx=\frac12\,du\):
If no factor is a constant multiple of \(g'(x)\), the substitution leaves a factor that depends on \(x\), like the red curve in Figure 1. For \(\cos\left(x^2\right)\) alone, \(u=x^2\) gives \(dx=\frac{du}{2x}\), and \(2x\) is not a constant, so it cannot move outside the integral. The answer \(\frac{\sin\left(x^2\right)}{2x}+C\) is wrong, because by the quotient rule its derivative is not \(\cos\left(x^2\right)\). In fact, no formula built from the functions of this course has the derivative \(\cos\left(x^2\right)\). If \(du\) uses only part of a factor, write the rest in terms of \(u\) with the help of \(u=g(x)\), so that no \(x\) remains.
Bounds and the final answer
In a definite integral, the bounds change with the variable, as the orange end lines in Figure 1 show. The bound \(x=a\) becomes \(u=g(a)\), and \(x=b\) becomes \(u=g(b)\). Keep them in this order, even when \(g(a)\) is the larger number, because each bound stays with its point. The other route is to find the antiderivative \(F\big(g(x)\big)\) in \(x\) and evaluate it at \(a\) and \(b\). Both routes give \(F\big(g(b)\big)-F\big(g(a)\big)\). Do not mix them, because an antiderivative in \(u\) needs the bounds in \(u\).
An indefinite integral asks for a function of \(x\), so the last step replaces \(u\) with \(g(x)\). One constant \(C\) covers the whole answer, because \(\frac1k\,C\), like \(C\), can be any real number. To check the answer, differentiate it (topic 6.8). The chain rule returns the factor \(g'(x)\), so a lost constant factor or a lost sign shows at once.
Example 1
Choose a useful substitution
Find \(\displaystyle\int\frac{dx}{x\ln x}\) for \(x>1\).
Solution
For \(x>1\), \(\ln x\) is positive, so the integrand is continuous. It is the product of \(\dfrac{1}{\ln x}\) and \(\dfrac1x\). The first factor is a composition whose inner function is \(\ln x\), and the derivative of \(\ln x\) is \(\dfrac1x\), the second factor. This makes \(\ln x\) a useful choice:
For \(x>1\), the values of \(u\) are positive, and \(\frac1u\) is continuous there. The factor \(\frac1x\,dx\) is all of \(du\), so no constant factor is needed:
Replace \(u\) with \(\ln x\). Because \(\ln x>0\) for \(x>1\), the absolute value can be left out:
Example 2
Rewrite the whole integral consistently
Find \(\displaystyle\int x^3\sqrt{x^2+1}\,dx\).
Solution
The integrand is continuous for every \(x\), because \(x^2+1\ge 1\). The square root has the inner function \(x^2+1\), whose derivative is \(2x\), and \(\sqrt u\) is continuous for \(u\ge 1\). Let
Split \(x^3\,dx\) into \(x^2\cdot x\,dx\). The factor \(x\,dx\) is half of \(du\). The factor \(x^2\) is left over, so write it in terms of \(u\) as well, as \(x^2=u-1\):
No \(x\) remains. The new integrand is a sum of powers of \(u\), and the factor \(\frac12\) stays in front:
Replace \(u\) with \(x^2+1\). The integral is
Example 3
Transform definite-integral bounds
Evaluate \(\displaystyle\int_0^{\pi/2}\sin x\cos^4 x\,dx\).
Solution
The integrand is continuous on \(\left[0,\frac{\pi}{2}\right]\). In \(\cos^4x=(\cos x)^4\), the inner function is \(\cos x\), whose derivative \(-\sin x\) is \(-1\) times the other factor. This derivative is continuous, and so is \(u^4\). Let
The bounds change with the variable. At \(x=0\), \(u=\cos 0=1\), and at \(x=\frac{\pi}{2}\), \(u=\cos\frac{\pi}{2}=0\). The new lower bound is 1, because it belongs to \(x=0\), even though it is the larger number:
As a check, the other route stays in \(x\). The same substitution without bounds gives the antiderivative \(-\frac15\cos^5x\), and
Example 4
Complete and check the integration
A particle moves along a line so that its velocity at time \(t\) seconds is \(v(t)=6t\,e^{-t^2}\) meters per second. At time \(t=0\), its position is 4 meters. Find its position \(s(t)\) at time \(t\).
Solution
The velocity is continuous for every \(t\). Because \(s'(t)=v(t)\) (topic 4.2), the position is the antiderivative of the velocity with \(s(0)=4\). The exponent \(-t^2\) is an inner function, and the factor \(6t\) is a constant multiple of its derivative \(-2t\):
Integrate in \(u\). Then replace \(u\) with \(-t^2\), so that the answer is a function of \(t\):
At \(t=0\), the term \(-3e^{-t^2}\) equals \(-3\), so \(-3+C=4\) and \(C=7\):
To check, differentiate. By the chain rule, the derivative is the velocity,
and \(s(0)=7-3=4\).
Each example is one of the four skills of topic 6.9 in Which & Why: AP Calculus.