Skip to content
Family Table Math

Integration by Parts

Substitution undoes the chain rule. But what about ∫xe2x dx\int x e^{2x}\,dx or ∫ln⁡x dx\int \ln x\,dx? There is no inside function whose derivative is sitting there. These integrals come from the product rule, and integration by parts is the product rule run backwards. It’s a BC-only technique, and it shows up on the exam both on its own and inside bigger problems (improper integrals, Taylor series, area and volume).

The product rule says ddx(uv)=u dvdx+v dudx\dfrac{d}{dx}(uv) = u\,\dfrac{dv}{dx} + v\,\dfrac{du}{dx}. Integrate both sides and rearrange:

∫u dv=uv−∫v du\int u\,dv = uv - \int v\,du

You split the integrand into two pieces: uu (which you will differentiate) and dvdv (which you will integrate). The goal is a new integral ∫v du\int v\,du that is easier than the one you started with.

A tidy way to organize your work is a small box:

DifferentiateIntegrate
Chooseu=…u = \ldotsdv=…dv = \ldots
Finddu=…du = \ldotsv=…v = \ldots

When you find vv, leave off the +C+ C. One constant at the very end is enough.

Pick uu to be the factor that gets simpler when you differentiate it, and dvdv to be something you can actually integrate. The guide LIATE lists good choices for uu, best first:

LIATE
LogarithmsInverse trigAlgebraic (powers of xx)TrigExponentials

For example, in ∫xe2x dx\int x e^{2x}\,dx the xx (Algebraic) comes before e2xe^{2x} (Exponential), so u=xu = x. LIATE is a guide, not a law: if your choice makes the new integral worse, switch.

For ∫x2ex dx\int x^2 e^x\,dx, one round of parts lowers x2x^2 to 2x2x, and a second round lowers it to a constant. Just do parts twice, carefully.

When uu is a polynomial that eventually differentiates to 00, the tabular method (optional, but quick) keeps the bookkeeping straight. Differentiate uu down one column until you reach 00, integrate dvdv down the other, then multiply along the diagonals with alternating signs +,−,+,…+, -, +, \ldots (see Example 3).

Evaluate the uvuv part at the limits too:

∫abu dv=[uv]ab−∫abv du\int_a^b u\,dv = \Big[uv\Big]_a^b - \int_a^b v\,du

For ∫excos⁡x dx\int e^x \cos x\,dx, neither factor ever gets simpler. Do parts twice, and the original integral shows up again on the right side. Treat it as an unknown II and solve for it algebraically (Example 4).

Trig on this page is in radians, as it is throughout AP Calculus. (Grade 11 trig used degrees; the derivative rules for sin⁡\sin and cos⁡\cos only work in radians.)

Find ∫xe2x dx\displaystyle\int x e^{2x}\,dx.

Solution. LIATE puts Algebraic before Exponential, so:

DifferentiateIntegrate
Chooseu=xu = xdv=e2x dxdv = e^{2x}\,dx
Finddu=dxdu = dxv=12e2xv = \tfrac{1}{2}e^{2x}
∫xe2x dx=x⋅12e2x−∫12e2x dx=12xe2x−14e2x+C\begin{aligned} \int x e^{2x}\,dx &= x \cdot \tfrac{1}{2}e^{2x} - \int \tfrac{1}{2}e^{2x}\,dx \\ &= \tfrac{1}{2}x e^{2x} - \tfrac{1}{4}e^{2x} + C \end{aligned}

Check: ddx(12xe2x−14e2x)=12e2x+xe2x−12e2x=xe2x\dfrac{d}{dx}\left(\tfrac{1}{2}x e^{2x} - \tfrac{1}{4}e^{2x}\right) = \tfrac{1}{2}e^{2x} + x e^{2x} - \tfrac{1}{2}e^{2x} = x e^{2x}. ✓

Find ∫ln⁡x dx\displaystyle\int \ln x\,dx, then evaluate ∫1eln⁡x dx\displaystyle\int_1^e \ln x\,dx.

Solution. There is only one factor, so use the trick of letting dv=dxdv = dx. Logarithms are first in LIATE, so u=ln⁡xu = \ln x:

DifferentiateIntegrate
Chooseu=ln⁡xu = \ln xdv=dxdv = dx
Finddu=1x dxdu = \tfrac{1}{x}\,dxv=xv = x
∫ln⁡x dx=xln⁡x−∫x⋅1x dx=xln⁡x−x+C\int \ln x\,dx = x\ln x - \int x \cdot \frac{1}{x}\,dx = x\ln x - x + C

For the definite integral:

∫1eln⁡x dx=[xln⁡x−x]1e=(e⋅1−e)−(1⋅0−1)=1\int_1^e \ln x\,dx = \Big[x\ln x - x\Big]_1^e = (e \cdot 1 - e) - (1 \cdot 0 - 1) = 1
Graph of y = ln x. The region under the curve and above the x-axis from (1, 0) to (e, 1) is shaded, with area 1. 1 2 3 −1 1 (e, 1) (1, 0) area = 1 y = ln x
The region under y=ln⁡xy = \ln x from x=1x = 1 to x=ex = e has area exactly 11.

Example 3: Repeated parts (and the tabular method)

Section titled “Example 3: Repeated parts (and the tabular method)”

Find ∫x2sin⁡x dx\displaystyle\int x^2 \sin x\,dx.

Solution. Take u=x2u = x^2 and dv=sin⁡x dxdv = \sin x\,dx, so du=2x dxdu = 2x\,dx and v=−cos⁡xv = -\cos x:

∫x2sin⁡x dx=−x2cos⁡x+∫2xcos⁡x dx\int x^2 \sin x\,dx = -x^2\cos x + \int 2x\cos x\,dx

The new integral still needs parts. Take u=2xu = 2x, dv=cos⁡x dxdv = \cos x\,dx, so du=2 dxdu = 2\,dx, v=sin⁡xv = \sin x:

∫2xcos⁡x dx=2xsin⁡x−∫2sin⁡x dx=2xsin⁡x+2cos⁡x\int 2x\cos x\,dx = 2x\sin x - \int 2\sin x\,dx = 2x\sin x + 2\cos x

Putting it together:

∫x2sin⁡x dx=−x2cos⁡x+2xsin⁡x+2cos⁡x+C\int x^2 \sin x\,dx = -x^2\cos x + 2x\sin x + 2\cos x + C

Tabular version. Differentiate x2x^2 down to 00; integrate sin⁡x\sin x the same number of times:

SignDifferentiate uuIntegrate dvdv
++x2x^2sin⁡x\sin x
−-2x2x−cos⁡x-\cos x
++22−sin⁡x-\sin x
00cos⁡x\cos x

Multiply each entry in the left column by the entry one row down in the right column, using the signs: (+)(x2)(−cos⁡x)+(−)(2x)(−sin⁡x)+(+)(2)(cos⁡x)(+)(x^2)(-\cos x) + (-)(2x)(-\sin x) + (+)(2)(\cos x), which gives the same answer.

Find ∫excos⁡x dx\displaystyle\int e^x\cos x\,dx.

Solution. Call the integral II. Take u=cos⁡xu = \cos x, dv=ex dxdv = e^x\,dx, so du=−sin⁡x dxdu = -\sin x\,dx, v=exv = e^x:

I=excos⁡x+∫exsin⁡x dxI = e^x\cos x + \int e^x\sin x\,dx

Do parts again on the new integral, keeping the same kind of choice (uu = the trig function): u=sin⁡xu = \sin x, dv=ex dxdv = e^x\,dx, so du=cos⁡x dxdu = \cos x\,dx, v=exv = e^x:

∫exsin⁡x dx=exsin⁡x−∫excos⁡x dx=exsin⁡x−I\int e^x\sin x\,dx = e^x\sin x - \int e^x\cos x\,dx = e^x\sin x - I

Substitute back and solve for II:

I=excos⁡x+exsin⁡x−I2I=ex(sin⁡x+cos⁡x)I=12ex(sin⁡x+cos⁡x)+C\begin{aligned} I &= e^x\cos x + e^x\sin x - I \\ 2I &= e^x(\sin x + \cos x) \\ I &= \tfrac{1}{2}e^x(\sin x + \cos x) + C \end{aligned}

Check: ddx[12ex(sin⁡x+cos⁡x)]=12ex(sin⁡x+cos⁡x)+12ex(cos⁡x−sin⁡x)=excos⁡x\dfrac{d}{dx}\left[\tfrac{1}{2}e^x(\sin x + \cos x)\right] = \tfrac{1}{2}e^x(\sin x + \cos x) + \tfrac{1}{2}e^x(\cos x - \sin x) = e^x\cos x. ✓

Choosing u and dv backwards. With u=e2xu = e^{2x} and dv=x dxdv = x\,dx in Example 1, the new integral is ∫12x2⋅2e2x dx\int \tfrac{1}{2}x^2 \cdot 2e^{2x}\,dx, which is worse. If the power of xx goes up, switch your choice.

Sign errors in the minus sign. The formula has uv−∫v duuv - \int v\,du. When vv is itself negative (like v=−cos⁡xv = -\cos x), the subtraction becomes addition. Put brackets around ∫v du\int v\,du before simplifying.

Switching choices on the second round. In Example 4, if you used u=cos⁡xu = \cos x the first time but u=exu = e^x the second time, you would just undo your first step and get I=II = I. Keep the same type of function as uu each time.

Forgetting to evaluate uv at the limits. In a definite integral, the uvuv term needs [uv]ab\Big[uv\Big]_a^b too, not just the leftover integral.

Dropping the + C or adding it too early. Leave the constant off vv; put a single +C+ C on the final indefinite answer.

Forcing parts when substitution works. ∫xex2 dx\int x e^{x^2}\,dx is a uu-substitution (u=x2u = x^2), not parts. Always check for an inside function and its derivative first.

1. (Warm-up) Find ∫xcos⁡x dx\displaystyle\int x\cos x\,dx.

Solution

u=xu = x, dv=cos⁡x dxdv = \cos x\,dx, so du=dxdu = dx, v=sin⁡xv = \sin x:

∫xcos⁡x dx=xsin⁡x−∫sin⁡x dx=xsin⁡x+cos⁡x+C\int x\cos x\,dx = x\sin x - \int \sin x\,dx = x\sin x + \cos x + C

2. (Warm-up) Find ∫xe−x dx\displaystyle\int x e^{-x}\,dx.

Solution

u=xu = x, dv=e−x dxdv = e^{-x}\,dx, so du=dxdu = dx, v=−e−xv = -e^{-x}:

∫xe−x dx=−xe−x−∫(−e−x)dx=−xe−x−e−x+C\int x e^{-x}\,dx = -x e^{-x} - \int \left(-e^{-x}\right)dx = -x e^{-x} - e^{-x} + C

3. (Warm-up) Find ∫xln⁡x dx\displaystyle\int x\ln x\,dx.

Solution

Logarithm first in LIATE: u=ln⁡xu = \ln x, dv=x dxdv = x\,dx, so du=1x dxdu = \tfrac{1}{x}\,dx, v=12x2v = \tfrac{1}{2}x^2:

∫xln⁡x dx=12x2ln⁡x−∫12x2⋅1x dx=12x2ln⁡x−14x2+C\int x\ln x\,dx = \tfrac{1}{2}x^2\ln x - \int \tfrac{1}{2}x^2 \cdot \tfrac{1}{x}\,dx = \tfrac{1}{2}x^2\ln x - \tfrac{1}{4}x^2 + C

4. (Core) Evaluate ∫01xex dx\displaystyle\int_0^1 x e^x\,dx.

Solution

u=xu = x, dv=ex dxdv = e^x\,dx, so du=dxdu = dx, v=exv = e^x:

∫01xex dx=[xex]01−∫01ex dx=e−[ex]01=e−(e−1)=1\int_0^1 x e^x\,dx = \Big[x e^x\Big]_0^1 - \int_0^1 e^x\,dx = e - \Big[e^x\Big]_0^1 = e - (e - 1) = 1

5. (Core) Find ∫x2ex dx\displaystyle\int x^2 e^x\,dx.

Solution

Tabular method with u=x2u = x^2, dv=ex dxdv = e^x\,dx:

SignDifferentiateIntegrate
++x2x^2exe^x
−-2x2xexe^x
++22exe^x
00exe^x
∫x2ex dx=x2ex−2xex+2ex+C=ex(x2−2x+2)+C\int x^2 e^x\,dx = x^2 e^x - 2x e^x + 2e^x + C = e^x\left(x^2 - 2x + 2\right) + C

6. (Core) Find ∫arctan⁡x dx\displaystyle\int \arctan x\,dx.

Solution

As with ln⁡x\ln x, use u=arctan⁡xu = \arctan x, dv=dxdv = dx, so du=11+x2 dxdu = \dfrac{1}{1 + x^2}\,dx, v=xv = x:

∫arctan⁡x dx=xarctan⁡x−∫x1+x2 dx\int \arctan x\,dx = x\arctan x - \int \frac{x}{1 + x^2}\,dx

The last integral is a substitution (w=1+x2w = 1 + x^2, x dx=12 dwx\,dx = \tfrac{1}{2}\,dw):

∫arctan⁡x dx=xarctan⁡x−12ln⁡(1+x2)+C\int \arctan x\,dx = x\arctan x - \tfrac{1}{2}\ln\left(1 + x^2\right) + C

7. (Core) A cyclist’s velocity is v(t)=te−t/2v(t) = t e^{-t/2} metres per second, for tt in seconds. Find the distance she travels from t=0t = 0 to t=4t = 4. Give an exact answer and a decimal to 3 places.

Solution

Since v(t)≥0v(t) \ge 0, distance =∫04te−t/2 dt= \displaystyle\int_0^4 t e^{-t/2}\,dt. Take u=tu = t, dv=e−t/2 dtdv = e^{-t/2}\,dt, so du=dtdu = dt, v=−2e−t/2v = -2e^{-t/2}:

∫04te−t/2 dt=[−2te−t/2]04+∫042e−t/2 dt=−8e−2+[−4e−t/2]04=−8e−2−4e−2+4=4−12e−2≈2.376 m\begin{aligned} \int_0^4 t e^{-t/2}\,dt &= \Big[-2t e^{-t/2}\Big]_0^4 + \int_0^4 2e^{-t/2}\,dt \\ &= -8e^{-2} + \Big[-4e^{-t/2}\Big]_0^4 \\ &= -8e^{-2} - 4e^{-2} + 4 = 4 - 12e^{-2} \approx 2.376 \text{ m} \end{aligned}

8. (Challenge) Find ∫e2xsin⁡x dx\displaystyle\int e^{2x}\sin x\,dx.

Solution

Let II be the integral. Use u=sin⁡xu = \sin x, dv=e2x dxdv = e^{2x}\,dx, so du=cos⁡x dxdu = \cos x\,dx, v=12e2xv = \tfrac{1}{2}e^{2x}:

I=12e2xsin⁡x−12∫e2xcos⁡x dxI = \tfrac{1}{2}e^{2x}\sin x - \tfrac{1}{2}\int e^{2x}\cos x\,dx

Again with the trig function as uu: u=cos⁡xu = \cos x, dv=e2x dxdv = e^{2x}\,dx, so du=−sin⁡x dxdu = -\sin x\,dx, v=12e2xv = \tfrac{1}{2}e^{2x}:

∫e2xcos⁡x dx=12e2xcos⁡x+12I\int e^{2x}\cos x\,dx = \tfrac{1}{2}e^{2x}\cos x + \tfrac{1}{2}I

So

I=12e2xsin⁡x−14e2xcos⁡x−14I54I=14e2x(2sin⁡x−cos⁡x)I=15e2x(2sin⁡x−cos⁡x)+C\begin{aligned} I &= \tfrac{1}{2}e^{2x}\sin x - \tfrac{1}{4}e^{2x}\cos x - \tfrac{1}{4}I \\ \tfrac{5}{4}I &= \tfrac{1}{4}e^{2x}(2\sin x - \cos x) \\ I &= \tfrac{1}{5}e^{2x}(2\sin x - \cos x) + C \end{aligned}

9. (Challenge) Find ∫(ln⁡x)2 dx\displaystyle\int (\ln x)^2\,dx.

Solution

u=(ln⁡x)2u = (\ln x)^2, dv=dxdv = dx, so du=2ln⁡xx dxdu = \dfrac{2\ln x}{x}\,dx, v=xv = x:

∫(ln⁡x)2 dx=x(ln⁡x)2−∫2ln⁡x dx\int (\ln x)^2\,dx = x(\ln x)^2 - \int 2\ln x\,dx

From Example 2, ∫ln⁡x dx=xln⁡x−x\int \ln x\,dx = x\ln x - x, so

∫(ln⁡x)2 dx=x(ln⁡x)2−2xln⁡x+2x+C\int (\ln x)^2\,dx = x(\ln x)^2 - 2x\ln x + 2x + C