4. Week 3: Integration by Parts
≪ 3. Week 2: Integrals and Substitutions | Table of Contents | 5. Week 4: On Integrals and Volumes ≫Last week, we discussed the method of substitution, which is effectively the chain rule in reverse. Today’s goal is to understand the product rule in reverse. First, recall the product rule: if \(u\) and \(v\) are differentiable functions,
\[ \frac{d}{dx} \left( u(x) v(x) \right) = u'(x) v(x) + u(x) v'(x). \]Integrating both sides and using the fundamental theorem of calculus yields
\[ u(x) v(x) = \int u'(x) v(x)\ dx + \int u(x) v'(x)\ dx. \]Rearranging yields the integration by parts formula:
\[ \int u(x) v'(x)\ dx = u(x) v(x) - \int u'(x) v(x)\ dx. \]
Remark 1.
You may have seen the formula
\[ \int u\ dv = uv - \int v\ du. \]This is the same formula as above: Writing \(u'(x) = \frac{du}{dx}\), we get \(u'(x)\ dx = du\) and likewise \(v'(x)\ dx = dv\).
On one hand, it looks like this formula is useless in practise because we started with an integral on the left and ended with an integral plus other junk on the right. But sometimes, if the stars align, the integral on the right is considerably easier to compute than the integral on the left.
Example 2.
Compute
\[ \int x\ln x\ dx. \]Solution
One may try to perform a substitution, but none of them really work out. We need to apply the integration by parts formula, and for this we need to choose what \(u(x)\) and \(v'(x)\ dx\) are. There are often two choices, but keep in mind that in order to apply the formula, we need to determine what \(v\) is after choosing \(v'\)! That is, \(v'\) should be something that’s easy to integrate.
In this case, we should pick \(u(x) = \ln x\) and \(v'(x) = x\). Then \(u'(x) = \frac{1}{x}\) and \(v(x) = \frac{1}{2}x^2\). The integration by parts formula therefore yields
\[ \begin{align*} \int x\ln x\ dx &= \int u(x) v'(x)\ dx \\ &= u(x) v(x) - \int u'(x) v(x)\ dx \\ &= \frac{1}{2}x^2\ln x - \int \frac{1}{x}\cdot \frac{1}{2}x^2dx\\ &= \frac{1}{2}x^2\ln x - \frac{1}{4}x^2 + C. \end{align*} \]Let’s see another example:
Example 3.
Compute
\[ \int _{0}^{1} xe^x\ dx. \]Solution
For this problem, we’ll first compute the indefinite integral \(\int xe^x\ dx\), then plug in points to get the definite integral. To do this integral, once again a substitution is no good, and we have to resort to integrating by parts.
If we pick \(u(x) = e^x\) and \(v'(x) = x\), then we get \(u'(x) = e^x\) and \(v(x) = \frac{1}{2}x^2\). The integration by parts formula then tells us that
\[\begin{align*} \int xe^x\ dx &= \int u(x) v'(x)\ dx \\ &= u(x) v(x) - \int u'(x) v(x)\ dx \\ &= \frac{1}{2}x^2e^x - \frac{1}{2}\int x^2e^x\ dx. \end{align*}\]The integral we’re left with is more complicated than the one we started with, and this indicates that we’ve done something wrong.
We should instead pick \(u(x) = x\) and \(v'(x) = e^x\). Then \(u'(x) = 1\) and \(v(x) = e^x\)! Running the same process yields
\[\begin{align*} \int xe^x\ dx &= \int u(x) v'(x)\ dx \\ &= u(x) v(x) - \int u'(x) v(x)\ dx \\ &= xe^x - \int e^x\ dx \\ &= xe^x - e^x. \end{align*}\]We can drop the \(+C\) since we’re ultimately computing a definite integral. We therefore conclude
\[ \int _{0}^{1}xe^x\ dx = \left. \left( xe^x-e^x \right)\right\rvert_{0}^1 = 1. \]One last example to demonstrate the possibilities.
Example 4.
Compute
\[ \int \arcsin(x)\ dx. \]Solution
We don’t have any way to do a substitution here, unfortunately, and I don’t recognise \(\arcsin\) as the integral of anything. We therefore must resort to integrating by parts, but it’s unclear how to split up the integral into \(u\) and \(v'\). We certainly want to set \(u(x) = \arcsin(x)\) (otherwise we’d be stuck figuring out \(v(x)\)…).
We now pick \(v'(x) = 1\)! This is a fantastic trick that works on many different functions. Then \(u'(x) = \frac{1}{\sqrt{1-x^2}}\) while \(v(x) = x\). So, integrating by parts yields
\[\begin{align*} \int \arcsin(x)\ dx &= \int u(x) v'(x)\ dx \\ &= u(x) v(x) - \int u'(x) v(x)\ dx \\ &= x\arcsin(x) - \int \frac{x}{\sqrt{1 - x^2} dx}. \end{align*} \]Now this integral can be handled with a substitution. Set \(u = 1 - x^2\) so that \(dx = -\frac{du}{2x}\); one ends up with
\[ \int \frac{x}{\sqrt{1-x^2}} dx = -\frac{1}{2} \int u ^{-\frac{1}{2} } du = -u ^{\frac{1}{2}} + C = -\sqrt{1 -x^2} + C. \]Putting this together, we obtain
\[ \int \arcsin(x)\ dx = x\arcsin(x) + \sqrt{1 - x^2} + C. \]In general, you probably won’t be told which integration technique to use. You need to discern if the integral you are presented with can be solved via
- recognising its antiderivative, perhaps after some algebra;
- performing a substitution;
- integrating by parts; or
- doing a trigonometric substitution (to be seen later!).
Sometimes, you’ll have to use multiple techniques, just as you may need to apply multiple differentiation rules when differentiating a particularly gross function! Some, but not all, of the following require integration by parts.
Problems 5.
Compute the following integrals:
- \(\int \frac{6}{36+x^2} dx.\)
- \(\int \frac{27}{x \left( 1 + \ln^2 x \right)} dx.\)
- \(\int x^2 \ln x\ dx\).
- \(\int \left( \ln x \right)^2 dx\).
- \(\int _{0}^{1} \arctan(x) dx.\)
- \(\int \cos(x)\ln\left( \sin x \right) dx.\)
- \(\int e^x\cos(2x) dx.\) (Difficult!)