Subsection Discovering the Integration by Parts Formula
Activity 7.4.1. Discovering the Integration by Parts Formula.
The product rule for derivatives says that:
\begin{equation*}
\ddx{u(x)\cdot v(x)} = \fillinmath{XXXXX} + \fillinmath{XXXXX}\text{.}
\end{equation*}
We know that we intend to “undo” the product rule, so let’s try to reframe the product rule from a rule about derivatives to a rule about antiderivatives.
(a)
Antidifferentiate the product rule by antidifferentiating each side of the equation.
\begin{equation*}
\begin{aligned}
\int \left(\ddx{u\cdot v}\right)\;dx \amp= \int \fillinmath{XXXXX}+ \fillinmath{XXXXX} dx\\
\fillinmath{XXXXX} \amp= \int \fillinmath{XXXXX} dx + \int \fillinmath{XXXXX} dx
\end{aligned}
\end{equation*}
Hint.
Note that on the left side of this equation, you’re antidifferentiating a derivative. What will that give you? Then, on the right side, we’re just splitting up the terms of the product rule into two different integrals.
(b)
On the right side, we have two integrals. Since each of them has a product of functions (one function and a derivative of another), we can isolate one of them in this equation and create a formula for how to antidifferentiate a product of functions! Solve for
\(\int u v'\;dx\text{.}\)
(c)
Look back at this formula for
\(\int u v'\;dx\text{.}\) Explain how this is really the product rule for derivatives (without just undoing all of the steps we have just done).
We typically use the substitutions
\(du = u'\;dx\) and
\(dv=v'\;dx\) to rewrite the integrals.
Integration by Parts.
Suppose \(u(x)\) and \(v(x)\) are both differentiable functions. Then:
\begin{equation*}
\int u\;dv = uv - \int v\;du\text{.}
\end{equation*}
When we select the parts for our integral, we are selecting a function to be labeled
\(u\) and a function to be labeled as
\(dv\text{.}\) We begin with one of the pieces of the product rule, a function multiplied by some other function’s derivative. It is important to recognize that we do different things to these functions: for one of them,
\(u\text{,}\) we need to find the derivative,
\(du\text{.}\) For the other,
\(dv\text{,}\) we need to find an antiderivative,
\(b\text{.}\) Because of these differences, it is important to build some good intuition for how to select the parts.
Subsection Some Flexible Choices for Parts
We’re going to look at a couple of examples where we can showcase some of the flexibility we have with our choices of parts. First, we’ll revisit
Example 7.4.1. In this example, when we got to that second integral, we noticed that for the fraction
\(\frac{x^2}{x^2+1}\text{,}\) we could either do some long division (since the degrees in the numerator and denominator are the same) or do some clever rewriting of the numerator. Either way, we know that this fraction is
almost 1...It’s really
\(1\pm\) some bit (in this case, the extra bit was a fraction
\(\frac{1}{x^2+1}\)).
What if we chose our parts differently? Not the
\(u\) and
\(dv\) parts, though, since we still haven’t figured out how to antidifferentiate
\(\tan^{-1}(x)\text{.}\) But we get one more choice!
Once we choose
\(u\text{,}\) we don’t really get a separate choice for
\(du\text{:}\) it’s simply the derivative of
\(u\) with regard to
\(x\) multiplied by the differential
\(dx\text{.}\) But consider our choice of
\(dv\text{,}\) and the subsequent process of finding
\(v\text{.}\) Yes, there’s only one possible answer, but in a much more real sense, there isn’t just one possible answer. There are an infinite number of them! We know, due to the
Mean Value Theorem and then later due to
Theorem 4.1.7, that there are an infinite number of antiderivatives, all differing by, at most, a constant term. So let’s pick a more appropriate antiderivative!
Example 7.4.2.
Integrate
\(\displaystyle \int 2x\tan^{-1}(x)\;dx\text{,}\) this time making a more intentional choice for
\(v\text{.}\)
Hint.
Note that if we pick
\(v = x^2+1\text{,}\) then the second integral will be just delightful.
Solution.
\begin{equation*}
\begin{array}{ll}
u = \tan^{-1}(x) & v = x^2+1\\
du = \frac{1}{x^2+1}\;dx & dv = 2x\;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int 2x\tan^{-1}(x)\;dx & = (x^2+1)\tan^{-1}(x) - \int \frac{x^2+1}{x^2+1}\;dx\\
& = x^2\tan^{-1}(x) + \tan^{-1}(x) - \int \;dx\\
& = x^2\tan^{-1}(x) + \tan^{-1}(x) - x + C
\end{aligned}
\end{equation*}
So we get the same thing, but didn’t have to think through the long division or the forced factoring. But the trade off here is that we almost
have to see this coming to notice it. This flexibility doesn’t always come into play for us. But we can look at a different kind of flexibility.
We’ve looked at integrals with both
\(\ln(x)\) and
\(\tan^{-1}(x)\text{.}\) For these, and for other inverse functions specifically, we pick them to be the
\(u\) part in our integration by parts problems because we don’t know how do antidifferentiate them.
So let’s look at
\(\displaystyle \int \ln(x)\;dx\text{,}\) and we’ll solve this integral by, specifically, differentiating
\(\ln(x)\) instead of antidifferentiating it.
Example 7.4.3. Antidifferentiating the Log Function.
Integrate
\(\displaystyle \int \ln(x)\;dx\text{.}\)
Hint.
Pick
\(u=\ln(x)\text{,}\) since we can differentiate it. What does that leave for
\(dv\text{?}\)
Solution 1.
\begin{equation*}
\begin{array}{ll}
u = \ln(x) & v = x\\
du = \frac{1}{x}\;dx & dv = \;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int \ln(x)\;dx &= x\ln(x) - \int \frac{x}{x}\;dx\\
& = x\ln(x) - x + C
\end{aligned}
\end{equation*}
Solution 2.
An alternate approach is to use a substitution first. We’re going to be using a lot of different variable names here, so let’s use a \(t\)-substitution. Let \(t=\ln(x)\) so that \(dt=\frac{1}{x}\;dx\text{.}\) In order to induce this derivative of the log, let’s multiply by \(\frac{x}{x}\) inside the integral:
\begin{align*}
\int \ln(x)\;dx\amp = \int \frac{x}{x}\ln(x)\;dx\\
\amp = \int x\underbrace{\ln(x)}_{t}\underbrace{\left(\frac{1}{x}\right)\;dx}_{dt}\\
t = \ln(x) \amp\longrightarrow x=e^t \\
\int x \ln(x)\left(\frac{1}{x}\right)\;dx \amp = \int te^t\;dt
\end{align*}
This integral can be done using the standard integration by parts!
\begin{align*}
u = t \amp v = e^t\\
du=dt \amp dv=e^t\;dt \\
\int te^t\;dt \amp = uv-\int v\;du \\
\amp = te^t - \int e^t\;dt\\
\amp = te^t - e^t +C
\end{align*}
Now, we can substitute back to \(x\text{:}\)
\begin{equation*}
te^t - e^t +C = x\ln(x)-x+C\text{.}
\end{equation*}
We can use this same strategy to find antiderivatives of
\(\tan^{-1}(x)\text{,}\) \(\sin^{-1}(x)\text{,}\) and eventually
\(\sec^{-1}(x)\text{.}\)
Now that we know the antiderivative family for
\(\ln(x)\text{,}\) we can revisit the problem in
Activity 7.4.3,
\(\displaystyle \int x\ln(x)\;dx\text{,}\) and try to work through the integration by parts when
\(u=x\) and
\(dv = \ln(x)\;dx\text{.}\)
Example 7.4.4.
Integrate
\(\displaystyle \int x\ln(x)\;dx\text{.}\)
Solution.
\begin{equation*}
\begin{array}{ll}
u = x & v = x\ln(x)-x\\
du = \;dx & dv = \ln(x)\;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int x\ln(x)\;dx & = x(x\ln(x)-x) - \int x\ln(x)-x\;dx\\
& = x^2\ln(x)-x^2 - \int x\ln(x)\;dx + \int x \;dx\\
& = x^2\ln(x)-x^2 + \frac{x^2}{2} - \int x\ln(x)\;dx
\end{aligned}
\end{equation*}
Note that this last integral is really recognizable: it’s the one we started with! Let’s “solve” this equation for that integral by adding it to both sides of our equation.
\begin{equation*}
\begin{aligned}
2\int x\ln(x)\;dx & = x^2\ln(x) - \frac{x^2}{2}\\
\int x\ln(x)\;dx & = \frac{x^2\ln(x)}{2} - \frac{x^2}{4} + C
\end{aligned}
\end{equation*}
Subsection Solving for the Integral
In this last example, we ended up seeing the original integral repeated when we did integration by parts. This is a useful technique, especially when we deal with functions that have a kind of “repeating” structure to their derivatives or antiderivatives. We’ll look at a couple of classic integrals where we see this kind of technique employed. Let’s have you explore this idea.
Activity 7.4.4. Squared Trig Functions.
Let’s look at two integrals. We’ll talk about both at the same time, since they’re similar.
\begin{equation*}
\int \sin^2(x)\;dx
\end{equation*}
\begin{equation*}
\int \cos^2(x)\;dx
\end{equation*}
(a)
What does it mean to “square” a trig function? Write these integrals in a different way, where the meaning of the “squared” exponent is more clear. What do you notice about the structure of these integrals, the operation in the integrand function? What does this mean about our choice of integration technique?
Hint.
\begin{align*}
\int \sin^2(x)\;dx \amp = \int \sin(x)\sin(x)\;dx \\
\int \cos^2(x)\;dx \amp = \int \cos(x)\cos(x)\;dx
\end{align*}
(b)
If you were to use integration by parts on these integrals, does your choice of
\(u\) and
\(dv\) even matter here? Why not?
Hint.
Is there a difference in the two functions being multiplied?
(c)
Apply the integration by parts formula to each. What do you notice?
Solution.
For the integral \(\displaystyle \int \sin^2(x)\;dx\text{:}\)
\begin{align*}
u = \sin(x)\;\; \amp \;\;v = -\cos(x)\\
du = \cos(x)\;dx \;\;\amp \;\;dv= \sin(x)\;dx \\
\int \sin^2(x)\;dx \amp = -\sin(x)\cos(x)+\int \cos^2(x)\;dx
\end{align*}
For the integral \(\displaystyle \int \cos^2(x)\;dx\text{:}\)
\begin{align*}
u = \cos(x)\;\; \amp \;\;v = \sin(x)\\
du = -\sin(x)\;dx \;\;\amp \;\;dv= \cos(x)\;dx \\
\int \cos^2(x)\;dx \amp = \sin(x)\cos(x) + \int \sin^2(x)\;dx
\end{align*}
(d)
Instead of applying another round of integration by parts to the resulting integral, use the Pythagorean identities to rewrite these integrals:
\begin{align*}
\sin^2(x) \amp = 1-\cos^2(x)\\
\cos^2(x) \amp = 1-\sin^2(x)
\end{align*}
(e)
You should notice that, in your equation for the integration of
\(\displaystyle \sin^2(x)\;dx\text{,}\) you have another copy of
\(\displaystyle \int \sin^2(x)\;dx\text{.}\) Similarly, in your equation for the integration of
\(\displaystyle \cos^2(x)\;dx\text{,}\) you have another copy of
\(\displaystyle \int \cos^2(x)\;dx\text{.}\)
Replace these integrals with a variable, like
\(I\) (for “integral”). Can you “solve” for this variable (integral)?
Solution.
For \(\int \sin^2(x)\;dx\text{:}\)
\begin{align*}
\int \sin^2(x)\;dx \amp = -\sin(x)\cos(x) + \int 1-\sin^2(x)\;dx\\
I \amp = -\sin(x)\cos(x) + \int 1 \;dx - \underbrace{\int \sin^2(x)\;dx}_{I}\\
I \amp = -\sin(x)\cos(x) + x - I\\
2I \amp = -\sin(x)\cos(x)+x\\
I \amp = \dfrac{-\sin(x)\cos(x)+x}{2}+C
\end{align*}
So we end up with:
\begin{equation*}
\int \sin^2(x)\;dx = \frac{x-\sin(x)\cos(x)}{2}+C\text{.}
\end{equation*}
For \(\int \cos^2(x)\;dx\text{:}\)
\begin{align*}
\int \cos^2(x)\;dx \amp = \sin(x)\cos(x) + \int 1-\cos^2(x)\;dx\\
I \amp = \sin(x)\cos(x) + \int 1 \;dx - \underbrace{\int \cos^2(x)\;dx}_{I}\\
I \amp = \sin(x)\cos(x) + x - I\\
2I \amp = \sin(x)\cos(x)+x\\
I \amp = \dfrac{\sin(x)\cos(x)+x}{2}+C
\end{align*}
So we end up with:
\begin{equation*}
\int \cos^2(x)\;dx = \frac{x+\sin(x)\cos(x)}{2}+C\text{.}
\end{equation*}
This “solving for the integral” approach works well, but works best when we can see it coming. Notice that it happened here due to the repeating structure of the derivatives of the sine and cosine functions, as well as the Pythagorean identities. We can see some more examples of this in play with similar functions!
Example 7.4.5.
For each of the following integrals, use integration by parts to solve.
(a)
\(\displaystyle \int \sin(x)\cos(x)\;dx\)
Hint.
This one is pretty straightforward, since it doesn’t really matter what we select as our parts. Notice, though, that this isn’t the only way we can approach this! We can use
\(u\)-substitution, or even rewrite this using a trigonometric identity.
Solution.
\begin{equation*}
\begin{array}{ll}
u = \sin(x) & v = \sin(x)\\
du = \cos(x)\;dx & dv = \cos(x)\;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int \sin(x)\cos(x)\;dx & = \sin^2(x) - \int \sin(x)\cos(x)\;dx\\
2\int \sin(x)\cos(x)\;dx & = \sin^2(x)\\
\int \sin(x)\cos(x)\;dx & = \frac{\sin^2(x)}{2} + C
\end{aligned}
\end{equation*}
(b)
\(\displaystyle \int e^x\cos(x)\;dx\)
Solution.
\begin{equation*}
\begin{array}{ll}
u = e^x & v = \sin(x)\\
du = e^x\;dx & dv = \cos(x)\;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int e^x\cos(x)\;dx & = e^x\sin(x) - \int e^x\sin(x)\;dx
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{array}{ll}
u = e^x & v = -\cos(x)\\
du = e^x\;dx & dv = \sin(x)\;dx
\end{array}
\end{equation*}
\begin{equation*}
\begin{aligned}
\int e^x\cos(x)\;dx & = e^x\sin(x) - \int e^x\sin(x)\;dx\\
\int e^x\cos(x)\;dx & = e^x\sin(x) + e^x\cos(x) - \int e^x\cos(x)\;dx\\
2\int e^x\cos(x)\;dx & = e^x\sin(x) + e^x\cos(x)\\
\int e^x\cos(x)\;dx & = \frac{e^x\sin(x) + e^x\cos(x)}{2}+C
\end{aligned}
\end{equation*}
Notice that we can come up with a bunch of different examples that are similar to
Example 7.4.5. If we put trigonometric functions inside our integral, we’ll have some options with how we approach them! We can use
\(u\)-substitution, since the derivatives of trigonometric functions are other trigonometric functions. In
Example 7.4.5, for instance, we could write
\(u=\sin(x)\) and
\(du = \cos(x)\;dx\text{,}\) or even chose
\(u=\cos(x)\) and
\(du = -\sin(x)\;dx\text{.}\)
The real issues will come when our integrand is not just a product of two trigonometric functions, but when they are products of trigonometric functions raised to exponents. We’ll have some combinations of these products (which maybe makes us think about integration by parts) and composition (which points towards
\(u\)-substitution). In the next section, we’ll develop some strategies to deal with these kinds of integrals.