Calculus

Integration by Parts

∫u dv = uv − ∫v du — the calculus inverse of the product rule

Integration by parts is the integration counterpart to the product rule for derivatives. The formula ∫u dv = uv − ∫v du transforms a hard integral into one that's hopefully easier. It's how you integrate x·e^x, x·sin(x), ln(x), and most products of dissimilar functions. Pick u and dv right and the new integral simplifies; pick wrong and you've made things worse.

  • Formula∫u dv = uv − ∫v du
  • SourceProduct rule (uv)' = u'v + uv' integrated
  • MnemonicLIATE — Logarithmic, Inverse trig, Algebraic, Trig, Exponential (pick u in this order)
  • Definite version∫_a^b u dv = [uv]_a^b − ∫_a^b v du
  • Used to integratex·e^x, x·sin x, ln x, arctan x, products of dissimilar functions
  • Sometimes needsRepeated application; tabular method for many iterations

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The formula and its origin

The formula:

∫ u dv = uv − ∫ v du

This comes directly from the product rule for derivatives. Differentiate uv:

d(uv)/dx = u' v + u v'

Integrate both sides with respect to x:

uv = ∫u'v dx + ∫uv' dx
   = ∫v du + ∫u dv

Rearrange — ∫u dv = uv − ∫v du. The formula is the product rule, integrated. We use it when the original integral ∫u dv is hard but ∫v du is easier.

How to apply it

Given an integral, pick parts of the integrand to label u and dv. Then:

  1. Write u — what you'll differentiate.
  2. Write dv — what you'll integrate.
  3. Compute du = (du/dx) dx.
  4. Compute v by integrating dv.
  5. Apply the formula — ∫u dv = uv − ∫v du.

The tricky step is the choice. LIATE (Logarithmic, Inverse trig, Algebraic, Trig, Exponential) suggests which to pick as u — earlier in the list = better choice. The idea — pick u so that du is simpler than u.

Worked examples

Example 1 — ∫ x · e^x dx

Algebraic (x) before Exponential (e^x), so u = x. Then dv = e^x dx.

u = x        →  du = dx
dv = e^x dx  →  v = e^x

∫x e^x dx = uv − ∫v du
          = x e^x − ∫e^x dx
          = x e^x − e^x + C
          = e^x(x − 1) + C

Example 2 — ∫ ln(x) dx

This looks tricky because there's no obvious "product." Trick — let u = ln(x) and dv = dx.

u = ln(x)  →  du = (1/x) dx
dv = dx    →  v = x

∫ln(x) dx = x ln(x) − ∫x · (1/x) dx
         = x ln(x) − ∫1 dx
         = x ln(x) − x + C
         = x(ln x − 1) + C

One application of integration by parts converts the seemingly impossible ∫ln(x) dx into the trivial ∫1 dx. This is the technique's elegance.

Example 3 — repeated application: ∫ x²·sin(x) dx

Algebraic before Trig — u = x², dv = sin(x) dx. First pass:

u = x²        →  du = 2x dx
dv = sin x dx →  v = −cos x

∫x² sin x dx = −x² cos x + ∫2x cos x dx

The new integral ∫2x cos x dx is easier (lower degree). Apply IBP again — u = 2x, dv = cos x dx.

u = 2x       →  du = 2 dx
dv = cos x   →  v = sin x

∫2x cos x dx = 2x sin x − ∫2 sin x dx
            = 2x sin x + 2 cos x + C

Combining:

∫x² sin x dx = −x² cos x + 2x sin x + 2 cos x + C
            = (2 − x²) cos x + 2x sin x + C

Tabular integration

For polynomial × (sin, cos, e^x), repeated IBP becomes tedious. Tabular integration shortcuts the bookkeeping. For ∫ x³ e^x dx:

SignD (derivatives of u = x³)I (antiderivatives of dv = e^x)
+e^x
3x²e^x
+6xe^x
6e^x
+0e^x

Multiply diagonally with the signs:

∫x³ e^x dx = +x³·e^x − 3x²·e^x + 6x·e^x − 6·e^x + C
           = e^x (x³ − 3x² + 6x − 6) + C

Five lines of work for what would take four IBP iterations. Tabular integration is just bookkeeping — same theorem, less notation.

LIATE vs other strategies

Integrandu choiceWhy
x · e^xu = x (Algebraic)du = dx is simpler
x · ln(x)u = ln(x) (Logarithmic)L beats A in LIATE; du = dx/x
x · arctan(x)u = arctan(x) (Inverse trig)du = dx/(1+x²) is simpler
x² · sin(x)u = x² (Algebraic)A beats T; reduces by IBP twice
e^x · sin(x)Either — both reduce to themselves after two IBPsCyclic; solve algebraically for the integral

JavaScript — symbolic IBP demo

// This is conceptual — real symbolic integration uses CAS like math.js.
// Here we numerically verify by integrating both forms.

function trapezoidIntegrate(f, a, b, n = 10000) {
  const h = (b - a) / n;
  let sum = 0.5 * (f(a) + f(b));
  for (let i = 1; i < n; i++) sum += f(a + i * h);
  return sum * h;
}

// ∫_0^1 x e^x dx — direct numerical
const direct = trapezoidIntegrate(x => x * Math.exp(x), 0, 1);

// IBP transformed — should equal e − 2·∫_0^1 e^x dx... let's verify the closed form
// ∫_0^1 x e^x dx = [x e^x]_0^1 − ∫_0^1 e^x dx = e − (e − 1) = 1
console.log(direct);  // ≈ 1.0
console.log(Math.E - (Math.E - 1));  // exactly 1.0

When integration by parts is the right tool

  • Polynomial × (sin / cos / e^x). Tabular integration handles these mechanically.
  • Functions that are "lone" — log, arctan, arcsin. Pick u = the function, dv = dx. ln(x), arctan(x) — all integrate this way.
  • Cyclic problems — ∫e^x sin(x) dx. Two IBPs return the original; solve algebraically for the unknown integral.
  • Reduction formulas. ∫sin^n(x) dx = (recurrence in n) — IBP gives the recurrence relation that lets you compute integrals of any power.
  • Probability and statistics. Many expected-value calculations involve ∫x · density(x) dx, naturally suited to IBP.

Common mistakes

  • Wrong choice of u and dv. Forgetting LIATE and picking the wrong one makes the new integral harder. If your IBP makes things worse, swap u and dv.
  • Forgetting the constant of integration. Standard for indefinite integrals; some textbooks omit; production calculus must include + C.
  • Sign errors in the formula. ∫u dv = uv − ∫v du. The minus sign in front of ∫v du is critical and easy to drop.
  • Computing v wrong. v = ∫ dv is an antiderivative — pick any one (often the simplest, with constant 0). Errors in v propagate to the final answer.
  • Not noticing cyclic patterns. ∫e^x sin x dx returns the original after two IBPs; you have to solve the resulting equation algebraically rather than recursing forever.
  • Forgetting limits in definite integrals. The definite version is ∫_a^b u dv = [uv]_a^b − ∫_a^b v du. The boundary term [uv]_a^b is often forgotten; it changes the answer.

Frequently asked questions

How do I pick u and dv?

Use the LIATE mnemonic — Logarithmic, Inverse trig, Algebraic, Trigonometric, Exponential. Pick u from whichever class comes first in this order; dv is whatever's left. The idea — pick u so that du is simpler (logs and inverse trigs differentiate to algebraic, useful), and dv so that v is computable. For ∫x·sin(x) dx — Algebraic (x) before Trig (sin), so u = x, dv = sin x dx. Works most of the time.

Why is LIATE a useful guide?

Because it picks u so du is simpler than u. Logs differentiate to 1/x (lower complexity than the original). Algebraic functions differentiate to lower-degree algebraics. So picking u from the higher-priority class makes du simpler, and the resulting ∫v du integral is hopefully easier than the original.

When does integration by parts fail?

When neither du nor dv simplifies. For ∫sin(x)/x dx — try u = sin x, du = cos x dx, dv = dx/x → v = ln x. Then ∫v du = ∫ln(x) cos(x) dx — harder than the original. For these "non-elementary" integrals, no closed-form antiderivative exists in elementary functions; you need special functions (Si(x) for sin/x, Ci(x) for cos/x).

What's tabular integration?

A shortcut for problems requiring repeated integration by parts. Make a table — derivatives of u down the left, antiderivatives of dv down the right. Multiply diagonally with alternating signs. Used when u is a polynomial of degree n — its derivatives eventually become zero, terminating the table.

Why is the formula ∫u dv = uv − ∫v du?

Differentiate uv using the product rule — (uv)' = u'v + uv'. Integrate both sides — uv = ∫u'v + ∫uv' = ∫v du + ∫u dv. Rearrange — ∫u dv = uv − ∫v du. The formula is just the product rule in integral form.

Do I need to repeat integration by parts on the new integral?

Yes, sometimes. ∫x²·e^x dx needs IBP twice — first reduces it to ∫2x·e^x dx (lower degree), second reduces to ∫2·e^x dx (computable). For ∫x^n · e^x or ∫x^n · sin/cos, you need n iterations. Tabular integration shortcuts the bookkeeping.

When should I use integration by parts vs u-substitution?

u-substitution handles compositions f(g(x)) · g'(x) — outer function with inner function's derivative. Integration by parts handles products f(x) · g(x) where the product structure matters but neither factor is a derivative of the other. If you can recognize a u-substitution pattern, that's usually faster.