Skip to content
Family Table Math
Auto

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. In AP Calculus it’s a BC-only technique (in IB it’s AA HL), and it shows up on exams 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 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. (e, 1) (1, 0) area = 1 y = ln x 1 2 3 −1 1
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

Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.

All trigonometric functions in this homework use radians. Write your uu and dvdv choices before you integrate, and check every antiderivative by differentiating.

H1. (Foundations) Find ∫xe4x dx\displaystyle\int x e^{4x}\,dx. Check your answer by differentiating.

H2. (Foundations) For x>0x \gt 0, find ∫x3ln⁡x dx\displaystyle\int x^3 \ln x\,dx. Explain why LIATE suggests u=ln⁡xu = \ln x here, even though x3x^3 is the “bigger-looking” factor.

H3. (Core) Find ∫x2cos⁡(2x) dx\displaystyle\int x^2 \cos(2x)\,dx. You may use repeated parts or the tabular method.

H4. (Core) (AP style) No calculator. What is the value of ∫0πxcos⁡x dx\displaystyle\int_0^{\pi} x\cos x\,dx?

  • A) −2-2
  • B) 00
  • C) 22
  • D) π\pi

H5. (Core) Let f(x)=xe−xf(x) = x e^{-x}.

  • (a) Find the exact area of the region under the graph of ff and above the xx-axis from x=0x = 0 to x=3x = 3. Give a decimal to 3 places too.
  • (b) Find the average value of ff on the interval from x=0x = 0 to x=3x = 3, exact and to 3 decimal places.

H6. (Core) (AP style) During a spring thaw, meltwater runs into a storm pond at a rate modelled by r(t)=40ln⁡(t+1)r(t) = 40\ln(t + 1) cubic metres per hour, where tt is in hours and 0≤t≤50 \le t \le 5. (This model is hypothetical.)

  • (a) Write an integral for the total volume of meltwater that enters the pond during these 5 hours.
  • (b) Evaluate it exactly using integration by parts, and give the volume to the nearest tenth of a cubic metre.
  • (c) Find the average rate at which meltwater enters the pond over the 5 hours, with units.

H7. (Challenge) (IB style)

  • (a) Use integration by parts twice to find ∫e−xsin⁡(2x) dx\displaystyle\int e^{-x}\sin(2x)\,dx.
  • (b) Hence show that ∫0πe−xsin⁡(2x) dx=25(1−e−π)\displaystyle\int_0^{\pi} e^{-x}\sin(2x)\,dx = \frac{2}{5}\left(1 - e^{-\pi}\right).

H8. (Challenge) A student finds ∫x2e−x dx\displaystyle\int x^2 e^{-x}\,dx like this:

∫x2e−x dx=−x2e−x+∫2xe−x dxline 1∫2xe−x dx=−2xe−x−∫2e−x dxline 2=−2xe−x+2e−x+Cline 3∫x2e−x dx=−x2e−x−2xe−x+2e−xline 4\begin{aligned} \int x^2 e^{-x}\,dx &= -x^2 e^{-x} + \int 2x e^{-x}\,dx && \text{line 1} \\ \int 2x e^{-x}\,dx &= -2x e^{-x} - \int 2e^{-x}\,dx && \text{line 2} \\ &= -2x e^{-x} + 2e^{-x} + C && \text{line 3} \\ \int x^2 e^{-x}\,dx &= -x^2 e^{-x} - 2x e^{-x} + 2e^{-x} && \text{line 4} \end{aligned}

Answer these:

  • (a) Differentiate the student’s final answer to show that it is wrong.
  • (b) Find the line with the sign error and explain what went wrong.
  • (c) Give the correct antiderivative.
  • (d) What else is wrong with line 4? Where should the constant appear in a clean solution?

H9. (Challenge) Let In=∫xnex dxI_n = \displaystyle\int x^n e^x\,dx for whole numbers n≥1n \ge 1.

  • (a) Use one round of integration by parts to show that In=xnex−nIn−1I_n = x^n e^x - n I_{n-1}.
  • (b) Starting from I0=ex+CI_0 = e^x + C, use the formula to find I3I_3.
  • (c) Evaluate ∫01x3ex dx\displaystyle\int_0^1 x^3 e^x\,dx exactly, and check that your answer is a sensible size.

H10. (Challenge) For each integral, decide whether substitution, integration by parts, or both is the better method. Explain how you decided, then find the integral.

  • (a) ∫xcos⁡(x2)dx\displaystyle\int x\cos\left(x^2\right)dx
  • (b) ∫xcos⁡(3x) dx\displaystyle\int x\cos(3x)\,dx
  • (c) ∫x3ex2 dx\displaystyle\int x^3 e^{x^2}\,dx (Hint: write x3ex2x^3 e^{x^2} as x2⋅xex2x^2 \cdot x e^{x^2}.)