Integration by Parts: When to Use It and How

A visual, intuition-first guide to integration by parts: what it actually is, how to pick u and dv, and what to do when the integral loops back on itself.

By Petrus Sheya

August 2, 2026 · 7 min read

You already know how to integrate xx, and you already know how to integrate exe^x. So why does xexdx\int x e^x\, dx feel impossible?

The problem is that integration doesn't distribute over multiplication. fgdx\int f \cdot g\, dx is not fdxgdx\int f\, dx \cdot \int g\, dx. You can't just integrate each piece and multiply them together. You need a different tool entirely, and that tool is integration by parts.

This post walks through where the formula comes from, how to actually choose which part is "u," and what to do in the two situations that trip people up: when you have to repeat the process, and when the process refuses to end on its own.


Multiplying two functions breaks all your usual tricks

Every integration rule you've learned so far works on a single function. The power rule handles xnx^n. The exponential rule handles exe^x. The trig rules handle sinx\sin x and cosx\cos x.

None of them say anything about what happens when two of these get multiplied together. xexx e^x isn't xnx^n, and it isn't exe^x either. It's a new object, and none of your existing rules apply to it directly.

We need a rule built specifically for products. And it turns out we already have one. We've just been using it in the wrong direction.


The product rule, run backwards

Here's the move. You already know the product rule for derivatives. We write it as: if y=uvy = uv, then

(uv)=uv+uv(uv)' = u'v + uv'

Rearrange that one line and something useful falls out:

uv=(uv)uvuv' = (uv)' - u'v

Now integrate both sides with respect to xx. The integral of a derivative just undoes the derivative, so (uv)dx=uv\int (uv)'\, dx = uv. That gives us:

uvdx=uvvudx\int u v'\, dx = uv - \int v u'\, dx

Switch to the dudu/dvdv notation you'll actually see in textbooks, where du=udxdu = u'\,dx and dv=vdxdv = v'\,dx, and this becomes the formula everyone calls integration by parts:

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

That's the whole trick. You're not learning a new operation. You're running the product rule in reverse.


Watch the formula prove itself

Algebra convinces you the formula is true. But there's a picture that makes it obvious, and it doesn't use a single symbol from calculus.

Think of uu and vv as the two side lengths of a rectangle, both growing together as some parameter increases. The rectangle's area is uvu \cdot v. As it grows, that area gets added to in exactly two ways: a strip appears where the width grew, and a strip appears where the height grew.

Visualizer 01

The Rectangle That Splits in Two

Drag the point along the curve. The rectangle u·v always splits into exactly two pieces: the area under the curve, and the area left of it.

uv∫ v du∫ u dv
u, v0.65, 0.42
∫ v du (orange)0.092
∫ u dv (white)0.183
Sum, should equal u·v0.275 = 0.275

Drag the point along the curve. At every position, the full rectangle uvu \cdot v is exactly covered by two puzzle pieces: the region under the curve, which is vdu\int v\, du, and the region to the left of the curve, which is udv\int u\, dv. They never overlap and they never leave a gap. Add them and you always get uvu \cdot v back, exactly.

That's the entire formula, sitting there as a picture. Rearrange "the two pieces add up to the rectangle" and you get udv=uvvdu\int u\, dv = uv - \int v\, du.


So which part is u?

Here's where people get stuck. The formula needs you to split your integrand into two pieces, uu and dvdv. Pick well and the new integral is easier than the one you started with. Pick badly and it gets worse.

A rough guide that works most of the time is called LIATE. When you're deciding what to call uu, prefer, in this order: Logarithmic functions, Inverse trig functions, Algebraic functions like xx or x2x^2, Trig functions, Exponential functions. Whichever type appears first in that list becomes your uu. Everything else becomes dvdv.

The reasoning behind LIATE is simple once you see it: you want uu to be a function that gets simpler when you differentiate it, and you want dvdv to be a function that stays manageable when you integrate it. Logs and inverse trig get messier if you try to integrate them, so you never want them stuck inside an integral. Exponentials barely change no matter what you do to them, so they're happy sitting as dvdv.

Try it on xexdx\int x e^x\, dx. Algebraic beats exponential in LIATE, so u=xu = x.

Visualizer 02

Choose Your u for ∫ x eˣ dx

Pick which factor becomes u. One choice shrinks the problem. The other grows it every time you repeat it.

x^0power of x left in the new integral, per attempt
New integral∫ eˣ dx
Verdictsimpler

Pick the LIATE choice and du=dxdu = dx, v=exv = e^x, and the new integral is just exdx\int e^x\, dx. Done in one more step. Pick it backwards and v=x2/2v = x^2/2, and the new integral has a higher power of xx than you started with. Keep applying the same backwards choice and the power climbs forever. It never gets easier. It only gets worse.


What if one pass through the formula isn't enough?

LIATE tells you what to do once. But some integrals need the formula applied several times before they resolve. x2exdx\int x^2 e^x\, dx is a good example: after one pass you're left with 2xexdx\int 2x\, e^x\, dx, still a product, still not done.

You could keep applying the full formula by hand at every step, tracking uu, dudu, vv, and dvdv each time. Or you could use a shortcut that does the bookkeeping for you: the tabular method, sometimes called the DI method.

Put the part you'd normally call uu in a "D" column and keep differentiating it until you hit zero. Put the part you'd normally call dvdv in an "I" column and keep integrating it, matching the D column row for row. Then multiply diagonally, one row of D against the next row of I, alternating plus and minus signs starting with plus.

Visualizer 03

The Tabular Method for ∫ x²eˣ dx

Step through the table: differentiate one column to zero, integrate the other, multiply diagonally with alternating signs.

D (differentiate)I (integrate)+2x+20
Running antiderivative

Step through the table. x2x^2 differentiates down to 00 in three steps, so the table has exactly three usable rows, and each one hands you a term of the answer. Add them up and you get x2ex2xex+2ex+Cx^2 e^x - 2xe^x + 2e^x + C, the same answer you'd reach by applying the formula three separate times, just without re-deriving uu and vv at every step.

The tabular method only works this cleanly when one column eventually hits zero, which happens whenever the "D" side is a polynomial. Polynomials always differentiate down to nothing eventually. Not every product behaves this way.


What if the integral never gets simpler?

Try exsinxdx\int e^x \sin x\, dx. Neither exe^x nor sinx\sin x ever disappears when you differentiate or integrate them. There's no polynomial here to grind down to zero. The tabular method's trick doesn't apply.

Apply integration by parts anyway and watch what happens.

Visualizer 04

When the Integral Loops Back to Itself

Apply integration by parts twice to ∫ eˣ sin x dx and the original integral reappears. That's not a failure, it's the way out.

x = 2.20
I = ∫ eˣ sin x dx
I = eˣ sin x − ∫ eˣ cos x dx
I = eˣ sin x − (eˣ cos x + ∫ eˣ sin x dx) ← the loop: I reappears
2I = eˣ sin x − eˣ cos x → I = ½eˣ(sin x − cos x) + C
Numerical area (Riemann, n=2000)6.8040
Closed form, from the algebranot solved yet

Step through it. The first pass turns your integral into exsinxe^x \sin x minus a new integral, excosxdx\int e^x \cos x\, dx. Fine, apply the formula again to that one. But the second pass hands you back exsinxdx\int e^x \sin x\, dx, the exact integral you started with.

Call your original integral II. After two passes, the algebra reads I=exsinxexcosxII = e^x \sin x - e^x \cos x - I. You now have an equation for II, with II sitting on both sides. Add II to both sides, divide by 2, and you're done:

I=12ex(sinxcosx)+CI = \frac{1}{2}e^x(\sin x - \cos x) + C

No further integration needed. You solved it the way you'd solve 2I=62I = 6 for II, by treating the unknown integral as a variable and doing algebra on it. Whenever a repeated application of integration by parts hands you back your original integral, this is the way out.


A quick way to know when to reach for it

Reach for integration by parts when you're looking at a product of two functions from different families: an algebraic function times an exponential, a function times a log, or an exponential times a trig function, and none of your other techniques apply. Use LIATE to pick uu. If the new integral is still a product, either repeat the process (the tabular method helps when a polynomial is involved) or watch for a loop back to the original integral, and solve algebraically if you find one.


The short version

Integration by parts is the product rule for derivatives, read backwards. Split your product into uu and dvdv, and you trade the integral you can't do for a different one, hopefully easier, that you can.

LIATE tells you which part to call uu: pick the one that gets simpler when you differentiate it. Sometimes one pass is enough. Sometimes you need several, and the tabular method tracks the bookkeeping for you. And sometimes the integral doesn't shrink at all. It loops back to where it started, and the way out is algebra, not more calculus.

Three integrals, three different endings, one formula behind all of them.