Integrate by Substitution

When you encounter a function nested within another function, you cannot integrate as you normally would. In that case, you must integrate by substitution, also called u-substitution. In this article, we'll show you how to integrate by substitution step by step.

Steps

Indefinite Integral

  1. Determine what you will use as u. Finding u may be the most difficult part of u-substitution, but as you practice, it will become more natural. In general, a good u-sub involves the derivative of u cancelling out part of the integrand. The easiest integrals are those where it includes a function <math>ax</math> (any multiple of <math>x</math>) nested within another elementary function - in these cases, the nested function will be u.
    • Consider the integral <math>\int \sin(2x) \mathrm{d}x.</math>
    • Here, the function <math>2x</math> is nested inside another elementary function, the sine function. Because the derivative of <math>2x</math> is just a constant, we don't need to worry about introducing any unnecessary variables. Therefore, make the substitution <math>u = 2x.</math>
  2. Find du. Take the derivative of u with respect to x, and solve for du.
    • <math>\begin{align}\frac{\mathrm{d}u}{\mathrm{d}x} &= 2 \\

\mathrm{d}u &= 2\mathrm{d}x\end{align}</math>

    • As you improve your technique, you will eventually jump straight to the differential instead of solving for it.
  1. Rewrite your integral in terms of u.
    • <math>\int \sin(2x) \mathrm{d}x = \frac{1}{2}\int \sin u \mathrm{d}u</math>
    • Here, we wrote the integral using du by solving for dx and replacing it. This is why there is an extra 1/2 term (which we can factor out).
    • If you are left with a variable which is not u after replacing anything that you can with u and du, sometimes solving for that variable in terms of u and replacing it works. This is called back-substitution, and the supplementary example below will use such a substitution.
  2. Integrate.
    • <math>\frac{1}{2}\int \sin u = -\frac{1}{2}\cos u + C</math>
  3. Write your answer in terms of your original variable. Replace u with what you set it equivalent to earlier.
    • <math>-\frac{1}{2}\cos u + C = -\frac{1}{2}\cos(2x) + C</math>
    • As we can see, u-substitution is just the analogue of the chain rule from differential calculus.

Definite Integral

  1. Determine what you will use as u. This example demonstrates u-substitution of definite integrals and trigonometric functions.
    • Consider the integral <math>\int_{0}^{\pi} \sin^{3} \theta \mathrm{d}\theta.</math>
    • Notice that this function does not have a nested function within another function that we can use. If we consider this as a sine function cubed, the resulting u-sub will get us nowhere. However, using the trigonometric identity <math>\sin^{2}\theta = 1 - \cos^{2}\theta,</math> we can rewrite the integrand as <math>(1 - \cos^{2}\theta)\sin\theta.</math>
    • Recall that <math>\frac{\mathrm{d}}{\mathrm{d}\theta}\cos\theta = -\sin\theta.</math> Remember that in general, we want u so that its differential ends up canceling out part of the integrand. In this case, the <math>\sin\theta.</math>
    • Therefore, make the substitution <math>u = \cos\theta.</math>
  2. Find du. Take the derivative of u, and solve for du.
    • From above, <math>\mathrm{d}u = -\sin\theta \mathrm{d}\theta.</math>
  3. Rewrite your integral so that you can express it in terms of u. Make sure to change your boundaries as well, since you changed variables. To do so, simply substitute the boundaries into your u-substitution equation.
    • <math>\int_{0}^{\pi} (1 - \cos^{2}\theta)\sin\theta \mathrm{d}\theta = -\int_{1}^{-1}(1 - u^{2})\mathrm{d}u</math>
  4. The extra <math>\sin\theta</math> neatly cancels out, but note the negative sign. Now, recognize that swapping the boundaries negates the integral, so we end up with a positive integral in the end.
    • <math>-\int_{1}^{-1}(1 - u^{2})\mathrm{d}u = \int_{-1}^{1}(1 - u^{2})\mathrm{d}u</math>
  5. Integrate.
    • The integrand is an even function, and the boundaries are symmetric. Therefore, we can factor out a 2 and set the lower boundary to 0 to simplify calculations.
    • <math>\begin{align}\int_{-1}^{1}(1 - u^{2})\mathrm{d}u &= 2\int_{0}^{1}(1 - u^{2})\mathrm{d}u \\

&= 2\left(1 - \frac{1}{3}\right) \\ &= \frac{4}{3}\end{align}</math>

    • We did not need to do this simplification to get the correct answer, but for more complicated integrals, this technique is useful to prevent arithmetic mistakes.
    • Notice that we did not rewrite our integral in terms of the original variable. Since we changed our boundaries, the integrals are equivalent. Ultimately, the objective is to solve the problem in the easiest and most efficient way possible, so there's no need to spend more time on an extra step.

Supplementary Example

  1. Evaluate the following integral. This is a more advanced example that incorporates u-substitution. In part 1, recall that we said that an integral after performing a u-sub may not cancel the original variables, so solving for the variable in terms of <math>u</math> and substituting may be required. That will also be necessary in this problem.
    • <math>\int_{0}^{2}\frac{x^{2} + 4}{x + 2}\mathrm{d}x</math>
    • We see that the derivative <math>x^{2} + 4</math> is <math>2x,</math> not <math>x + 2.</math> If we try to immediately u-sub, we will end up with an increasingly complicated expression, because solving for <math>x</math> in terms of <math>u</math> will wind up with a square root.
  2. Rewrite the numerator by completing the square. Notice that the numerator just requires a <math>4x</math> to complete the square. If we just add and then subtract <math>4x,</math> i.e. add 0, then we can reduce the problem to a more manageable one after simplifying.
    • <math>\begin{align}\int_{0}^{2}\frac{x^{2} + 4}{x + 2}\mathrm{d}x &= \int_{0}^{2}\frac{x^{2} + 4 + 4x - 4x}{x + 2}\mathrm{d}x \\

&= \int_{0}^{2}\left(\frac{(x + 2)^{2}}{x + 2} - \frac{4x}{x + 2}\right)\mathrm{d}x \\ &= \int_{0}^{2}(x + 2)\mathrm{d}x - 4\int_{0}^{2}\frac{x}{x + 2}\mathrm{d}x \\ &= 6 - 4\int_{0}^{2}\frac{x}{x + 2}\mathrm{d}x\end{align}</math>

    • It is worth noting that this technique of adding 0 is a very useful one, especially in the context of completing the square. Since 0 is the additive identity, we have not actually changed the integral.
  1. Make the u-sub <math>u = x + 2</math>. The integral in the last line above is perhaps the simplest type of expression where this sort of "back substitution" is required - that is, solving for <math>x</math> in terms of <math>u</math> and plugging that in as well <math>(x = u - 2),</math> since the u-sub didn't cancel all the <math>x</math> terms. Remember to change your boundaries.
    • <math>\begin{align}6 - 4\int_{0}^{2}\frac{x}{x + 2}\mathrm{d}x &= 6 - 4\int_{2}^{4}\frac{u - 2}{u}\mathrm{d}u \\

&= 6 - 4\int_{2}^{4}\left(1 - \frac{2}{u}\right)\mathrm{d}u\end{align}</math>

  1. Evaluate.
    • <math>\begin{align}6 - 4\int_{2}^{4}\left(1 - \frac{2}{u}\right)\mathrm{d}u &= 6 - 4[u - 2\ln u]_{2}^{4} \\

&= 6 - 4[4 - 2\ln 4 - 2 + 2\ln 2] \\ &= 6 - 16 + 8\ln 4 + 8 - 8\ln 2 \\ &= 8\ln 2 - 2\end{align}</math>

Video

{{#ev:youtube|kTXnhwQKuvU}}

Tips

  • Check your answer. Find the derivative of your answer and see if you recover your original function. On homework problems, use a calculator or WolframAlpha.
  • Don't forget to add the constant <math>C</math> to the end of indefinite integrals!