Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics guide, Unit 6, step 23 of 33Previous stepNext step

Step 23: Integration by Parts and Partial Fractions

SyllabusAP BC 6.11–6.13 · 9709 P3 3.5 · IB HL 5.16
In 30 seconds
  • AP students: this whole step is AP BC only (topics 6.11 to 6.13). AP Calculus AB does not test integration by parts, partial fractions or improper integrals. Cambridge 9709 Paper 3 and IB AA HL do test parts and partial fractions.
  • Integration by parts undoes the product rule: \( \int u\,\frac{dv}{dx}\,dx = uv-\int v\,\frac{du}{dx}\,dx \). Choose as \( u \) the factor that gets simpler when you differentiate it.
  • Partial fractions split a fraction such as \( \frac{x + 7}{(x-1)(x + 3)} \) into \( \frac{2}{x-1}-\frac{1}{x + 3} \), and each piece integrates to a logarithm.
  • Exam point: an improper integral is a limit. Replace \( \infty \) (or the bad point) by a letter, integrate, then take the limit in writing. “\( \frac{1}{\infty} = 0 \)” earns no credit.
Video lesson coming soonA short animated lesson for this step will appear here.

Integration by parts: the product rule in reverse

Substitution (Step 22) handles a function of a function, where the derivative of the inside is sitting next to it. Now consider a product of two unrelated functions, such as \( x\cos 3x \) or \( x^2\ln x \). Neither factor is the derivative of anything inside the other, so substitution has nothing to grip. The product rule, run backwards, does.

Exam tipWho needs this step? On AP, everything here is AP BC only: integration by parts (6.11), linear partial fractions (6.12) and improper integrals (6.13). If you are taking AP Calculus AB, you can skip to Step 24. Cambridge 9709 Paper 3 tests integration by parts (3.5) and all three types of partial fraction (3.1, 3.5), but only the simple improper integrals of Paper 1. IB AA HL tests parts (5.16) and integration with partial fractions (5.15).

The product rule says \( \dfrac{d}{dx}(uv) = u\dfrac{dv}{dx} + v\dfrac{du}{dx} \). Integrate both sides with respect to \( x \) and rearrange:

\[ \int u\,\frac{dv}{dx}\,dx = uv-\int v\,\frac{du}{dx}\,dx \]
Key termIntegration by parts: the formula above. For definite integrals, \( \int_a^b u\,v’\,dx = \Big[uv\Big]_a^b-\int_a^b v\,u’\,dx \). You call one factor \( u \) (it will be differentiated) and the other \( \frac{dv}{dx} \) (it will be integrated).

The formula does not finish the integral; it trades it. You give up \( \int u\,v’\,dx \) and take on \( \int v\,u’\,dx \) instead. The trade is worth making when differentiating \( u \) makes it simpler and you can integrate \( v’ \).

Worked example

Find \( \int x\cos 3x\,dx \).

Step 1Let \( u = x \), which becomes 1 when differentiated, and \( \dfrac{dv}{dx} = \cos 3x \). Then \( \dfrac{du}{dx} = 1 \) and \( v = \tfrac13\sin 3x \).
Step 2Apply the formula: \( \int x\cos 3x\,dx = \tfrac13x\sin 3x-\int \tfrac13\sin 3x\,dx \).
Step 3The new integral is easy: \( \int \tfrac13\sin 3x\,dx = -\tfrac19\cos 3x \).

So \( \int x\cos 3x\,dx = \tfrac13x\sin 3x + \tfrac19\cos 3x + C \). Differentiate to check: \( \tfrac13\sin 3x + x\cos 3x-\tfrac13\sin 3x = x\cos 3x \).

Worked example

Find the exact value of \( \int_1^e x^2\ln x\,dx \).

Step 1You cannot easily integrate \( \ln x \), but you can differentiate it. So let \( u = \ln x \) and \( \dfrac{dv}{dx} = x^2 \): \( \dfrac{du}{dx} = \dfrac1x \), \( v = \tfrac13x^3 \).
Step 2\( \displaystyle\int_1^e x^2\ln x\,dx = \Big[\tfrac13x^3\ln x\Big]_1^e-\int_1^e \tfrac13x^2\,dx \).
Step 3The bracket is \( \tfrac13e^3-0 \), since \( \ln e = 1 \) and \( \ln 1 = 0 \). The integral is \( \Big[\tfrac19x^3\Big]_1^e = \tfrac19e^3-\tfrac19 \).
Step 4Subtract: \( \tfrac13e^3-\tfrac19e^3 + \tfrac19 = \tfrac19(2e^3 + 1) \).

The same idea finds \( \int \ln x\,dx \) itself: write it as \( \int 1 \times \ln x\,dx \) with \( u = \ln x \) and \( \frac{dv}{dx} = 1 \), which gives \( x\ln x-x + C \).

Choosing u, repeated parts and the loop

Pick as \( u \) the factor that gets simpler when differentiated, and make sure you can integrate the other one. A handy guide is LIATE: take as \( u \) whichever factor comes first in the list Logarithmic, Inverse trigonometric, Algebraic, Trigonometric, Exponential. Logarithms come first because you can differentiate \( \ln x \) easily but cannot integrate it without parts; exponentials come last because they integrate without any fuss.

Integral\( u \)\( \frac{dv}{dx} \)Why
\( \int x e^{2x}\,dx \)\( x \)\( e^{2x} \)\( x \) drops to 1
\( \int x^3\ln x\,dx \)\( \ln x \)\( x^3 \)\( \ln x \) cannot be integrated directly
\( \int \tan^{-1} x\,dx \)\( \tan^{-1} x \)\( 1 \)its derivative \( \frac{1}{1 + x^2} \) is algebraic
\( \int x^2\sin x\,dx \)\( x^2 \)\( \sin x \)two rounds remove the \( x^2 \)

LIATE is a guide, not a law. What matters is that \( v \) can be found and the new integral is easier than the old one. If the trade makes things worse, swap the roles of \( u \) and \( \frac{dv}{dx} \).

With \( x^2 \) as \( u \), one round of parts lowers the power to \( x \), and a second round removes it. Keep the same type of choice in round two.

Worked example

Find \( \int x^2 e^{3x}\,dx \).

Step 1\( u = x^2 \), \( v = \tfrac13e^{3x} \): \( \int x^2e^{3x}\,dx = \tfrac13x^2e^{3x}-\int \tfrac23x e^{3x}\,dx \).
Step 2Parts again with \( u = \tfrac23x \), \( v = \tfrac13e^{3x} \): \( \int \tfrac23x e^{3x}\,dx = \tfrac29x e^{3x}-\int \tfrac29e^{3x}\,dx = \tfrac29x e^{3x}-\tfrac{2}{27}e^{3x} \).
Step 3Combine, minding the signs: \( \tfrac13x^2e^{3x}-\tfrac29xe^{3x} + \tfrac{2}{27}e^{3x} + C \).

Factorised, the answer is \( \tfrac{1}{27}e^{3x}(9x^2-6x + 2) + C \).

Sometimes neither factor ever simplifies. The derivatives of \( \cos x \) cycle through \( -\sin x \), \( -\cos x \), and so on, and \( e^{2x} \) just stays an exponential. Yet after two rounds the original integral comes back, and you can solve for it as if it were an unknown. Call it \( I = \int e^{2x}\cos x\,dx \). With \( u = e^{2x} \) both times, the first round gives \( I = e^{2x}\sin x-2\int e^{2x}\sin x\,dx \), and the second gives \( \int e^{2x}\sin x\,dx = -e^{2x}\cos x + 2I \). Substituting back, \( I = e^{2x}\sin x + 2e^{2x}\cos x-4I \), so \( 5I = e^{2x}(\sin x + 2\cos x) \) and

\[ \int e^{2x}\cos x\,dx = \tfrac15e^{2x}(\sin x + 2\cos x) + C. \]
Common mistakeDropping the minus sign in front of the second integral, or applying it to only part of it. \( uv-\int v\,u’\,dx \) subtracts the whole new integral, so when that integral itself produces two terms, both change sign (Step 3 of the \( x^2e^{3x} \) example). In the loop, switching your choice of \( u \) in round two just undoes round one and gives the useless \( I = I \).

An economics example: the present value of a growing income. A business expects income at a rate \( R(t) = 50 + 10t \) thousand dollars per year, \( t \) years from now. Money received at time \( t \) is worth \( e^{-rt} \) times as much today, so with a discount rate of 5% the present value of the next 10 years is

\[ PV = \int_0^{10} (50 + 10t)e^{-0.05t}\,dt. \]

This is a polynomial times an exponential, so use parts with \( u = 50 + 10t \) and \( \frac{dv}{dt} = e^{-0.05t} \), giving \( v = -20e^{-0.05t} \). Then the antiderivative is \( -20(50 + 10t)e^{-0.05t} + \int 200e^{-0.05t}\,dt = -e^{-0.05t}(5000 + 200t) \). Evaluating from 0 to 10 gives \( PV = 5000-7000e^{-0.5} \approx 754.3 \), or about $754,000. The income itself totals \( \int_0^{10}(50 + 10t)\,dt = 1000 \), so waiting costs almost a quarter of its value (Figure 1). The same calculation underlies the net present value of any investment project with a continuous income stream.

Income now versus income valued today
income rate R(t) = 50 + 10tdiscounted income rate, R(t) × exp(−0.05t)
12345678910204060801001201401600t (years)$ thousand per yearpresent value ≈ 754lost to waiting ≈ 246
Figure 1. The whole area under R(t) is the undiscounted income, 1000 (thousand dollars). Discounting shrinks later income most, and the teal area, found by parts, is the present value: 5000 − 7000/√e ≈ 754.

Partial fractions

You can add \( \dfrac{2}{x-1}-\dfrac{1}{x + 3} \) to get \( \dfrac{x + 7}{(x-1)(x + 3)} \). For integration you need the reverse. The single fraction matches no rule, but each simple piece integrates to a logarithm. Splitting a fraction in this way is called expressing it in partial fractions.

Denominator (fraction must be proper)Form of the partial fractions
\( (ax + b)(cx + d) \)\( \dfrac{A}{ax + b} + \dfrac{B}{cx + d} \)
\( (ax + b)(cx + d)^2 \)\( \dfrac{A}{ax + b} + \dfrac{B}{cx + d} + \dfrac{C}{(cx + d)^2} \)
\( (ax + b)(x^2 + c^2) \)\( \dfrac{A}{ax + b} + \dfrac{Bx + C}{x^2 + c^2} \)

To find the constants, multiply through by the denominator to get an identity, substitute values of \( x \) that make factors zero, and compare coefficients for anything left over.

Worked example

Express \( \dfrac{x + 7}{(x-1)(x + 3)} \) in partial fractions, and hence find the exact value of \( \displaystyle\int_2^3 \frac{x + 7}{(x-1)(x + 3)}\,dx \).

Step 1Write \( x + 7 \equiv A(x + 3) + B(x-1) \).
Step 2\( x = 1 \): \( 8 = 4A \), so \( A = 2 \). \( x = -3 \): \( 4 = -4B \), so \( B = -1 \).
Step 3Integrate: \( \Big[2\ln|x-1|-\ln|x + 3|\Big]_2^3 = (2\ln 2-\ln 6)-(0-\ln 5) \).
Step 4Combine the logarithms: \( \ln\dfrac{4 \times 5}{6} = \ln\dfrac{10}{3} \).

This is exactly the level of AP BC topic 6.12: two distinct linear factors, then logarithms.

Exam tipFor distinct linear factors there is a shortcut, the cover-up rule. To find \( A \) over \( (x-1) \), cover up \( (x-1) \) in the original fraction and put \( x = 1 \) into what is left: \( \frac{1 + 7}{1 + 3} = 2 \). It works only for non-repeated linear factors. AP BC uses only distinct linear factors; IB HL (1.11) keeps to two distinct linear factors; Cambridge Paper 3 uses all three forms in the table, including the repeated factor and \( x^2 + c^2 \).
Worked example

(Cambridge 9709 Paper 3 level.) Express \( \dfrac{3x^2 + 3x + 3}{(x + 2)(x-1)^2} \) in partial fractions, and hence find the exact value of \( \displaystyle\int_2^4 \frac{3x^2 + 3x + 3}{(x + 2)(x-1)^2}\,dx \).

Step 1\( 3x^2 + 3x + 3 \equiv A(x-1)^2 + B(x + 2)(x-1) + C(x + 2) \).
Step 2\( x = 1 \): \( 9 = 3C \), so \( C = 3 \). \( x = -2 \): \( 9 = 9A \), so \( A = 1 \). Compare \( x^2 \) terms: \( 3 = A + B \), so \( B = 2 \).
Step 3The last term is a power, not a logarithm: \( \int 3(x-1)^{-2}\,dx = -\dfrac{3}{x-1} \). So the antiderivative is \( \ln|x + 2| + 2\ln|x-1|-\dfrac{3}{x-1} \).
Step 4At 4: \( \ln 6 + 2\ln 3-1 \). At 2: \( \ln 4 + 0-3 \). Difference: \( \ln\dfrac{6 \times 9}{4} + 2 = \ln\dfrac{27}{2} + 2 \).

The answer is \( 2 + \ln\tfrac{27}{2} \approx 4.60 \).

Common mistakeLeaving out a term for a repeated factor. Writing \( \frac{A}{x + 2} + \frac{C}{(x-1)^2} \) gives only two unknowns for a degree-2 numerator, and the equations contradict each other. Also check that the fraction is proper first. If the top has degree at least that of the bottom, divide first: for example \( \frac{x^2}{x^2-4} = 1 + \frac{4}{x^2-4} \), and only the second part is split.

Improper integrals

Can a region that stretches forever have a finite area? Sometimes. An improper integral has an infinite interval, or an integrand that is unbounded somewhere in the interval. You do the integral on a safe interval, then take a limit.

\[ \int_a^\infty f(x)\,dx = \lim_{b \to \infty}\int_a^b f(x)\,dx \]
Key termConverges / diverges: an improper integral converges if the limit exists as a finite number, and diverges otherwise. If \( f \) is unbounded near \( x = a \), the definition is \( \int_a^b f(x)\,dx = \lim_{t \to a^+}\int_t^b f(x)\,dx \). The p-integral \( \int_1^\infty \frac{1}{x^p}\,dx \) converges exactly when \( p > 1 \), to \( \frac{1}{p-1} \).
Worked example

Evaluate \( \int_0^\infty x e^{-x}\,dx \).

Step 1Parts with \( u = x \), \( v = -e^{-x} \): \( \int x e^{-x}\,dx = -xe^{-x}-\int(-e^{-x})\,dx = -(x + 1)e^{-x} + C \).
Step 2Replace \( \infty \) by \( b \): \( \int_0^b x e^{-x}\,dx = \Big[-(x + 1)e^{-x}\Big]_0^b = 1-(b + 1)e^{-b} \).
Step 3Take the limit: \( (b + 1)e^{-b} = \dfrac{b + 1}{e^b} \to 0 \) as \( b \to \infty \), because exponentials grow faster than polynomials (L’Hôpital’s rule confirms it).

The integral converges to 1 (Figure 2).

y = xe⁻ˣ: an infinitely long region of area 1
y = xe⁻ˣ
123456789100.10.20.30.40xy(1, 1/e)∫₀ᵇ xe⁻ˣ dx = 1 − (b + 1)e⁻ᵇ → 1
Figure 2. The tail never touches the axis, but e⁻ˣ shrinks so fast that the total area from 0 to ∞ is exactly 1.
Worked example

Evaluate \( \int_0^1 \ln x\,dx \).

Step 1\( \ln x \to -\infty \) as \( x \to 0^+ \), so the integral is improper at 0. Replace 0 by \( t \).
Step 2From the parts result above, \( \int_t^1 \ln x\,dx = \Big[x\ln x-x\Big]_t^1 = -1-t\ln t + t \).
Step 3As \( t \to 0^+ \), \( t\ln t \to 0 \) (L’Hôpital on \( \frac{\ln t}{1/t} \)) and \( t \to 0 \).

The integral converges to \( -1 \). It is negative because \( \ln x < 0 \) on \( (0, 1) \): the region lies below the axis.

Common mistakeMissing an unbounded point inside the interval. “\( \int_{-1}^2 \frac{1}{x^2}\,dx = \Big[-\frac1x\Big]_{-1}^2 = -\frac32 \)” cannot be right: the integrand is positive, so the answer cannot be negative. The function blows up at \( x = 0 \), so split there; \( \int_0^2 \frac{1}{x^2}\,dx \) diverges, so the whole integral diverges. The Fundamental Theorem needs \( f \) continuous on the whole interval.

Improper integrals value things that never end. A perpetual bond, or a plot of land, pays \( R \) dollars a year forever. With continuous discounting at rate \( r \), its value today is \( \int_0^\infty Re^{-rt}\,dt = \lim_{b \to \infty}\frac{R}{r}(1-e^{-rb}) = \frac{R}{r} \). Payments of $6,000 a year at \( r = 0.03 \) are worth \( \frac{6000}{0.03} = \$200{,}000 \). Halve the interest rate and the value doubles, which is why land and long bonds are so sensitive to interest rates.

Practise: 6 questions

Try each one on paper first, then check the worked answer.

EasyQ1. Find \( \int x e^x\,dx \). Show worked answer
\( u = x \), \( \frac{dv}{dx} = e^x \), so \( \frac{du}{dx} = 1 \), \( v = e^x \).
\( \int x e^x\,dx = x e^x-\int e^x\,dx \).
\( = x e^x-e^x + C = (x-1)e^x + C \).
EasyQ2. Express \( \dfrac{5}{(x-2)(x + 3)} \) in partial fractions. Show worked answer
\( 5 \equiv A(x + 3) + B(x-2) \).
\( x = 2 \): \( 5 = 5A \), so \( A = 1 \). \( x = -3 \): \( 5 = -5B \), so \( B = -1 \).
\( \dfrac{5}{(x-2)(x + 3)} = \dfrac{1}{x-2}-\dfrac{1}{x + 3} \).
MediumQ3. Find the exact value of \( \int_0^{\pi/2} x\sin x\,dx \). Show worked answer
\( u = x \), \( v = -\cos x \).
\( \int x\sin x\,dx = -x\cos x + \int \cos x\,dx = -x\cos x + \sin x \).
\( \Big[-x\cos x + \sin x\Big]_0^{\pi/2} = (0 + 1)-(0 + 0) = 1 \).
MediumQ4. Find \( \int \dfrac{4x + 1}{(x + 1)(x-2)}\,dx \). Show worked answer
\( 4x + 1 \equiv A(x-2) + B(x + 1) \).
\( x = -1 \): \( -3 = -3A \), so \( A = 1 \). \( x = 2 \): \( 9 = 3B \), so \( B = 3 \).
\( \int \left(\dfrac{1}{x + 1} + \dfrac{3}{x-2}\right)dx = \ln|x + 1| + 3\ln|x-2| + C \).
MediumQ5. Decide whether each integral converges, and evaluate it if it does: (a) \( \int_1^\infty \dfrac{4}{x^3}\,dx \), (b) \( \int_1^\infty \dfrac{1}{\sqrt{x}}\,dx \). Show worked answer
(a) \( \int_1^b 4x^{-3}\,dx = \Big[-2x^{-2}\Big]_1^b = 2-\dfrac{2}{b^2} \to 2 \) as \( b \to \infty \). Converges to 2.
(b) \( \int_1^b x^{-1/2}\,dx = 2\sqrt{b}-2 \to \infty \). Diverges (a p-integral with \( p = \tfrac12 \le 1 \)).
ExamQ6. (AP BC style, no calculator.) (a) Find \( \int x e^{-2x}\,dx \). [3] (b) Hence evaluate \( \int_0^\infty x e^{-2x}\,dx \), or show that it diverges. Show the limit. [3] (c) Evaluate \( \int_2^\infty \dfrac{1}{x(x-1)}\,dx \), or show that it diverges. [3] Show worked answer
(a) \( u = x \), \( \frac{dv}{dx} = e^{-2x} \): \( \frac{du}{dx} = 1 \), \( v = -\tfrac12e^{-2x} \). [M1]
\( \int x e^{-2x}\,dx = -\tfrac12xe^{-2x} + \tfrac12\int e^{-2x}\,dx \). [A1]
\( = -\tfrac12xe^{-2x}-\tfrac14e^{-2x} + C = -\tfrac14(2x + 1)e^{-2x} + C \). [A1]
(b) \( \displaystyle\int_0^\infty x e^{-2x}\,dx = \lim_{b \to \infty}\Big[-\tfrac14(2x + 1)e^{-2x}\Big]_0^b \). [M1]
\( = \lim_{b \to \infty}\left(\tfrac14-\tfrac14(2b + 1)e^{-2b}\right) \). [A1]
\( (2b + 1)e^{-2b} \to 0 \), so the integral converges to \( \tfrac14 \). [A1]
(c) \( \dfrac{1}{x(x-1)} = \dfrac{1}{x-1}-\dfrac1x \). [B1]
\( \int_2^b = \Big[\ln\left|\tfrac{x-1}{x}\right|\Big]_2^b = \ln\tfrac{b-1}{b}-\ln\tfrac12 \). [M1]
As \( b \to \infty \), \( \ln\frac{b-1}{b} \to \ln 1 = 0 \), so the integral converges to \( \ln 2 \). [A1]
Total: 9 marks.

Check yourself

1. For \( \int x^2\ln x\,dx \), which choice of \( u \) works best?

With \( u = x^2 \) you would need \( v = \int \ln x\,dx \), which itself needs parts. \( u = \ln x \) differentiates to \( \frac1x \), and the new integral is \( \int \frac13x^2\,dx \). The third choice leaves nothing to integrate.

2. What is the correct form of partial fractions for \( \dfrac{2x + 1}{(x + 1)(x-3)^2} \)?

A repeated factor needs one term for each power, \( (x-3) \) and \( (x-3)^2 \). A linear factor always takes a constant on top.

3. What is \( \int_1^\infty \dfrac{1}{x^{1.5}}\,dx \)?

\( p = 1.5 > 1 \), so it converges to \( \frac{1}{p-1} = \frac{1}{0.5} = 2 \). Directly: \( \Big[-2x^{-1/2}\Big]_1^b = 2-\frac{2}{\sqrt{b}} \to 2 \).

Your score: 0 out of 3

The short version

  • AP: integration by parts, partial fractions and improper integrals are AP BC only. Cambridge P3 and IB HL test parts and partial fractions.
  • Parts: \( \int u\,v’\,dx = uv-\int v\,u’\,dx \). Choose \( u \) to simplify when differentiated (LIATE); repeat for \( x^2 \); loop for \( e^{ax}\sin bx \) or \( e^{ax}\cos bx \).
  • Partial fractions: one term per linear factor, two for a squared factor, \( \frac{Bx + C}{x^2 + c^2} \) for a quadratic factor. Divide first if the fraction is improper.
  • Improper integrals are limits; \( \int_1^\infty x^{-p}\,dx \) converges exactly when \( p > 1 \). Check for blow-ups inside the interval.
  • Economics: \( PV = \int_0^T R(t)e^{-rt}\,dt \), often by parts; a perpetual \( R \) per year is worth \( \frac{R}{r} \).
  • The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 24 of 33Separable Differential Equations and Slope Fields