Math Core

Lesson 2.2 · Advanced Integration

Integration by parts

Substitution handles integrals built from the chain rule, but it can't touch something as simple-looking as ∫xcos⁡x dx\displaystyle\int x\cos x\,dx or ∫ln⁡x dx\displaystyle\int \ln x\,dx. Integration by parts is the reverse of the product rule, and it is the main tool for integrating a product of two different kinds of functions.

Where the formula comes from

Start with the product rule for two functions uu and vv of xx:

ddx(uv)=udvdx+vdudx.\frac{d}{dx}\big(uv\big) = u\frac{dv}{dx} + v\frac{du}{dx}.

Integrate both sides and rearrange:

uv=∫u dv+∫v du⟹∫u dv=uv−∫v du.uv = \int u\,dv + \int v\,du \quad\Longrightarrow\quad \int u\,dv = uv - \int v\,du.

Integration by parts

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

For definite integrals:

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

The idea is to split the integrand into two pieces: a piece uu that you will differentiate, and a piece dvdv that you will integrate. The formula trades your original integral for ∫v du\displaystyle\int v\,du. The method works when that new integral is easier than the one you started with.

Choosing u and dv

The choice is the whole game. You want uu to get simpler when you differentiate it, and you need dvdv to be something you can integrate. A common guide is LIATE: choose uu as the first type on this list that appears in the integrand.

LetterTypeExamples
LLogarithmicln⁡x\ln x
IInverse trigarctan⁡x\arctan x, arcsin⁡x\arcsin x
AAlgebraicxx, x2x^2, 3x+13x + 1
TTrigonometricsin⁡x\sin x, cos⁡2x\cos 2x
EExponentialexe^x, e−3xe^{-3x}

Logs and inverse trig functions sit at the top because their derivatives (1x\dfrac{1}{x}, 11+x2\dfrac{1}{1 + x^2}) are algebraic and much simpler, while their antiderivatives are hard. Exponentials and sines sit at the bottom because they are easy to integrate over and over.

Worked example: A polynomial times a trig function

Find ∫xcos⁡x dx\displaystyle\int x\cos x\,dx.

Algebraic comes before trig, so let u=xu = x and dv=cos⁡x dxdv = \cos x\,dx. Then du=dxdu = dx and 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.

Check: ddx(xsin⁡x+cos⁡x)=sin⁡x+xcos⁡x−sin⁡x=xcos⁡x\dfrac{d}{dx}(x\sin x + \cos x) = \sin x + x\cos x - \sin x = x\cos x.

Common mistake

If you choose u=cos⁡xu = \cos x and dv=x dxdv = x\,dx instead, the formula gives x22cos⁡x+∫x22sin⁡x dx\tfrac{x^2}{2}\cos x + \displaystyle\int \tfrac{x^2}{2}\sin x\,dx, which is harder than the original. When the new integral gets worse, switch your choice of uu and dvdv.

Integrating ln x and arctan x

Some integrals don't look like products at all. Write them as a product with 11 and let dv=dxdv = dx.

Worked example: The integral of ln x

Find ∫ln⁡x dx\displaystyle\int \ln x\,dx.

Let u=ln⁡xu = \ln x and dv=dxdv = dx. Then du=1x dxdu = \dfrac{1}{x}\,dx and v=xv = x.

∫ln⁡x dx=xln⁡x−∫x⋅1x dx=xln⁡x−∫1 dx=xln⁡x−x+C.\int \ln x\,dx = x\ln x - \int x\cdot\frac{1}{x}\,dx = x\ln x - \int 1\,dx = x\ln x - x + C.

The same trick with u=arctan⁡xu = \arctan x gives ∫arctan⁡x dx=xarctan⁡x−12ln⁡(1+x2)+C\displaystyle\int \arctan x\,dx = x\arctan x - \tfrac{1}{2}\ln(1 + x^2) + C, where the last integral needs a quick substitution.

Definite integrals by parts

With limits, evaluate the uvuv term at both endpoints and keep the limits on the new integral.

Worked example: A definite integral

Evaluate ∫01xex dx\displaystyle\int_0^1 x e^x\,dx.

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

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

Repeated integration by parts

If uu is x2x^2 or x3x^3, one round of parts lowers the power by one, so you apply the formula again. A tabular layout keeps the signs straight. Differentiate uu down to zero in one column, integrate dvdv repeatedly in another, then multiply along the diagonals with alternating signs +,−,+,…+, -, +, \dots

Worked example: Parts twice, in a table

Find ∫x2ex dx\displaystyle\int x^2 e^x\,dx.

signderivatives of x2x^2integrals of exe^x
++x2x^2exe^x
−-2x2xexe^x
++22exe^x
00exe^x

Multiply each entry in the middle column by the entry one row down in the right column, using the sign in its row:

∫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.

Tip

Sometimes parts brings back the original integral, as in ∫exsin⁡x dx\displaystyle\int e^x\sin x\,dx. After two rounds you get an equation like I=exsin⁡x−excos⁡x−II = e^x\sin x - e^x\cos x - I. Solve it algebraically: 2I=ex(sin⁡x−cos⁡x)2I = e^x(\sin x - \cos x), so I=12ex(sin⁡x−cos⁡x)+CI = \tfrac{1}{2}e^x(\sin x - \cos x) + C.

Parts with functions given by tables

AP free-response questions often give values of ff and f′f' instead of a formula. Integration by parts still works, because you only need the uvuv term at the endpoints and the value of the leftover integral. For example, with u=xu = x and dv=f′(x) dxdv = f'(x)\,dx:

∫abxf′(x) dx=[xf(x)]ab−∫abf(x) dx.\int_a^b x f'(x)\,dx = \Big[x f(x)\Big]_a^b - \int_a^b f(x)\,dx.

The last practice problem uses this.

Practice

Practice 1

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

Practice 2

Evaluate ∫0πxsin⁡x dx\displaystyle\int_0^{\pi} x\sin x\,dx.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Evaluate ∫1eln⁡x dx\displaystyle\int_1^e \ln x\,dx.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Find the antiderivative F(x)F(x) of f(x)=xexf(x) = x e^x that satisfies F(0)=0F(0) = 0.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 5

Evaluate ∫1exln⁡x dx\displaystyle\int_1^e x\ln x\,dx. Give an exact answer.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

∫x2cos⁡x dx=\displaystyle\int x^2\cos x\,dx =

Practice 7

Evaluate ∫01arctan⁡x dx\displaystyle\int_0^1 \arctan x\,dx. Give an exact answer.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

The function ff is differentiable, with f(0)=1f(0) = 1, f(2)=5f(2) = 5, and ∫02f(x) dx=3\displaystyle\int_0^2 f(x)\,dx = 3. Find ∫02xf′(x) dx\displaystyle\int_0^2 x f'(x)\,dx.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.