Integration by Substitution

Introduction to u-Substitution

We already know how to integrate every function that we will ever integrate in this course. No, seriously.

When you learned how to differentiate, you first learned derivatives for the same handful of functions, and then you learned rules for handling different combinations of those functions (using the Product Rule, Quotient Rule, and Chain Rule). The idea is similar here: you know how to integrate the basic functions, and the rest of the time will be spent integrating variations and combinations of those functions.

The most fundamental concept that bridges the gap between the basic functions and their variations is substitution. This section deals with what we call u-substitution (because we'll introduce a uu into the problem), but most of the other methods that you'll see in the following sections are just different kinds of substitutions. If you can get a solid grasp on the idea in this section, you'll be well set for what follows.

Let's start slow with a simple example.

Why Substitute?

Evaluate cos(2x) dx\displaystyle\int \cos(2x) \ dx.

Solution

If the problem were cosx dx\displaystyle\int \cos x \ dx, the answer would simply be sinx+C\ans{\sin x + C}.

It's not quite that simple, but let's use that as a starting point. In other words, think about what function would have cos(2x)\cos(2x) as its derivative - you should be able to tell that the answer will involve sin(2x)\sin (2x).

The answer can't only be sin(2x)+C,\sin(2x) + C, though, because the derivative of that (using the Chain Rule) is 2cos(2x).2 \cos (2x).

We're getting close, though. The integral of cos(2x)\cos (2x) is almost sin(2x)+C\sin (2x) + C, but we're off by a multiple of 2.

Check this out, though: since our answer is double what it should be, we know that the correct answer is half of our guess.

Putting this all together: cos(2x) dx=12sin(2x)+C\int \cos (2x) \ dx = \ans{\dfrac{1}{2}\sin(2x) + C}

Check

We can verify this by differentiating 12sin(2x)+C\dfrac{1}{2}\sin(2x) + C; I'll leave it to you to make sure its derivative is cos(2x)\cos(2x).

Maybe you noticed that we didn't actually do any substitution in that problem - we just took an educated guess and tweaked the answer until we got something that worked. As problems get harder, we won't be able to solve them that way, though.

Let's do an almost identical example to the last one, and this time we'll actually use substitution to solve it.

First Substitution

Evaluate 2cos(2x) dx\displaystyle\int 2 \cos (2x) \ dx.

Solution

At this point, it shouldn't be huge surprise that the answer will be sin(2x)+C,\sin(2x) + C, but our goal is to see how u-substitution can get us to this answer.

Remember, we have a very short list of functions that we actually know how to integrate: anything of the form xnx^n, exe^x, and a handful of trigonometric functions.

To integrate cos(2x)\cos(2x), look for the closest form that we do know how to integrate: cosx\cos x. If instead of 2x2x we had xx, we'd be able to integrate this.

That's what leads us to substitution: we're going to introduce a new variable uu so that our problem just involves integrating cosu\cos u. To do this, we need to let u=2x.u = 2x.

Now our problem looks like 2cos(2x) dx=2cosu dx\int 2 \cos (2x) \ dx = \int 2 \cos u \ dx

That raises a new issue, though: we've got a variable mismatch. We're integrating a function of uu with respect to xx, which doesn't make any sense. Instead of dxdx at the end, we need to have dudu.

Differentials

We need to take our definition of uu and find dudu from it. Without getting too technical, du=dudx dxdu = \dfrac{du}{dx} \ dx

So since u=2xu = 2x, dudx=2\dfrac{du}{dx} = 2, so du=2 dxdu = 2\ dx

In every problem, once you define uu, take its derivative, slap on dxdx, and you've got dudu.

Back to the Problem

Where were we? 2cos(2x) dx=2cosu dx\int 2 \cos (2x) \ dx = \int {\color{red}2} \cos u \ {\color{red}dx}

Look at that: we've got a 22 and a dxdx in our problem, so we can replace those with du{\color{red}du}.

2cos(2x) dx=2cosu dx=cosu du\int 2 \cos (2x) \ dx = \int {\color{red}2} \cos u \ {\color{red}dx} = \int \cos u \ du

At this point we can integrate: cosu du=sinu+C\int \cos u \ du = \sin u + C

We've got an answer, but it is given in terms of uu, which isn't what we want; the problem was given in terms of xx, so the answer should be too.

All we need to do now is replace uu with 2x2x (look back at where we defined uu), and we're all done!

2cos(2x) dx=sin(2x)+C\int 2 \cos (2x) \ dx = \ans{\sin (2x) + C}

  1. Evaluate 5sin(5x) dx\displaystyle\int 5 \sin (5x) \ dx

  2. 5cos(5x)+C-5 \cos (5x) + C

What have we done?

That example is much longer than it needed to be, because I wanted to lay out the first instance of substitution in all its detail, because if you miss one of the core concepts, it'll be frustrating later to try to catch up. Let me summarize the key points of the example here, though, in much less detail:

For all the examples in this section, the basic steps will be the same.

This diagram helps to illustrate the process of u-substitution: u-Substitution Diagram

If we encounter an integral that we can't evaluate directly, we can often get around the difficulty by picking a substitution that makes for an easier integral. I often liken this to crossing a river: if we want to get from one side to another, but the crossing is difficult where we are standing, we can go downriver to an easier spot, cross the river, and then come back upriver to where we want to be.

How do you pick uu?

Every problem starts with picking a definition for uu. If you're trying to figure out what to make it, just remember that after substituting, you need to end up with one of the basic integral forms: xnx^n, exe^x, or a trig function. So to start, see what form the problem fits.

For instance, if the integral involved something like e2x+5e^{2x+5}, we'd want to let u=2x+5u=2x+5, so that after substituting, we'd be left with eue^u, which we know how to integrate.

Another thing to think about is that after picking uu, you'll also need to substitute for dudu, which involves the derivative of uu.

Here's an example: 2x ex2 dx\int 2x \ e^{x^2}\ dx Notice the exponential form: if we let u=x2u=x^2, du=2x dxdu=2x\ dx, so after substituting, the integral looks like eu du,\int e^u\ du, which is easy to integrate.

If you notice, like in that example, that one piece of the integral looks like the derivative of another piece, that can also help you pick uu.

As we go through the examples below, try practicing using these tips to pick uu.

Examples

Exponential u-Substitution

Use u-substitution to evaluate 8e8x dx\displaystyle\int 8e^{8x} \ dx.

Solution

Let's follow the process outlined above to pick uu. Remember that, after substituting, we want the result to be one of the basic integrals that we can do: we can integrate eue^u, but not e8xe^{8x}. Plus, we notice that 88 is the derivative of 8x8x, so if we let u=8xu=8x, the 88 will get picked up by the dudu. Let's try that: u=8xdu=8 dxu=8x \longrightarrow du = 8 \ dx

Now make the substitution: eu du\int e^u \ du

We can integrate this, and once we do, we can substitute back into xx to get the final answer: eu du=eu+C=e8x+C\int e^u \ du = e^u + C = \ans{e^{8x} + C}

Check

As always, we can check by differentiating our answer: ddx(e8x+C)=8e8x(using the Chain Rule)\dfrac{d}{dx} (e^{8x} + C) = 8e^{8x} \textrm{(using the Chain Rule)}

Power Function u-Substitution

Evaluate (2x33)46x2 dx\displaystyle\int (2x^3-3)^4 \cdot 6x^2\ dx.

Solution

The basic form here is that of a power function, so it makes sense to let u=2x33.u=2x^3-3. Also, if we do so, du=6x2 dxdu = 6x^2\ dx, which also appears in the problem.

Making the substitution and integrating: u4 du=15u5+C\int u^4 \ du = \dfrac{1}{5}u^5 + C

Finally, substitute back to get the answer in terms of xx: (2x33)46x2 dx=15(2x33)5+C(2x^3-3)^4 \cdot 6x^2\ dx = \ans{\dfrac{1}{5}(2x^3-3)^5 + C}

I'll leave it to you to check by differentiating the answer.

  1. 3(3x7)9 dx\displaystyle\int 3(3x-7)^9 \ dx

  2. 110(3x7)10+C\dfrac{1}{10}(3x-7)^{10} + C

  3. 4e4x dx\displaystyle\int 4e^{4x} \ dx

  4. e4x+Ce^{4x} + C

Evaluate the following integral: e7x dx\displaystyle\int e^{7x} \ dx.

Solution

What's different about this example? As before, let uu be the exponent so that we'll have eue^u after substituting: u=7xdu=7 dxu = 7x \longrightarrow du = 7 \ dx

The difference is that now, there's no 77 in the integral to be replaced with dudu.

What we do have is dxdx, so we can solve for that: du=7 dx17 du=dxdu = 7 \ dx \longrightarrow \dfrac{1}{7} \ du = dx

After replacing 7x7x with uu and dxdx with 17 du\dfrac{1}{7}\ du: e7x dx=17 eu du=17 eu+C=17 e7x+C\int e^{7x}\ dx = \int \dfrac{1}{7}\ e^u \ du = \dfrac{1}{7}\ e^u + C = \ans{\dfrac{1}{7}\ e^{7x} + C}

Evaluate (3x4+7)35x3 dx\displaystyle\int (3x^4+7)^3 \cdot 5x^3\ dx.

Solution

Let u=3x4+7u=3x^4+7, so du=12x3 dxdu = 12x^3\ dx. Notice that 12x312x^3 is not exactly the 5x35x^3 that we have in the problem, but it's only off by a constant multiple, so we can do the same thing we did in the last example.

The part that is the same is x3 dxx^3\ dx, so solve for that: du=12x3 dx112 du=x3 dxdu = 12x^3\ dx \longrightarrow \dfrac{1}{12}\ du = x^3\ dx

Making the substitution: (3x4+7)35x3 dx=u35112 du\int (3x^4+7)^3 \cdot 5x^3\ dx = \int u^3 \cdot 5 \cdot \dfrac{1}{12}\ du

Finally we can integrate and re-substitute: 512 u3 du=51214 u4+C=548(3x4+7)4+C\int \dfrac{5}{12}\ u^3\ du = \dfrac{5}{12} \cdot \dfrac{1}{4}\ u^4 + C = \ans{\dfrac{5}{48}(3x^4+7)^4 + C}

  1. (2x+5)7 dx\displaystyle\int (2x+5)^7\ dx

  2. 116(2x+5)8+C\dfrac{1}{16} (2x+5)^8 + C

  3. cos(7x) dx\displaystyle\int \cos(7x)\ dx

  4. 17sin(7x)+C\dfrac{1}{7} \sin(7x) + C

  5. sin(3x) dx\displaystyle\int \sin(3x)\ dx

  6. 13cos(3x)+C-\dfrac{1}{3} \cos (3x) + C

Reciprocal Function

Evaluate 44x3 dx\displaystyle\int \dfrac{4}{4x-3}\ dx.

Solution

This one looks like the reciprocal function, so let u=4x3u=4x-3. In that case, du=4 dxdu = 4\ dx, so after substituting, we're left with 44x3 dx=1u du\int \dfrac{4}{4x-3}\ dx = \int \dfrac{1}{u}\ du

Integrating gives the natural log function: 1u du=lnu+C=ln4x3+C\int \dfrac{1}{u}\ du = \ln u + C = \ans{\ln |4x-3| + C}

Natural Log and Absolute Value

Why did the last answer use the absolute value inside the natural log function?

First, remember that the natural log function is only defined for positive inputs. It turns out that this means that, technically, 1x dx=lnx+C\int \dfrac{1}{x}\ dx = \ln |x| + C

Think about it in reverse: if x>0x > 0, ddx[lnx]=1x\dfrac{d}{dx} [\ln x] = \dfrac{1}{x} If x<0x < 0, lnx\ln x is not defined, so instead we can use ln(x)\ln (-x): ddx[ln(x)]=1x(1)=1x.\dfrac{d}{dx} [\ln (-x)] = \dfrac{1}{-x} \cdot (-1) = \dfrac{1}{x}.

Since the absolute value function is defined as x={xif x>0xif x<0 |x| = \left{\begin{array}{r l} x & \textrm{if } x > 0\ -x & \textrm{if } x < 0 \end{array}\right. we can summarize the two derivatives above as ddxlnx=1x\dfrac{d}{dx} \ln |x| = \dfrac{1}{x} which means that 1x dx=lnx+C\ans{\int \dfrac{1}{x}\ dx = \ln |x| + C}

We often leave off the absolute value signs on the base case, but you'll see them included when we do substitution.

Evaluate 12x+7 dx\displaystyle\int \dfrac{1}{2x+7}\ dx.

Solution

Let u=2x+7u = 2x+7, so du=2 dxdu = 2\ dx. Again, we're off by a constant multiple, so we need to solve for dxdx as before: du=2 dx12 du=dxdu = 2\ dx \longrightarrow \dfrac{1}{2} \ du = dx

After substituting: 12x+7 dx=1u12 du=12lnu+C=12ln2x+7+C\int \dfrac{1}{2x+7}\ dx = \int \dfrac{1}{u} \cdot \dfrac{1}{2}\ du = \dfrac{1}{2} \ln |u| + C = \ans{\dfrac{1}{2}\ln |2x+7| + C}

There are patterns like this one that it can be handy to get familiar with. If you can follow the pattern, for instance, you can solve the following problem almost immediately:

19x2 dx=19ln9x2+C\int \dfrac{1}{9x-2}\ dx = \dfrac{1}{9} \ln |9x-2| + C

And this one: 253x dx=23ln53x+C\int \dfrac{2}{5-3x} \ dx = -\dfrac{2}{3} \ln |5-3x| + C

  1. 17x+15 dx\displaystyle\int \dfrac{1}{7x+15} \ dx

  2. 17ln7x+15+C\dfrac{1}{7} \ln |7x+15| + C

  3. 152x dx\displaystyle\int \dfrac{1}{5-2x} \ dx

  4. 12ln52x+C-\dfrac{1}{2} \ln |5-2x| + C

  5. 35x+12 dx\displaystyle\int \dfrac{3}{-5x+12} \ dx

  6. 35ln5x+12+C-\dfrac{3}{5} \ln |-5x+12| + C

Evaluate 042x+1 dx\displaystyle\int_0^4 \sqrt{2x+1}\ dx.

Solution 1

Having limits of integration just adds one step at the end of the problem: we can do the indefinite integral as usual, then use the Fundamental Theorem of Calculus at the end.

Let u=2x+1u=2x+1, so du=2 dx12 du=dxdu = 2\ dx \longrightarrow \dfrac{1}{2}\ du = dx. 2x+1 dx=12u du=12u1/2 du=1223u3/2+C=13(2x+1)3/2\begin{aligned} \int \sqrt{2x+1}\ dx &= \int \dfrac{1}{2} \sqrt{u} \ du\ &= \int\dfrac{1}{2} u^{1/2}\ du\ &= \dfrac{1}{2} \cdot \dfrac{2}{3} u^{3/2} + C\ &= \dfrac{1}{3}(2x+1)^{3/2} \end{aligned}

Now, using the limits of integration: 13(2x+1)3/204=1393/21313/2=263\dfrac{1}{3}(2x+1)^{3/2} \bigg|_0^4 = \dfrac{1}{3} \cdot 9^{3/2} - \dfrac{1}{3} \cdot 1^{3/2} = \ans{\dfrac{26}{3}}

Solution 2

There's another option for how to solve this, although it's only a small change: instead of doing the whole substitution process and then evaluate the limits, we can take the limits with us into u-land and evaluate them there.

u=2x+1u = 2x+1 When x=0x=0, u=2(0)+1=1u = 2(0)+1 = 1. When x=4x=4, u=9u=9.

Thus, 042x+1 dx=19u du\int_0^4 \sqrt{2x+1}\ dx = \int_1^9 \sqrt{u}\ du

After integrating, we get 13u3/219=1393/21313/2=263\dfrac{1}{3}u^{3/2} \bigg|_1^9 = \dfrac{1}{3} \cdot 9^{3/2} - \dfrac{1}{3} \cdot 1^{3/2} = \ans{\dfrac{26}{3}}

If you notice, we really did the same work in both cases; all that really changed is where we did each step. Either process gives the same answer, so it's really up to you to choose which you prefer.

  1. 121(35x)2 dx\displaystyle\int_1^2 \dfrac{1}{(3-5x)^2} \ dx

  2. \dfrac{1}{5(3-5x)} \ \bigg|1^2 = \dfrac{1}{5u} \ \bigg{-2}^{-7} = \dfrac{1}{14}

A Tricky One

Evaluate x(x4)9 dx\displaystyle\int x(x-4)^9\ dx.

Solution

Here again there are two parts, so we could let u=xu=x or let u=x4u=x-4. Letting u=xu=x wouldn't do anything other than rename the variable; it wouldn't simplify the integral at all.

Thus, let u=x4u=x-4, so du=dxdu=dx.

Substituting: x(x4)9 dx=xu9 du\int x(x-4)^9\ dx = \int x \cdot u^9\ du

The only problem is that there's a lingering xx, so what can we replace xx with so that the integral will only involve uu? The answer lies in the definition of uu: if u=x4u=x-4, x=u+4x = u+4: (u+4)u9 du\int (u+4)u^9\ du

This still looks complicated, but there's something we can do now that we couldn't do at the beginning: we can distribute the u9u^9 through the parentheses: (u+4)u9 du=u10+4u9 du=111u11+410u10+C=111(x4)11+410(x4)10+C\begin{aligned} \int (u+4)u^9\ du &= \int u^{10} + 4u^9\ du\ &= \dfrac{1}{11}u^{11} + \dfrac{4}{10}u^{10} + C\ &= \ans{\dfrac{1}{11}(x-4)^{11} + \dfrac{4}{10}(x-4)^{10} + C} \end{aligned}

Another Tricky One

Evaluate x21x dx\displaystyle\int \dfrac{x^2}{\sqrt{1-x}}\ dx.

Solution

Let u=1xu=1-x, so x=1ux=1-u and du=dx-du = dx.

Substituting: x21x dx=(1u)2u du=12u+u2u1/2 du=u1/22u1/2+u3/2 du=2u1/243u3/2+25u5/2+C=2(1x)1/243(1x)3/2+25(1x)5/2+C\begin{aligned} \int \dfrac{x^2}{\sqrt{1-x}}\ dx &= \int \dfrac{(1-u)^2}{\sqrt{u}} \ du\ &= \int \dfrac{1-2u+u^2}{u^{1/2}}\ du\ &= \int u^{-1/2} - 2u^{1/2} + u^{3/2}\ du\ &= 2u^{1/2} - \dfrac{4}{3}u^{3/2} + \dfrac{2}{5}u^{5/2} + C\ &= \ans{2(1-x)^{1/2} - \dfrac{4}{3}(1-x)^{3/2} + \dfrac{2}{5}(1-x)^{5/2}+ C} \end{aligned}

  1. (3x2+13)96x dx\displaystyle\int (3x^2+13)^9 \cdot 6x\ dx

  2. 110(3x2+13)10+C\dfrac{1}{10}(3x^2+13)^{10} + C

  3. xex2+2 dx\displaystyle\int xe^{x^2+2}\ dx

  4. 12ex2+2+C\dfrac{1}{2}e^{x^2+2} + C

  5. 2x2 1+x3 dx\displaystyle\int 2x^2 \ \sqrt{1+x^3}\ dx

  6. 49(1+x3)3/2+C\dfrac{4}{9}(1+x^3)^{3/2} + C

  7. 8sec(3x)tan(3x) dx\displaystyle\int 8 \sec(3x) \tan(3x)\ dx

  8. 83sec(3x)+C\dfrac{8}{3}\sec(3x) + C

  9. xcos(x2) dx\displaystyle\int x \cos(x^2)\ dx

  10. 12sin(x2)+C\dfrac{1}{2} \sin (x^2) + C

  11. (lnx)4x dx\displaystyle\int \dfrac{(\ln x)^4}{x}\ dx

  12. 15(lnx)5+C\dfrac{1}{5} (\ln x)^5 + C

  13. xx5 dx\displaystyle\int \dfrac{x}{x-5}\ dx

  14. x5+5lnx5+Cx-5 + 5 \ln |x-5| + C

  15. (cos6xcos2x)sinx dx\displaystyle\int (\cos^6 x - \cos^2 x) \sin x\ dx

  16. 17cos7x+13cos3x+C-\dfrac{1}{7}\cos^7 x + \dfrac{1}{3}\cos^3 x + C