calculus

Integration by Parts: A Practical Guide with Examples

Master integration by parts with the LIATE shortcut and five worked examples (xe^x, x ln x, x² sin x, e^x cos x, ln x). Avoid the most common sign mistakes.
AI-Math Editorial Team

By AI-Math Editorial Team

Published 2026-05-02

Integration by parts is the product rule run backwards, and it is the single most-used integration technique after substitution. The formula is short, but choosing which part is "u" and which is "dv" turns into an art the first time you see it. This guide walks through the LIATE shortcut and five escalating examples, so you finish with a reliable method instead of trial-and-error.

The formula

udv=uvvdu\int u \, dv = uv - \int v \, du

Trade one integral for another that is (hopefully) easier. The art is in choosing uu and dvdv — bad choices make the new integral harder.

LIATE: a reliable rule of thumb

When picking uu, prefer functions earlier in this list:

Logarithmic > Inverse trig > Algebraic > Trigonometric > Exponential

Whatever's left becomes dvdv. LIATE is not a theorem, but it works for ~90% of textbook problems.

Example 1: xexdx\int x e^x \, dx (algebraic × exponential)

LIATE → algebraic before exponential, so u=xu = x, dv=exdxdv = e^x \, dx.

  • du=dxdu = dx, v=exv = e^x.
  • Apply: xexdx=xexexdx=xexex+C=ex(x1)+C\int x e^x \, dx = x e^x - \int e^x \, dx = x e^x - e^x + C = e^x(x - 1) + C.

Example 2: xlnxdx\int x \ln x \, dx (algebraic × logarithmic)

LIATE → log first: u=lnxu = \ln x, dv=xdxdv = x \, dx.

  • du=1xdxdu = \frac{1}{x} dx, v=x22v = \frac{x^2}{2}.
  • xlnxdx=x22lnxx221xdx\int x \ln x \, dx = \frac{x^2}{2}\ln x - \int \frac{x^2}{2} \cdot \frac{1}{x} \, dx.
  • Simplify: x22lnx12xdx=x22lnxx24+C\frac{x^2}{2}\ln x - \frac{1}{2}\int x \, dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C.

Example 3: x2sinxdx\int x^2 \sin x \, dx (algebraic × trig — apply twice)

u=x2u = x^2, dv=sinxdxdv = \sin x \, dx. Then du=2xdxdu = 2x \, dx, v=cosxv = -\cos x.

  • First pass: x2sinxdx=x2cosx+2xcosxdx\int x^2 \sin x \, dx = -x^2 \cos x + \int 2x \cos x \, dx.
  • Second pass on 2xcosxdx\int 2x \cos x \, dx: let u=2xu = 2x, dv=cosxdxdv = \cos x \, dx. Then du=2dxdu = 2 \, dx, v=sinxv = \sin x.
  • 2xcosxdx=2xsinx2sinxdx=2xsinx+2cosx\int 2x \cos x \, dx = 2x \sin x - \int 2 \sin x \, dx = 2x \sin x + 2 \cos x.
  • Combine: x2cosx+2xsinx+2cosx+C-x^2 \cos x + 2x \sin x + 2 \cos x + C.

When you see a polynomial of degree nn multiplied by sin/cos/exp\sin/\cos/\exp, expect to apply the rule nn times.

Example 4: excosxdx\int e^x \cos x \, dx (the loop trick)

Both factors are equally "good" candidates — neither becomes simpler when integrated or differentiated. Apply twice and watch the original integral come back, then solve algebraically.

  • First pass: u=cosxu = \cos x, dv=exdxdv = e^x \, dxexcosxdx=excosx+exsinxdx\int e^x \cos x \, dx = e^x \cos x + \int e^x \sin x \, dx.
  • Second pass on the new integral: u=sinxu = \sin x, dv=exdxdv = e^x \, dxexsinxdx=exsinxexcosxdx\int e^x \sin x \, dx = e^x \sin x - \int e^x \cos x \, dx.
  • Substitute back: original =excosx+exsinx= e^x \cos x + e^x \sin x - original.
  • Solve: 2original=ex(cosx+sinx)2 \cdot \text{original} = e^x (\cos x + \sin x), so original =ex(cosx+sinx)2+C= \frac{e^x(\cos x + \sin x)}{2} + C.

Example 5: lnxdx\int \ln x \, dx (the "no obvious dv" case)

Looks like there's nothing to integrate as dvdv. Trick: use dv=dxdv = dx (the "11" in lnx1\ln x \cdot 1).

  • u=lnxu = \ln x, dv=dxdv = dxdu=1xdxdu = \frac{1}{x} dx, v=xv = x.
  • lnxdx=xlnxx1xdx=xlnxx+C\int \ln x \, dx = x \ln x - \int x \cdot \frac{1}{x} dx = x \ln x - x + C.

This same trick handles arcsinxdx\int \arcsin x \, dx, arctanxdx\int \arctan x \, dx, and similar.

Common mistakes

  1. Sign errors. The formula has a single minus sign — use scratch paper to track +/+/-.
  2. Picking uu wrongly. If the new integral is harder than the original, you picked uu and dvdv backwards. Swap them.
  3. Forgetting "+ C" on indefinite integrals.
  4. Using by-parts when substitution would work. By-parts is for products that don't fit a u-substitution pattern. If f(g(x))g(x)dx\int f(g(x)) g'(x) \, dx, use substitution.

Try it yourself

Drop any integral into the Integral Calculator and we'll show you whether substitution, by-parts, or partial fractions is the right move — plus every step.

For specific worked examples and related topics:

AI-Math Editorial Team

By AI-Math Editorial Team

Published 2026-05-02

A small team of engineers, mathematicians, and educators behind AI-Math, focused on making step-by-step math help accessible to every student.