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

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:

Integration by parts
\[ \int u\,dv = uv - \int v\,du \]
The big idea

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

  1. Split the integrand into \(u\) (something you'll differentiate) and \(dv\) (everything else, including \(dx\), which you'll integrate).
  2. Make the box: find \(du\) by differentiating \(u\), and find \(v\) by integrating \(dv\). Leave out the \(+C\) here.
  3. Plug in: \(uv - \int v\,du\).
  4. 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\)
Example 1

Find \(\displaystyle\int x e^{3x}\,dx\).

  1. Choose \(u = x\) and \(dv = e^{3x}\,dx\). Why? Differentiating \(x\) turns it into \(1\), which is simpler. \(e^{3x}\) is easy to integrate.
  2. Box: \(du = dx\) and \(v = \tfrac13 e^{3x}\). Don't forget the \(\tfrac13\). That's the inside-derivative correction for \(e^{3x}\).
  3. Plug in: \(\displaystyle \int x e^{3x}\,dx = x\cdot\tfrac13 e^{3x} - \int \tfrac13 e^{3x}\,dx\)
  4. The new integral is easy: \(\int \tfrac13 e^{3x}\,dx = \tfrac19 e^{3x}\).
\(\tfrac{x}{3}e^{3x} - \tfrac19 e^{3x} + C\)
Always check by differentiating

\(\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\).

LetterTypeExamples
LLogarithmic\(\ln x,\ \log_2 x\)
IInverse trig\(\arctan x,\ \arcsin x\)
AAlgebraic (polynomials)\(x,\ x^2,\ 3x+1\)
TTrig\(\sin x,\ \cos 2x\)
EExponential\(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\).

What a bad choice looks like

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\).

Example 2 · The hidden \(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\).

  1. \(u = \ln x\) (L comes first) and \(dv = dx\).
  2. \(du = \tfrac1x\,dx\) and \(v = x\).
  3. \(\displaystyle \int \ln x\,dx = x\ln x - \int x\cdot\tfrac1x\,dx = x\ln x - \int 1\,dx\)
\(x\ln x - x + C\)

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?

L comes before A in LIATE. Also, if you picked \(dv = \ln x\,dx\), you'd need the antiderivative of \(\ln x\), which is itself a parts problem. With \(u = \ln x\), \(dv = x^2dx\): \(v = \tfrac{x^3}{3}\), and the new integral \(\int \tfrac{x^3}{3}\cdot\tfrac1x\,dx = \int\tfrac{x^2}{3}\,dx\) is easy. Final answer: \(\tfrac{x^3}{3}\ln x - \tfrac{x^3}{9} + C\).

\(\displaystyle\int x\cos x\,dx = \;?\)

\(u = x,\ dv = \cos x\,dx \Rightarrow du = dx,\ v = \sin x\). So \(x\sin x - \int \sin x\,dx = x\sin x - (-\cos x) = x\sin x + \cos x + C\). The two minus signs cancel, and that's the most common place to slip.

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

  1. Column D: write \(u\), then keep differentiating until you hit \(0\).
  2. Column I: write \(dv\) (without the \(dx\)), then keep integrating, once per row.
  3. Column sign: alternate \(+,\ -,\ +,\ -, \dots\) starting with \(+\).
  4. Multiply each D entry by the I entry one row below it (diagonally), attach that row's sign, and add everything up.
Example 3

Find \(\displaystyle\int x^2 \sin x\,dx\).

SignD (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):

  1. \(+\,(x^2)(-\cos x) = -x^2\cos x\)
  2. \(-\,(2x)(-\sin x) = +2x\sin x\)
  3. \(+\,(2)(\cos x) = +2\cos x\)
\(-x^2\cos x + 2x\sin x + 2\cos x + C\)

Check: the derivative is \(-2x\cos x + x^2\sin x + 2\sin x + 2x\cos x - 2\sin x = x^2\sin x\) ✓

When tabular works

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.

Example 4

Find \(\displaystyle I = \int e^x\cos x\,dx\).

  1. 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 \]
  2. 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 \]
  3. 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.
  4. Solve: \(2I = e^x(\cos x + \sin x)\), so \(I = \tfrac12 e^x(\sin x + \cos x)\).
\(\tfrac12 e^x(\sin x + \cos x) + C\)
Stay consistent in round 2

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:

\[ \int_a^b u\,dv = \Big[uv\Big]_a^b - \int_a^b v\,du \]
Example 5

Evaluate \(\displaystyle\int_0^1 x e^{2x}\,dx\).

  1. \(u = x,\ dv = e^{2x}dx \Rightarrow du = dx,\ v = \tfrac12 e^{2x}\).
  2. \(\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\)
  3. \(= \tfrac{e^2}{2} - \left(\tfrac{e^2}{4} - \tfrac14\right) = \tfrac{e^2}{4} + \tfrac14\)
\(\dfrac{e^2 + 1}{4}\)

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.

Example 6

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)\)
124
35−1
  1. \(u = x,\ dv = f''(x)\,dx \Rightarrow du = dx,\ v = f'(x)\). The antiderivative of \(f''\) is \(f'\). No formula needed.
  2. \(\displaystyle \int_1^3 x f''(x)\,dx = \Big[x f'(x)\Big]_1^3 - \int_1^3 f'(x)\,dx\)
  3. First part: \(3f'(3) - 1f'(1) = 3(-1) - 1(4) = -7\).
  4. Second part (Fundamental Theorem): \(\int_1^3 f'(x)\,dx = f(3) - f(1) = 5 - 2 = 3\).
  5. Combine: \(-7 - 3\).
\(-10\)

Which expression equals \(\displaystyle\int x f'(x)\,dx\)?

With \(u = x\) and \(dv = f'(x)\,dx\), you get \(du = dx\) and \(v = f(x)\), so the answer is \(uv - \int v\,du = x f(x) - \int f(x)\,dx\). A common slip is writing \(u\cdot dv\) instead of \(u\cdot v\) in the first term, which gives \(x f'(x)\).

Common mistakes

Watch out for these
On the AP exam

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.

Warm-up

\(\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 \]
\(-e^{-x}(x + 1) + C\)
Medium

\(\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 \]
\(e^x(x^2 - 2x + 2) + C\)
Medium

\(\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)\).

\(x\arctan x - \tfrac12\ln(1 + x^2) + C\)
Medium

\(\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 \]
\(\dfrac{e^2 + 1}{4}\)
Challenge

\(\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)\).

\(\tfrac15 e^{2x}(2\sin x - \cos x) + C\)
AP-style

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
\[ \int_0^2 x\,g'(x)\,dx = \Big[x\,g(x)\Big]_0^2 - \int_0^2 g(x)\,dx = \big(2\cdot 3 - 0\cdot 7\big) - 4 \]

The \(g(0)\) term gets multiplied by \(x = 0\), so it vanishes.

\(2\)