Introduction
In the previous section, we started looking at antiderivatives. All of the antiderivatives we came up with followed directly from the derivatives we learned several chapters back. For example, since $\frac{d}{dx}(\arctan x) = \frac{1}{1+x^2}$, we know that $\int \frac{1}{1+x^2} \ dx = \arctan x + C$.
To move beyond these basic antiderivatives, we’ll need to develop some techniques for differentiation. The first of these is called substitution. This will give us a way of reversing the chain rule.
Review: The Chain Rule
In differential calculus, the chain rule tells us how to differentiate compositions of functions:
$$\frac{d}{dx}\left(f\left(g(x)\right)\right) = f’(g(x))\cdot g’(x)$$ Or, for shorthand, we might just write $$\left(f(u)\right) = f’(u)\cdot u’$$
The operative things to remember here is that we can only differentiate one layer at a time.
Examples
-
If $y = \sin(x^2)$ then $\frac{dy}{dx} = 2x\cos(x^2)$.
-
If $y = (3x^4 - 5)^{10}$ then $\frac{dy}{dx} = 10(3x^4 - 5)^9(12x^3)$.
Integration by Substitution
Now we want to reverse that:
$$\int f’(g(x))\cdot g’(x)\ dx = f(g(x)) + C$$
For example,
$$\int 2x\cos(x^2)\ dx = \sin(x^2) + C$$
But, we’d like a systematic way of figuring this out. Let’s try making a substitution.
- Let $u = x^2$.
- We need to do something with the $dx$
- $\displaystyle \frac{du}{dx} = 2x$
- We can write that as $du = 2x\ dx$ - notice this is a perfect match for what we have in the integral.
$$\int 2x\cos(x^2) \ dx = \int \cos u \ du = \sin u + C = \sin(x^2) + C$$
What if we don’t have a perfect match?
Suppose that we had $\displaystyle \int x \cos(x^2) \ dx$ instead. Now when I try my same substitution, I don’t get the same perfect match.
- Let $u = x^2$.
- Then $\displaystyle \frac{du}{dx} = 2x$.
- But we don’t have a $2x$ in the integrand, we just have an $x$.
- Option 1: Solve for what we do have.
- $\frac{1}{2}\ du = x \ dx$
- We get $\int \frac{1}{2} \cos u \ du$.
- Option 2: Just solve for $dx$ and plug in.
- $dx = \frac{1}{2x} \ du$
- $\displaystyle \int x \cos(x^2) \ dx = \int x \cos(x^2) \left(\frac{1}{2x}\ du\right) = \int \frac12 \cos u \ du$
- Option 1: Solve for what we do have.
- The advantage to option 1 is that it’s a bit less work. The advantage to option 2 is that you don’t have to think too much about it.
Note
There is, unfortunately, no prescription for how and when to do substitution. Below, I’ve included some good practices, but there are no universal rules that say, “when you see this, do substitution by making $u=$ ‘whatever.’” Now, that said, we will develop intuition about when and how to use substitution. But this intuition will only come if we do a lot of problems and make a lot of mistakes along the way. It’s just as important to see why certain substitutions don’t work as it is to see which ones do.
Some tips for choosing $u$
- Never just pick $x$ to be your $u$.
- That’s just changing the variable we’re using, but doesn’t do anything helpful.
- Start by trying to make $u$ a function that’s inside another function.
- If you have two ideas for what $u$ could be, and they yield the same $u’$, then pick the one that contains more terms.
- For example: Given the choice between $u=x^2 + 1$ and $u=x^2$, I would first try $u=x^2 + 1$
- Don’t be afraid to try more than one route.
- If you’re not getting a full substitution (meaning you can’t get rid of all the $x$ terms), try another $u$.
- Weird things to look out for:
- Substitutions that yield $\displaystyle\frac{1}{u^2+1}$ can be harder to spot.
- Consider $\displaystyle\int\frac{2x}{x^4 + 1}\ dx$. Letting $u=x^2$, we get $\displaystyle \int \frac{1}{u^2 + 1}\ du = \arctan u + C$
- Sometimes, we have to solve for $x$ in terms of $u$ to get the full substitution.
- E.g., $\int x \sqrt{x + 1}\ dx$. Let $u = x+1$. Then $du = dx$ and $x = u - 1$. So we get $\int x\sqrt{x+1}\ dx = \int(u-1)\sqrt{u}\ du$.
Definite Integrals
Suppose we want to integrate $\int_1^{e^2} \frac{\ln x^2}{x} \ dx$.
- We start with substitution in the usual way.
- We could let $u = \ln x^2$.
- Then $du = \frac2x \ dx$.
- We can also change the bounds according to our substituion by plugging into $u=\ln x^2$;
- When $x = 1$, $u = \ln 1^2 = 0$.
- When $x = e^2$, $u = \ln(e^2)^2 = 4$.
So, our substitution becomes
$$\begin{aligned} \int_1^{e^2} \frac{\ln x^2}{x} \ dx &= \frac12 \int_0^4 u\ du\cr \frac14 u^2 \biggr\rvert_0^4\cr \boxed{4} \end{aligned}$$
Notice that we never went back to $x$.
Alternatively, we could leave the bounds alone, but in that case we have to get the antiderivative back in terms of $x$ before evaluating.
$$ \begin{aligned} \int_1^{e^2} \frac{\ln x^2}{x} \ dx &= \frac12 \int_{x=1}^{x=e^2} u\ du\cr &= \frac14 u^2 \biggr\rvert_{x=1}^{x=e^2}\cr &= \frac14 (\ln x^2)^2\biggr\rvert_{x=1}^{x=e^2}\cr &= \frac14 (16 - 0)\cr &= \boxed{4} \end{aligned} $$
Exercise
$\displaystyle\int 4 x^2 \sqrt{2x^3 + 3}\ dx$ $\longleftarrow$ (Let $u = 2x^3 + 3$)
For this one, try $u=2x^3 + 2$. Then $du = 6x^2\ dx$.
Solution
Exercise
$\displaystyle \int \frac{e^{2/x}}{x^2} \ dx$
Solution
Let $u = \frac2x$. Then $du = -\frac{2}{x^2}\ dx$.
$$\begin{aligned} \int \frac{e^{2/x}}{x^2} \ dx &= -\frac12 \int e^u \ du\cr &= -\frac12 e^u + C\cr &= \boxed{-\frac12 e^{2/x} + C} \end{aligned}$$
Example
$\displaystyle \int 2x\sqrt{x+1} \ dx$
(Let $u = x+1$. The trick here is to make $x = u-1$ for the term outside the radical. Look at the example on the bottom of page 2.)
Let $u = x+1$. Then $du = dx$. Also, $x = u - 1$.
$$\begin{aligned} \int 2 x \sqrt{x + 1}\ dx &= \int 2 ( u - 1 ) \sqrt{ u } \ du\cr &= \int 2u^{3/2} - 2u^{1/2}\ du\cr &= 2\frac{u^{5/2}}{5/2} - 2\frac{u^{3/2}}{3/2} + C\cr &= \frac{4}{5}u^{5/2} - \frac{4}{3}u^{3/2} + C\cr &= \boxed{\frac{4}{5}(x+1)^{5/2} - \frac{4}{3}(x+1)^{3/2} + C}\cr \end{aligned}$$
Exercise
$\displaystyle \int \frac{4x}{\sqrt{x + 1}} \ dx$
This one is very similar to the previous example. Try $u = x+1$.
Solution
Then $du = dx$. We also have $x = u - 1$.
$$\begin{aligned} \int \frac{4x}{\sqrt{x + 1}} \ dx &= \int \frac{4(u-1)}{\sqrt{u}} \ du\cr &= 4\int u^{-1/2}(u-1)\cr &= 4 \int u^{1/2} - u^{-1/2} \ du\cr &= 4 \left( \frac23 u^{3/2} - 2u^{1/2} \right) + C\cr &= 4 \left( \frac23 (x+1)^{3/2} - 2(x+1)^{1/2} \right) + C\cr &= \boxed{\frac83 (x+1)^{3/2} - 8(x+1)^{1/2} + C} \end{aligned}$$
Exercise
$\displaystyle \int \sin^2(x)\cos(x) \ dx$
Solution
Let $u = \sin x$. Then $du = \cos x \ dx$.
$$\begin{aligned} \int \sin^2(x)\cos(x) \ dx &= \int u^2 \ du\cr &= \frac13 u^3 + C\cr &= \boxed{\frac13\sin^3 + C} \end{aligned}$$
Example
$\displaystyle\int_e^{e^3} \frac{1}{x \ln{x}}\ dx$
Let $u = \ln x$. Then $du = \frac1x \ dx$.
For our bounds, we have $x = e \Longrightarrow u = 1$ and $x=e^3 \Longrightarrow u = 3$.
$$\begin{aligned} \int_e^{e^3} \frac{1}{x \ln{x}}\ dx &= \int_1^{3} \frac{1}{u}\ du\cr &= \ln|u| \biggr\rvert_1^3\cr &= \ln3 - \ln1\cr &= \boxed{\ln 3} \end{aligned}$$
Exercise
$\displaystyle\int_0^{\sqrt2/2}\frac{\arcsin{x}}{\sqrt{1-x^2}} \ dx$
Solution
Let $u = \arcsin x$. Then $du = \frac{1}{\sqrt{1 - x^2}} \ dx$.
For our bounds, we have $x = 0\Longrightarrow u = 0$ and $x = \sqrt2/2 \Longrightarrow u = \pi/4$.
$$\begin{aligned} \int_0^{\sqrt2/2}\frac{\arcsin{x}}{\sqrt{1-x^2}} \ dx &= \int_{0}^{\pi/4} u \ du \cr &= \frac12 u^2 \biggr\rvert_{0}^{\pi/4}\cr &= \frac12 \left(\frac{\pi^2}{16} - 0\right)\cr &= \boxed{\pi^2/32} \end{aligned}$$
Exercise
$\displaystyle \int_0^{\frac12\ln 3} \frac{e^x}{e^{2x} + 1} \ dx$
Solution
Let $u = e^x$. Then $du = e^x \ dx$.
For our bounds, we have $x = 0 \Longrightarrow u = 1$ and $x = \frac12\ln 3 \Longrightarrow u = \sqrt{3}$.
$$\begin{aligned} \int_0^{\frac12\ln 3} \frac{e^x}{e^{2x} + 1} \ dx &= \int_1^{\sqrt3} \frac{1}{u^2 + 1} \ du\cr &= \arctan u \ \biggr\rvert_1^{\sqrt3}\cr &= \arctan \sqrt3 - \arctan 1\cr &= \boxed{\pi/3 - \pi/4} \end{aligned}$$