Integration by Parts
u-substitution undoes the chain rule. Integration by parts undoes the product rule. You use it when you need to integrate a product of two different kinds of functions, like \(x e^x\) or \(x^2\sin x\).
By the end you can
- Use the formula and know where it comes from
- Pick \(u\) correctly every time (LIATE)
- Use the tabular shortcut for repeated parts
- Solve "loop" integrals like \(\int e^x \cos x\,dx\)
- Answer AP table questions like \(\int x f''(x)\,dx\)
Where the formula comes from
Start with the product rule for two functions \(u\) and \(v\):
\[ \frac{d}{dx}\big(uv\big) = u\,\frac{dv}{dx} + v\,\frac{du}{dx} \]Integrate both sides. The integral of a derivative is just the original function, so the left side becomes \(uv\):
\[ uv = \int u\,dv + \int v\,du \]Solve for the first integral on the right:
The formula doesn't solve anything directly. It trades your integral \(\int u\,dv\) for a new one, \(\int v\,du\). The whole skill is choosing \(u\) and \(dv\) so the new integral is easier than the one you started with.
The 4-step recipe
- Split the integrand into \(u\) (something you'll differentiate) and \(dv\) (everything else, including \(dx\), which you'll integrate).
- Make the box: find \(du\) by differentiating \(u\), and find \(v\) by integrating \(dv\). Leave out the \(+C\) here.
- Plug in: \(uv - \int v\,du\).
- Finish the new integral, then add \(+C\).
Writing the four pieces in a little 2×2 box keeps you from mixing them up:
Differentiate ↓
\(u = \;\dots\)\(du = \;\dots\)
Integrate ↓
\(dv = \;\dots\)\(v = \;\dots\)
Find \(\displaystyle\int x e^{3x}\,dx\).
- Choose \(u = x\) and \(dv = e^{3x}\,dx\). Why? Differentiating \(x\) turns it into \(1\), which is simpler. \(e^{3x}\) is easy to integrate.
- Box: \(du = dx\) and \(v = \tfrac13 e^{3x}\). Don't forget the \(\tfrac13\). That's the inside-derivative correction for \(e^{3x}\).
- Plug in: \(\displaystyle \int x e^{3x}\,dx = x\cdot\tfrac13 e^{3x} - \int \tfrac13 e^{3x}\,dx\)
- The new integral is easy: \(\int \tfrac13 e^{3x}\,dx = \tfrac19 e^{3x}\).
\(\frac{d}{dx}\left[\tfrac{x}{3}e^{3x} - \tfrac19 e^{3x}\right] = \tfrac13 e^{3x} + x e^{3x} - \tfrac13 e^{3x} = x e^{3x}\) ✓. This takes 20 seconds and catches almost every sign or constant mistake.
How to choose \(u\): LIATE
Pick \(u\) as whichever kind of function comes first in this list. Everything else goes into \(dv\).
| Letter | Type | Examples |
|---|---|---|
| L | Logarithmic | \(\ln x,\ \log_2 x\) |
| I | Inverse trig | \(\arctan x,\ \arcsin x\) |
| A | Algebraic (polynomials) | \(x,\ x^2,\ 3x+1\) |
| T | Trig | \(\sin x,\ \cos 2x\) |
| E | Exponential | \(e^x,\ e^{-2x},\ 2^x\) |
Why this order works: things at the top (logs, inverse trig) have nice derivatives but awful antiderivatives, so you want to differentiate them. Things at the bottom (trig, exponentials) are easy to integrate over and over, so they make a good \(dv\).
For \(\int x e^{3x}\,dx\), try \(u = e^{3x}\) and \(dv = x\,dx\). Then \(v = \tfrac{x^2}{2}\), and the new integral is \(\int \tfrac{x^2}{2}\cdot 3e^{3x}\,dx\). The power of \(x\) went up. If your new integral looks harder than the original, go back and swap \(u\) and \(dv\).
Find \(\displaystyle\int \ln x\,dx\).
It doesn't look like a product, but you can always write it as \(\ln x \cdot 1\).
- \(u = \ln x\) (L comes first) and \(dv = dx\).
- \(du = \tfrac1x\,dx\) and \(v = x\).
- \(\displaystyle \int \ln x\,dx = x\ln x - \int x\cdot\tfrac1x\,dx = x\ln x - \int 1\,dx\)
The same trick works for \(\int \arctan x\,dx\) and \(\int \arcsin x\,dx\). Let \(u\) be the function and \(dv = dx\).
For \(\displaystyle\int x^2 \ln x\,dx\), what should \(u\) be?
\(\displaystyle\int x\cos x\,dx = \;?\)
Repeated parts: the tabular method
Sometimes one round of parts isn't enough. In \(\int x^2\sin x\,dx\), one round turns \(x^2\) into \(x\), and you have to do parts again to get rid of the \(x\). When \(u\) is a polynomial that eventually differentiates to \(0\), there's a faster way to organize the work.
How to build the table
- Column D: write \(u\), then keep differentiating until you hit \(0\).
- Column I: write \(dv\) (without the \(dx\)), then keep integrating, once per row.
- Column sign: alternate \(+,\ -,\ +,\ -, \dots\) starting with \(+\).
- Multiply each D entry by the I entry one row below it (diagonally), attach that row's sign, and add everything up.
Find \(\displaystyle\int x^2 \sin x\,dx\).
| Sign | D (differentiate \(x^2\)) | I (integrate \(\sin x\)) |
|---|---|---|
| \(+\) | \(x^2\) | \(\sin x\) |
| \(-\) | \(2x\) | \(-\cos x\) |
| \(+\) | \(2\) | \(-\sin x\) |
| \(0\) | \(\cos x\) |
Now multiply along the diagonals (each D entry times the I entry one row down):
- \(+\,(x^2)(-\cos x) = -x^2\cos x\)
- \(-\,(2x)(-\sin x) = +2x\sin x\)
- \(+\,(2)(\cos x) = +2\cos x\)
Check: the derivative is \(-2x\cos x + x^2\sin x + 2\sin x + 2x\cos x - 2\sin x = x^2\sin x\) ✓
Use it when \(u\) is a polynomial (it reaches \(0\)) and \(dv\) is something you can integrate over and over, like \(e^{kx}\), \(\sin kx\), or \(\cos kx\). It does not work smoothly for \(\int x^2\ln x\,dx\), because you can't keep integrating \(\ln x\).
The loop trick: when parts brings you back
For \(\int e^x\cos x\,dx\), neither factor ever differentiates to \(0\). They just cycle. Here's the trick: do parts twice, and the original integral shows up again on the right side. Then you solve for it with algebra.
Find \(\displaystyle I = \int e^x\cos x\,dx\).
- Round 1: \(u = \cos x,\ dv = e^x dx \Rightarrow du = -\sin x\,dx,\ v = e^x\). \[ I = e^x\cos x - \int e^x(-\sin x)\,dx = e^x\cos x + \int e^x\sin x\,dx \]
- Round 2 on \(\int e^x\sin x\,dx\). Keep the trig function as \(u\): \(u = \sin x,\ dv = e^x dx \Rightarrow du = \cos x\,dx,\ v = e^x\). \[ \int e^x\sin x\,dx = e^x\sin x - \int e^x\cos x\,dx = e^x\sin x - I \]
- Substitute back: \(I = e^x\cos x + e^x\sin x - I\). The original integral \(I\) is back on the right side. That's the loop.
- Solve: \(2I = e^x(\cos x + \sin x)\), so \(I = \tfrac12 e^x(\sin x + \cos x)\).
If you picked the trig function as \(u\) in round 1, pick the trig function as \(u\) again in round 2. If you switch (making \(u = e^x\) in round 2), you just undo round 1 and end up with \(I = I\). That's true, but it's useless.
Definite integrals by parts
Same formula, but evaluate the \(uv\) part at the bounds too:
Evaluate \(\displaystyle\int_0^1 x e^{2x}\,dx\).
- \(u = x,\ dv = e^{2x}dx \Rightarrow du = dx,\ v = \tfrac12 e^{2x}\).
- \(\displaystyle \Big[\tfrac{x}{2}e^{2x}\Big]_0^1 - \int_0^1 \tfrac12 e^{2x}\,dx = \tfrac{e^2}{2} - 0 - \Big[\tfrac14 e^{2x}\Big]_0^1\)
- \(= \tfrac{e^2}{2} - \left(\tfrac{e^2}{4} - \tfrac14\right) = \tfrac{e^2}{4} + \tfrac14\)
AP favorite: parts with a table of values
The AP exam loves giving you a table of values for \(f\) and \(f'\) instead of a formula. You can still use parts. Pick \(u\) to be the plain \(x\) and \(dv\) to be the derivative piece.
The function \(f\) is twice differentiable and has the values below. Find \(\displaystyle\int_1^3 x f''(x)\,dx\).
| \(x\) | \(f(x)\) | \(f'(x)\) |
|---|---|---|
| 1 | 2 | 4 |
| 3 | 5 | −1 |
- \(u = x,\ dv = f''(x)\,dx \Rightarrow du = dx,\ v = f'(x)\). The antiderivative of \(f''\) is \(f'\). No formula needed.
- \(\displaystyle \int_1^3 x f''(x)\,dx = \Big[x f'(x)\Big]_1^3 - \int_1^3 f'(x)\,dx\)
- First part: \(3f'(3) - 1f'(1) = 3(-1) - 1(4) = -7\).
- Second part (Fundamental Theorem): \(\int_1^3 f'(x)\,dx = f(3) - f(1) = 5 - 2 = 3\).
- Combine: \(-7 - 3\).
Which expression equals \(\displaystyle\int x f'(x)\,dx\)?
Common mistakes
- Dropping the minus sign in \(uv - \int v\,du\), or mishandling a double negative like \(-\int(-\sin x)\,dx\).
- Forgetting constants in \(v\): the antiderivative of \(e^{3x}\) is \(\tfrac13 e^{3x}\), not \(e^{3x}\). The antiderivative of \(\sin 2x\) is \(-\tfrac12\cos 2x\).
- Picking \(u\) backwards, so the new integral is harder. Use LIATE.
- Forgetting to evaluate \(uv\) at the bounds in a definite integral.
- Forgetting \(+C\) on indefinite integrals. On FRQs this can cost a point.
Integration by parts shows up mostly in multiple choice. It's usually one round, sometimes two, plus the table version from Example 6. If you use the tabular method on a free-response question, write the table out so your work is visible.
Practice problems
Try each one on paper before opening the solution. Use the hint if you're stuck for more than a minute.
\(\displaystyle\int x e^{-x}\,dx\)
Hint
\(u = x\), \(dv = e^{-x}dx\). Be careful: \(v = -e^{-x}\).
Solution
\(du = dx,\ v = -e^{-x}\).
\[ \int x e^{-x}dx = -xe^{-x} - \int(-e^{-x})\,dx = -xe^{-x} + \int e^{-x}dx = -xe^{-x} - e^{-x} + C \]\(\displaystyle\int x^2 e^{x}\,dx\)
Hint
Polynomial times exponential: use the tabular method with D: \(x^2, 2x, 2, 0\).
Solution
D column: \(x^2,\ 2x,\ 2,\ 0\). I column: \(e^x,\ e^x,\ e^x,\ e^x\). Signs: \(+,-,+\).
\[ +x^2e^x - 2xe^x + 2e^x + C \]\(\displaystyle\int \arctan x\,dx\)
Hint
Hidden \(dv\): \(u = \arctan x\), \(dv = dx\). The new integral needs a u-substitution.
Solution
\(du = \dfrac{1}{1+x^2}dx,\ v = x\).
\[ \int\arctan x\,dx = x\arctan x - \int \frac{x}{1+x^2}\,dx \]For the new integral, let \(w = 1 + x^2\), \(dw = 2x\,dx\): \(\int\frac{x}{1+x^2}dx = \tfrac12\ln(1+x^2)\).
\(\displaystyle\int_1^e x\ln x\,dx\)
Hint
L before A: \(u = \ln x\), \(dv = x\,dx\). Remember \(\ln e = 1\) and \(\ln 1 = 0\).
Solution
\(du = \tfrac1x dx,\ v = \tfrac{x^2}{2}\).
\[ \Big[\tfrac{x^2}{2}\ln x\Big]_1^e - \int_1^e \tfrac{x^2}{2}\cdot\tfrac1x\,dx = \tfrac{e^2}{2} - \Big[\tfrac{x^2}{4}\Big]_1^e = \tfrac{e^2}{2} - \tfrac{e^2}{4} + \tfrac14 \]\(\displaystyle\int e^{2x}\sin x\,dx\)
Hint
Loop trick. Use the trig function as \(u\) both times, and watch the \(\tfrac12\)'s from integrating \(e^{2x}\).
Solution
Call it \(I\). Round 1: \(u = \sin x,\ dv = e^{2x}dx \Rightarrow v = \tfrac12 e^{2x}\).
\[ I = \tfrac12 e^{2x}\sin x - \tfrac12\int e^{2x}\cos x\,dx \]Round 2: \(u = \cos x,\ dv = e^{2x}dx\):
\[ \int e^{2x}\cos x\,dx = \tfrac12 e^{2x}\cos x + \tfrac12\int e^{2x}\sin x\,dx = \tfrac12 e^{2x}\cos x + \tfrac12 I \]Substitute: \(I = \tfrac12 e^{2x}\sin x - \tfrac14 e^{2x}\cos x - \tfrac14 I\). So \(\tfrac54 I = \tfrac14 e^{2x}(2\sin x - \cos x)\).
The function \(g\) is differentiable with \(g(0) = 7\), \(g(2) = 3\), and \(\displaystyle\int_0^2 g(x)\,dx = 4\). Find \(\displaystyle\int_0^2 x\,g'(x)\,dx\).
Hint
\(u = x\), \(dv = g'(x)\,dx\), so \(v = g(x)\). Notice \(g(0) = 7\) doesn't end up mattering. Why?
Solution
The \(g(0)\) term gets multiplied by \(x = 0\), so it vanishes.