27.6 Integration by Parts
AHL 5.16
- where the integration by parts formula comes from (the product rule)
- how to choose \(u\) and \(\dfrac{\mathrm{d}v}{\mathrm{d}x}\) using the LIATE order
- how to integrate \(\ln x\) and \(\arcsin x\) by writing them as \(1 \times (\ldots)\)
- repeated integration by parts, including integrals that “come back”, such as \(\int \mathrm{e}^{2x}\cos x\,\mathrm{d}x\)
Integration by parts is useful for products such as \(\int x\ln x\,\mathrm{d}x\), \(\int x\cos x\,\mathrm{d}x\) and \(\int x^2\mathrm{e}^{x}\,\mathrm{d}x\), where neither inspection nor a simple substitution works.
The formula
Start from the product rule for two functions \(u\) and \(v\) of \(x\):
\[ \frac{\mathrm{d}}{\mathrm{d}x}(uv) = u\frac{\mathrm{d}v}{\mathrm{d}x} + v\frac{\mathrm{d}u}{\mathrm{d}x}. \]
Integrate both sides: \(\;uv = \displaystyle\int u\frac{\mathrm{d}v}{\mathrm{d}x}\,\mathrm{d}x + \int v\frac{\mathrm{d}u}{\mathrm{d}x}\,\mathrm{d}x\). Rearranging gives the formula.
Integration by parts In the HL formula booklet
\[ \int u\frac{\mathrm{d}v}{\mathrm{d}x}\,\mathrm{d}x = uv - \int v\frac{\mathrm{d}u}{\mathrm{d}x}\,\mathrm{d}x \quad\text{or}\quad \int u\,\mathrm{d}v = uv - \int v\,\mathrm{d}u \]
You differentiate \(u\) and integrate \(\dfrac{\mathrm{d}v}{\mathrm{d}x}\). The new integral \(\int v\dfrac{\mathrm{d}u}{\mathrm{d}x}\,\mathrm{d}x\) must be easier than the first one.
- \(u\): the part of the product that you differentiate
- \(\dfrac{\mathrm{d}v}{\mathrm{d}x}\): the part of the product that you integrate
- \(v\): the integral of \(\dfrac{\mathrm{d}v}{\mathrm{d}x}\) (no \(+C\) needed here)
- \(\dfrac{\mathrm{d}u}{\mathrm{d}x}\): the derivative of \(u\)
Choosing \(u\): LIATE
Choose as \(u\) the function that becomes simpler when you differentiate it. A useful order is LIATE: take \(u\) from the type that comes first in this list.
| Letter | Type of function | Examples |
|---|---|---|
| L | Logarithmic | \(\ln x\), \(\log_2 x\) |
| I | Inverse trigonometric | \(\arcsin x\), \(\arctan 2x\) |
| A | Algebraic (powers of \(x\)) | \(x\), \(3x^2\), constants |
| T | Trigonometric | \(\sin x\), \(\cos 2x\) |
| E | Exponential | \(\mathrm{e}^x\), \(\mathrm{e}^{-3x}\) |
The function left over is \(\dfrac{\mathrm{d}v}{\mathrm{d}x}\). For \(\int x\ln x\,\mathrm{d}x\), L comes before A, so \(u = \ln x\) and \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = x\).
Example 1 Find \(\displaystyle\int \sqrt{x}\,\ln x\,\mathrm{d}x\), \(\;x > 0\).
L before A: \(u = \ln x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = x^{\frac{1}{2}}\). Then \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = \dfrac{1}{x}\), \(v = \dfrac{2}{3}x^{\frac{3}{2}}\).
\[ \int x^{\frac{1}{2}}\ln x\,\mathrm{d}x = \frac{2}{3}x^{\frac{3}{2}}\ln x - \int \frac{2}{3}x^{\frac{3}{2}} \cdot \frac{1}{x}\,\mathrm{d}x = \frac{2}{3}x^{\frac{3}{2}}\ln x - \frac{2}{3}\int x^{\frac{1}{2}}\,\mathrm{d}x \]
\[ = \frac{2}{3}x^{\frac{3}{2}}\ln x - \frac{4}{9}x^{\frac{3}{2}} + C. \]
Three useful types
A single function such as \(\ln x\) or \(\arcsin x\) can be integrated by parts by writing it as a product with \(1\): take \(u = \ln x\) (or \(\arcsin x\)) and \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = 1\), so \(v = x\).
Example 2 Find
(a) \(\displaystyle\int \arcsin x\,\mathrm{d}x\)
(b) \(\displaystyle\int x(\cos^2 x - \sin^2 x)\,\mathrm{d}x\)
(c) \(\displaystyle\int \ln(3x - 1)\,\mathrm{d}x\), \(\;x > \dfrac{1}{3}\)
(a) \(u = \arcsin x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = 1\). Then \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = \dfrac{1}{\sqrt{1 - x^2}}\), \(v = x\).
\[ \int \arcsin x\,\mathrm{d}x = x\arcsin x - \int \frac{x}{\sqrt{1 - x^2}}\,\mathrm{d}x. \]
The new integral is the reverse chain rule: with \(f(x) = 1 - x^2\), \(x = -\dfrac{1}{2}f'(x)\), so \(\displaystyle\int \frac{x}{\sqrt{1 - x^2}}\,\mathrm{d}x = -\sqrt{1 - x^2}\).
\[ \int \arcsin x\,\mathrm{d}x = x\arcsin x + \sqrt{1 - x^2} + C. \]
(b) First simplify: \(\cos^2 x - \sin^2 x = \cos 2x\). Now A before T: \(u = x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = \cos 2x\), so \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = 1\), \(v = \dfrac{1}{2}\sin 2x\).
\[ \int x\cos 2x\,\mathrm{d}x = \frac{x}{2}\sin 2x - \int \frac{1}{2}\sin 2x\,\mathrm{d}x = \frac{x}{2}\sin 2x + \frac{1}{4}\cos 2x + C. \]
(c) \(u = \ln(3x - 1)\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = 1\). Then \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = \dfrac{3}{3x - 1}\), \(v = x\).
\[ \int \ln(3x - 1)\,\mathrm{d}x = x\ln(3x - 1) - \int \frac{3x}{3x - 1}\,\mathrm{d}x. \]
Divide: \(\dfrac{3x}{3x - 1} = 1 + \dfrac{1}{3x - 1}\). So
\[ \int \ln(3x - 1)\,\mathrm{d}x = x\ln(3x - 1) - x - \frac{1}{3}\ln(3x - 1) + C. \]
Repeated integration by parts
Sometimes the new integral still needs integration by parts. Then use the formula again.
Example 3 Find \(\displaystyle\int x^2\mathrm{e}^{-2x}\,\mathrm{d}x\).
A before E: \(u = x^2\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = \mathrm{e}^{-2x}\), so \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = 2x\), \(v = -\dfrac{1}{2}\mathrm{e}^{-2x}\).
\[ \int x^2\mathrm{e}^{-2x}\,\mathrm{d}x = -\frac{1}{2}x^2\mathrm{e}^{-2x} + \int x\,\mathrm{e}^{-2x}\,\mathrm{d}x. \]
Again, \(u = x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = \mathrm{e}^{-2x}\):
\[ \int x\,\mathrm{e}^{-2x}\,\mathrm{d}x = -\frac{1}{2}x\,\mathrm{e}^{-2x} + \frac{1}{2}\int \mathrm{e}^{-2x}\,\mathrm{d}x = -\frac{1}{2}x\,\mathrm{e}^{-2x} - \frac{1}{4}\mathrm{e}^{-2x}. \]
Together:
\[ \int x^2\mathrm{e}^{-2x}\,\mathrm{d}x = -\mathrm{e}^{-2x}\left(\frac{x^2}{2} + \frac{x}{2} + \frac{1}{4}\right) + C. \]
When the integrand is an exponential times a sine or cosine, two steps bring back the original integral. Call it \(I\) and solve for \(I\).
Example 4 Find \(I = \displaystyle\int \mathrm{e}^{2x}\cos x\,\mathrm{d}x\).
Here either choice works, but you must keep the same type as \(u\) in both steps. Take \(u = \cos x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = \mathrm{e}^{2x}\):
\[ I = \frac{1}{2}\mathrm{e}^{2x}\cos x + \frac{1}{2}\int \mathrm{e}^{2x}\sin x\,\mathrm{d}x. \]
Again with \(u = \sin x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = \mathrm{e}^{2x}\):
\[ \int \mathrm{e}^{2x}\sin x\,\mathrm{d}x = \frac{1}{2}\mathrm{e}^{2x}\sin x - \frac{1}{2}\int \mathrm{e}^{2x}\cos x\,\mathrm{d}x = \frac{1}{2}\mathrm{e}^{2x}\sin x - \frac{1}{2}I. \]
Substitute back:
\[ I = \frac{1}{2}\mathrm{e}^{2x}\cos x + \frac{1}{4}\mathrm{e}^{2x}\sin x - \frac{1}{4}I \quad\Rightarrow\quad \frac{5}{4}I = \frac{1}{4}\mathrm{e}^{2x}(2\cos x + \sin x). \]
\[ I = \frac{1}{5}\mathrm{e}^{2x}(2\cos x + \sin x) + C. \]
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| \(u = \mathrm{e}^x\) in \(\int x\,\mathrm{e}^x\,\mathrm{d}x\) | \(u = x\) | Otherwise the new integral \(\int \frac{x^2}{2}\mathrm{e}^x\,\mathrm{d}x\) is harder. |
| \(u = x\) in \(\int x\ln x\,\mathrm{d}x\) | \(u = \ln x\) | You would need to integrate \(\ln x\), which is harder. |
| Sign error: \(uv + \int v\frac{\mathrm{d}u}{\mathrm{d}x}\,\mathrm{d}x\) | \(uv - \int v\frac{\mathrm{d}u}{\mathrm{d}x}\,\mathrm{d}x\) | Use brackets around the second integral when \(v\) is negative. |
| Switching \(u\) from trig to exponential in the second step | Keep the same type as \(u\) | Switching just undoes the first step and gives \(I = I\). |
| Forgetting \(+\,C\) after solving for \(I\) | Add \(C\) at the end | It is still an indefinite integral. |
Exercises
1 Find \(\displaystyle\int x\,\mathrm{e}^{3x}\,\mathrm{d}x\).
\(u = x\), \(v = \dfrac{1}{3}\mathrm{e}^{3x}\): \(\;\dfrac{x}{3}\mathrm{e}^{3x} - \displaystyle\int \frac{1}{3}\mathrm{e}^{3x}\,\mathrm{d}x = \frac{x}{3}\mathrm{e}^{3x} - \frac{1}{9}\mathrm{e}^{3x} + C\).
2 Find \(\displaystyle\int x\sin 2x\,\mathrm{d}x\).
\(u = x\), \(v = -\dfrac{1}{2}\cos 2x\): \(\;-\dfrac{x}{2}\cos 2x + \displaystyle\int \frac{1}{2}\cos 2x\,\mathrm{d}x = -\frac{x}{2}\cos 2x + \frac{1}{4}\sin 2x + C\).
3 Find \(\displaystyle\int x^3\ln x\,\mathrm{d}x\).
\(u = \ln x\), \(v = \dfrac{x^4}{4}\): \(\;\dfrac{x^4}{4}\ln x - \displaystyle\int \frac{x^3}{4}\,\mathrm{d}x = \frac{x^4}{4}\ln x - \frac{x^4}{16} + C\).
4 Find \(\displaystyle\int \frac{\ln x}{x^2}\,\mathrm{d}x\).
\(u = \ln x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = x^{-2}\), \(v = -\dfrac{1}{x}\): \(\;-\dfrac{\ln x}{x} + \displaystyle\int \frac{1}{x^2}\,\mathrm{d}x = -\frac{\ln x}{x} - \frac{1}{x} + C\).
5 Find \(\displaystyle\int \arctan x\,\mathrm{d}x\).
\(u = \arctan x\), \(v = x\): \(\;x\arctan x - \displaystyle\int \frac{x}{1 + x^2}\,\mathrm{d}x = x\arctan x - \frac{1}{2}\ln\left(1 + x^2\right) + C\).
6 Find \(\displaystyle\int x^2\cos x\,\mathrm{d}x\).
\(u = x^2\): \(\;x^2\sin x - \displaystyle\int 2x\sin x\,\mathrm{d}x\). Again \(u = 2x\): \(\;\displaystyle\int 2x\sin x\,\mathrm{d}x = -2x\cos x + 2\sin x\).
Answer: \(x^2\sin x + 2x\cos x - 2\sin x + C\).
7 Find \(\displaystyle\int (\ln x)^2\,\mathrm{d}x\).
\(u = (\ln x)^2\), \(v = x\): \(\;x(\ln x)^2 - \displaystyle\int 2\ln x\,\mathrm{d}x\). Since \(\int \ln x\,\mathrm{d}x = x\ln x - x\), the answer is \(x(\ln x)^2 - 2x\ln x + 2x + C\).
8 Find \(\displaystyle\int \mathrm{e}^x\sin x\,\mathrm{d}x\).
Let \(I\) be the integral. \(u = \sin x\): \(\;I = \mathrm{e}^x\sin x - \displaystyle\int \mathrm{e}^x\cos x\,\mathrm{d}x\). \(u = \cos x\): \(\;\displaystyle\int \mathrm{e}^x\cos x\,\mathrm{d}x = \mathrm{e}^x\cos x + I\).
So \(I = \mathrm{e}^x\sin x - \mathrm{e}^x\cos x - I\), and \(I = \dfrac{1}{2}\mathrm{e}^x(\sin x - \cos x) + C\).
9 Find \(\displaystyle\int x\sec^2 x\,\mathrm{d}x\).
\(u = x\), \(v = \tan x\): \(\;x\tan x - \displaystyle\int \tan x\,\mathrm{d}x\). Since \(\int \tan x\,\mathrm{d}x = \int \dfrac{\sin x}{\cos x}\,\mathrm{d}x = -\ln\lvert\cos x\rvert\) (the numerator is \(-\) the derivative of the denominator, Section 27.2), the answer is \(x\tan x + \ln\lvert\cos x\rvert + C\).
10 Find \(\displaystyle\int x(2x + 1)^5\,\mathrm{d}x\) by integration by parts.
\(u = x\), \(\dfrac{\mathrm{d}v}{\mathrm{d}x} = (2x + 1)^5\), \(v = \dfrac{(2x + 1)^6}{12}\):
\(\dfrac{x(2x + 1)^6}{12} - \displaystyle\int \frac{(2x + 1)^6}{12}\,\mathrm{d}x = \frac{x(2x + 1)^6}{12} - \frac{(2x + 1)^7}{168} + C\).