P4.5 Integration by substitution, by parts and with partial fractions
⤓ Presentation⤓ PowerPointPresentation: opens offline in any browser, simulations live. PowerPoint: editable.
Pure Mathematics 4 (A2), specification sections 6.2 and 6.3. The standard integrals and \(\int\frac{f'(x)}{f(x)}\,dx\) are P3; splitting into partial fractions is the P4 algebra topic.
What this page covers
7 points
- Integration by substitution, including substitutions that are given to you in harder cases
- Changing the limits of a definite integral when you substitute
- Integration by parts, including \(\int\ln x\,dx\) and products with \(\ln x\)
- Using integration by parts twice, keeping control of the signs
- Integrating rational functions by first writing them in partial fractions, including repeated factors and improper fractions
- Recognising which method an integral needs
- Chaining two methods in one longer question
In one minute
6 points
- When no standard result fits, there are three tools: substitution rewrites the integral in a simpler variable, integration by parts trades a product for an easier integral, and partial fractions turn a rational function into terms that integrate to logarithms.
- Substitution: choose \(u=g(x)\), replace \(dx\) using \(\frac{du}{dx}\), and rewrite everything in \(u\) before integrating. Return to \(x\), or, for a definite integral, change the limits to \(u\)-values and never go back.
- By parts: \(\int u\frac{dv}{dx}\,dx=uv-\int v\frac{du}{dx}\,dx\). Let \(u\) be the factor that gets simpler when differentiated, but if there is a \(\ln x\), let \(u=\ln x\).
- \(\ln x\) on its own: write it as \(1\times\ln x\), so \(\int\ln x\,dx=x\ln x-x+c\).
- With \(x^2\) times \(e^x\), \(\sin x\) or \(\cos x\), the first use of parts leaves a power of \(x\); use parts again.
- Partial fractions: each linear term gives \(\frac ka\ln|ax+b|\); a squared factor gives \(-\frac{k}{a(ax+b)}\). Divide first if the fraction is improper.
Contents
13 sections
- How does integration by substitution work?
- What happens to the limits when you substitute?
- How does integration by parts work?
- When do you use integration by parts twice?
- How do partial fractions help you integrate?
- How do you choose the method?
- How do longer integration questions fit together?
- Exam tips
- Common misconceptions
- How this topic connects
- Key formulae
- Check your understanding
- Specification checklist
How does integration by substitution work?
Substitution is the chain rule run backwards. If an integral contains a function \(g(x)\) and also (a multiple of) its derivative, writing \(u=g(x)\) collapses it to an integral in \(u\) that you already know. Even when the derivative is not obviously there, a well-chosen \(u\) can turn an awkward expression, such as a power of \(x-3\) multiplied by \(x\), into a sum of simple powers.
The method has three steps. (1) Choose \(u\) (or use the one given) and differentiate to link \(du\) and \(dx\). (2) Replace every part of the integrand and the \(dx\); if any \(x\) remains, the substitution is not finished. (3) Integrate with respect to \(u\), then substitute back to give the answer in \(x\).
(a) Use the substitution \(u=x-3\) to find \(\int x(x-3)^5\,dx\), giving your answer in the form \(k(x-3)^6(px+q)+c\). (b) Use the substitution \(u=e^x+1\) to find \(\displaystyle\int\frac{e^{2x}}{e^x+1}\,dx\).
(a) \(\frac{du}{dx}=1\), so \(dx=du\), and \(x=u+3\). Then \(\int(u+3)u^5\,du=\int(u^6+3u^5)\,du=\frac{u^7}7+\frac{u^6}2+c\). Back to \(x\) and factorise out \(\frac1{14}(x-3)^6\): \(\frac1{14}(x-3)^6\big[2(x-3)+7\big]=\) \(\frac1{14}(x-3)^6(2x+1)+c\).
(b) \(\frac{du}{dx}=e^x\), so \(e^x\,dx=du\). The numerator \(e^{2x}=e^x\times e^x\) supplies \(du\) with one \(e^x=u-1\) left over. So the integral is \(\int\frac{u-1}{u}\,du=\int\left(1-\frac1u\right)du=u-\ln u+c\). Back to \(x\): \(e^x+1-\ln(e^x+1)+c\), which is \(e^x-\ln(e^x+1)+c\).
In (b) the "+1" has been absorbed into the arbitrary constant, and \(\ln u\) needs no modulus because \(u=e^x+1>0\). Check by differentiating: \(e^x-\frac{e^x}{e^x+1}=\frac{e^{2x}}{e^x+1}\) ✓.
Replacing \((x-3)\) by \(u\) but leaving \(dx\) (or a stray \(x\)) in the integral, then integrating "with respect to \(u\)" anyway. An integral containing both letters cannot be integrated as it stands. Convert everything first.
What happens to the limits when you substitute?
The limits of a definite integral are values of the variable you integrate with respect to. When the variable changes from \(x\) to \(u\), the limits must change too: put each \(x\)-limit into \(u=g(x)\). Then evaluate in \(u\); there is no need to go back to \(x\). Geometrically, the substitution changes the shape of the region but not its area, as the two figures below show.
Use the substitution \(u=2x-1\) to show that \(\displaystyle\int_1^5\frac{x}{\sqrt{2x-1}}\,dx=\frac{16}3\).
\(\frac{du}{dx}=2\), so \(dx=\frac12\,du\), and \(x=\frac{u+1}2\). New limits: \(x=1\Rightarrow u=1\); \(x=5\Rightarrow u=9\).
Rewrite entirely in \(u\): \(\displaystyle\int_1^9\frac{(u+1)/2}{\sqrt u}\times\frac12\,du=\frac14\int_1^9\left(u^{1/2}+u^{-1/2}\right)du\).
Integrate and use the \(u\)-limits: \(\frac14\left[\frac23u^{3/2}+2u^{1/2}\right]_1^9=\frac14\left[(18+6)-\left(\frac23+2\right)\right]=\frac14\times\frac{64}3=\) \(\frac{16}3\) as required.
In harder cases the substitution is given, often in a form such as \(u^2=2x-1\) or \(x=\sin\theta\). Differentiate it as it stands (\(2u\,du=2\,dx\) is quicker than making \(u\) the subject), and in a "show that" write every line: the new limits, the integral in \(u\), and the evaluation.
How does integration by parts work?
Integrating the product rule, \(\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}\), and rearranging gives a formula for integrating a product.
Three rules cover almost every case. A power of \(x\) times \(e^x\), \(\sin\) or \(\cos\): \(u=\) the power of \(x\), because differentiating lowers the power while \(e^x\), \(\sin\) and \(\cos\) are easy to integrate. Anything times \(\ln x\): \(u=\ln x\), because you cannot easily integrate \(\ln x\) but its derivative is \(\frac1x\). And \(\ln x\) on its own: write it as \(1\times\ln x\), with \(u=\ln x\) and \(\frac{dv}{dx}=1\).
Find \(\int x\cos2x\,dx\). Hence find the area between \(y=x\cos2x\) and the \(x\)-axis from \(x=0\) to \(x=\frac\pi4\).
Choose \(u=x\) (differentiates to 1) and \(\frac{dv}{dx}=\cos2x\): \(\frac{du}{dx}=1\), \(v=\frac12\sin2x\). Then \(\int x\cos2x\,dx=\frac12x\sin2x-\int\frac12\sin2x\,dx=\) \(\frac12x\sin2x+\frac14\cos2x+c\).
Area: \(\left[\frac12x\sin2x+\frac14\cos2x\right]_0^{\pi/4}=\left(\frac\pi8+0\right)-\left(0+\frac14\right)=\) \(\frac\pi8-\frac14\approx0.143\).
Choosing \(u=\cos2x\) instead would make \(v=\frac12x^2\): the new integral, of \(\frac12x^2\times(-2\sin2x)\), is harder than the original.
(a) Find \(\int\ln x\,dx\). (b) Hence show that \(\int_1^e\ln x\,dx=1\). (c) Find the exact value of \(\int_1^e x\ln x\,dx\).
(a) Write \(\ln x=1\times\ln x\); \(u=\ln x\), \(\frac{dv}{dx}=1\), so \(\frac{du}{dx}=\frac1x\), \(v=x\). Then \(\int\ln x\,dx=x\ln x-\int x\times\frac1x\,dx=\) \(x\ln x-x+c\).
(b) With \(\ln e=1\) and \(\ln1=0\): \([x\ln x-x]_1^e=(e-e)-(0-1)=1\) as required.
(c) \(u=\ln x\) again, now with \(\frac{dv}{dx}=x\), so \(v=\frac12x^2\): \(\int x\ln x\,dx=\frac12x^2\ln x-\int\frac12x^2\times\frac1x\,dx=\frac12x^2\ln x-\frac14x^2+c\). Evaluate: \(\left(\frac12e^2-\frac14e^2\right)-\left(0-\frac14\right)=\) \(\dfrac{e^2+1}4\).
Choosing \(u=x\) in \(\int x\ln x\,dx\). Then \(\frac{dv}{dx}=\ln x\), and you need \(\int\ln x\,dx\) before you can even start. When \(\ln x\) is present, it is almost always \(u\).
When do you use integration by parts twice?
Each use of parts with \(u=x^n\) lowers the power by one. With \(x^2\) the first application leaves an integral containing \(x\), so parts is needed a second time. Keep careful track of signs: the second application sits inside a minus sign from the first.
Find the exact value of \(\displaystyle\int_0^{\pi/2}x^2\sin x\,dx\).
First application, \(u=x^2\), \(\frac{dv}{dx}=\sin x\), \(v=-\cos x\): \(\int x^2\sin x\,dx=-x^2\cos x+\int2x\cos x\,dx\).
Second application, \(u=2x\), \(\frac{dv}{dx}=\cos x\), \(v=\sin x\): \(\int2x\cos x\,dx=2x\sin x-\int2\sin x\,dx=2x\sin x+2\cos x\).
Combine: \(\int x^2\sin x\,dx=-x^2\cos x+2x\sin x+2\cos x+c\).
Limits, with \(\cos\frac\pi2=0\), \(\sin\frac\pi2=1\), \(\cos0=1\): \((0+\pi+0)-(0+0+2)=\) \(\pi-2\).
Write the second application in brackets: \(-x^2\cos x+\left[2x\sin x-\int2\sin x\,dx\right]\). Most sign slips in repeated parts happen when the brackets are dropped. Then differentiate your final answer as a check; it takes a minute and catches them.
How do partial fractions help you integrate?
A rational function such as \(\frac{5x+4}{(x-1)(x+2)}\) has no standard integral, but its partial fractions do. Split it first (the algebra is on the P4 partial fractions page), then integrate each term.
| Partial fraction | Integral | Why |
|---|---|---|
| \(\frac{k}{ax+b}\) | \(\frac ka\ln|ax+b|+c\) | \(f'/f\) form; divide by \(a\), the derivative of the inside |
| \(\frac{k}{(ax+b)^2}\) | \(-\frac{k}{a(ax+b)}+c\) | a power (\(-2\)) of a linear function, not a logarithm |
| a constant (polynomial) part, \(A\) | \(Ax+c\) | appears when the fraction is improper and you divide first |
With distinct linear factors each term gives a logarithm; combine them with the laws of logarithms when an exact answer "in the form \(\ln k\)" is asked for. A repeated factor \((x+b)^2\) needs both \(\frac{A}{x+b}\) and \(\frac{B}{(x+b)^2}\), and the second integrates to a fraction, not a log. An improper fraction (degree of numerator \(\ge\) degree of denominator) must be divided first: for example \(\frac{x^2+x+1}{x(x+1)}=1+\frac1x-\frac1{x+1}\), so its integral is \(x+\ln|x|-\ln|x+1|+c\).
Show that \(\displaystyle\int_2^4\frac{5x+4}{(x-1)(x+2)}\,dx=\ln k\), stating the exact value of \(k\).
Partial fractions: \(\frac{5x+4}{(x-1)(x+2)}\equiv\frac A{x-1}+\frac B{x+2}\), so \(5x+4\equiv A(x+2)+B(x-1)\). \(x=1\): \(9=3A\Rightarrow A=3\). \(x=-2\): \(-6=-3B\Rightarrow B=2\).
Integrate: \(\displaystyle\int_2^4\left(\frac3{x-1}+\frac2{x+2}\right)dx=\big[3\ln|x-1|+2\ln|x+2|\big]_2^4\).
Evaluate: \((3\ln3+2\ln6)-(3\ln1+2\ln4)=3\ln3+2\ln\frac32\). Combine: \(\ln27+\ln\frac94=\ln\frac{243}4\), so \(k=\frac{243}4\).
Given that \(\frac{x+5}{(x+1)^2(x+3)}\equiv\frac A{x+1}+\frac B{(x+1)^2}+\frac C{x+3}\), find \(A\), \(B\) and \(C\), and hence find the exact value of \(\displaystyle\int_0^1\frac{x+5}{(x+1)^2(x+3)}\,dx\).
\(x+5\equiv A(x+1)(x+3)+B(x+3)+C(x+1)^2\). \(x=-1\): \(4=2B\Rightarrow B=2\). \(x=-3\): \(2=4C\Rightarrow C=\frac12\). Compare \(x^2\): \(0=A+C\Rightarrow A=-\frac12\).
Integrate term by term; the middle term is a power, not a log: \(\left[-\frac12\ln(x+1)-\frac2{x+1}+\frac12\ln(x+3)\right]_0^1\).
Evaluate: \(\left(-\frac12\ln2-1+\frac12\ln4\right)-\left(0-2+\frac12\ln3\right)=1+\frac12\ln2-\frac12\ln3=\) \(1+\frac12\ln\frac23\ (\approx0.797)\).
\(\frac12\ln4=\ln2\), which is how \(-\frac12\ln2+\frac12\ln4\) becomes \(+\frac12\ln2\). Equivalent exact forms, such as \(1-\frac12\ln1.5\), are equally correct.
Integrating \(\frac2{(x+1)^2}\) as \(2\ln(x+1)^2\). The derivative of \((x+1)^2\) is not on the top, so this is not an \(f'/f\) integral. Write it as \(2(x+1)^{-2}\) and use the power rule: \(-2(x+1)^{-1}\).
How do you choose the method?
Before anything else, look for a standard integral or a "recognition" integral (\(f'/f\), or a function times its inside's derivative), which can be written down in one line. Then ask what kind of integrand you have.
| Integrand | What to notice | Method | Result |
|---|---|---|---|
| \(xe^{x^2}\) | \(x\) is (half) the derivative of \(x^2\) | recognition (or \(u=x^2\)) | \(\frac12e^{x^2}+c\) |
| \(\sin x\cos^4x\) | \(\sin x\) is (minus) the derivative of \(\cos x\) | recognition (or \(u=\cos x\)) | \(-\frac15\cos^5x+c\) |
| \(\frac{2x+3}{x^2+3x}\) | numerator is the derivative of the denominator | \(f'/f\) | \(\ln|x^2+3x|+c\) |
| \(\frac3{x^2+3x}\) | constant over a quadratic that factorises | partial fractions | \(\ln|x|-\ln|x+3|+c\) |
| \(xe^x\) | product of unrelated functions | parts, \(u=x\) | \((x-1)e^x+c\) |
| \(x^2\ln x\) | product including \(\ln x\) | parts, \(u=\ln x\) | \(\frac13x^3\ln x-\frac19x^3+c\) |
| \(\frac{x}{\sqrt{x+1}}\) | a root of a linear expression | substitution \(u=x+1\) (or \(u^2=x+1\)) | \(\frac23(x+1)^{3/2}-2(x+1)^{1/2}+c\) |
When the question names a method ("use integration by parts", "use the substitution …"), use it: a different method does not answer the question that was set. When it does not, any valid method is fine; pick the one with the fewest steps.
How do longer integration questions fit together?
Longer questions often chain two techniques: a substitution turns the integrand into a rational function of \(u\), which then needs partial fractions. Keep each stage on its own lines (limits, the \(u\)-integral, the partial fractions, the evaluation) so that each can be followed.
\(I=\displaystyle\int_0^{\ln2}\frac{6e^x}{(e^x+1)(e^x+4)}\,dx\). (a) Use the substitution \(u=e^x\) to show that \(I=\displaystyle\int_1^2\frac6{(u+1)(u+4)}\,du\). (b) Express \(\frac6{(u+1)(u+4)}\) in partial fractions. (c) Hence show that \(I=\ln\frac{25}{16}\).
(a) \(\frac{du}{dx}=e^x\), so \(e^x\,dx=du\). Limits: \(x=0\Rightarrow u=1\); \(x=\ln2\Rightarrow u=2\). So \(I=\int_1^2\frac6{(u+1)(u+4)}\,du\) as required.
(b) \(6\equiv A(u+4)+B(u+1)\). \(u=-1\): \(6=3A\Rightarrow A=2\). \(u=-4\): \(6=-3B\Rightarrow B=-2\). So \(\dfrac2{u+1}-\dfrac2{u+4}\).
(c) \(\big[2\ln(u+1)-2\ln(u+4)\big]_1^2=(2\ln3-2\ln6)-(2\ln2-2\ln5)=2\ln\frac{3\times5}{6\times2}=2\ln\frac54=\) \(\ln\frac{25}{16}\ (\approx0.446)\).
Changing the variable but keeping the \(x\)-limits 0 and \(\ln2\) in the \(u\)-integral. The limits must be \(u\)-values; with 0 and \(\ln2\) the value obtained is wrong, and nothing in the later working will reveal it.
Exam tips for P4.5
Every indefinite integral on this page can be checked by differentiating your answer. For a "find" question with no limits this is the fastest way to catch a sign or a missing factor.
In "show that … \(=\ln k\)" or "show that \(I=\int\dots du\)", the answer is given, so the working is what counts: the differential link, the new limits, each log term with its limits substituted, and the laws of logarithms used to combine them.
Keep \(\ln3\), \(\pi\), \(e^2\) and fractions as they are. "In the form \(\ln k\)" needs a single logarithm; "\(a+\ln b\)" needs the rational part separated. Give a decimal only if one is asked for, and then as well as the exact value.
In integration by parts, \(u\) should get simpler when differentiated and \(\frac{dv}{dx}\) must be something you can integrate. If the new integral looks harder than the old one, swap the choice at once.
Linear factors give logarithms; a squared factor gives a fraction; numerator degree \(\ge\) denominator degree means divide first. Decide which case you are in before you write the partial fractions.
Common misconceptions
| Misconception | Why it is wrong | Correct idea |
|---|---|---|
| After substituting \(u=g(x)\), \(dx\) can simply be replaced by \(du\). | \(du=g'(x)\,dx\); the factor \(g'(x)\) matters unless it equals 1. | Find \(\frac{du}{dx}\) and replace \(dx\) properly. |
| The limits stay the same when you substitute. | Limits are values of the variable of integration. | Convert each limit with \(u=g(x)\), or substitute back to \(x\) before using the old limits. |
| \(\int u\,dv=uv+\int v\,du\). | The product rule puts both terms on the same side; rearranging gives a minus. | \(uv-\int v\frac{du}{dx}\,dx\). |
| \(\int\ln x\,dx=\frac1x\). | That is the derivative of \(\ln x\), not its integral. | Parts with \(1\times\ln x\): \(x\ln x-x+c\). |
| \(\int\frac1{2x+1}\,dx=\ln|2x+1|+c\). | Differentiating \(\ln|2x+1|\) gives \(\frac2{2x+1}\). | Divide by the coefficient of \(x\): \(\frac12\ln|2x+1|+c\). |
| Every partial fraction integrates to a logarithm. | A term over \((x+b)^2\) is a power of a linear function. | \(\int k(x+b)^{-2}\,dx=-\frac k{x+b}+c\). |
How this topic connects
P3.7 Integration of standard functions and P3.6 differentiation
Every technique here ends in a standard result from P3: \(e^x\), \(\frac1x\), \(\sin\), \(\cos\), \(f(ax+b)\) and \(f'/f\). Substitution is the chain rule reversed; parts is the product rule reversed.
P4.1 Partial fractions, P4.6 Volumes of revolution, P4.7 Differential equations
The algebra of splitting fractions comes first; areas, volumes of revolution and separable differential equations then need exactly these integrals, often as the second half of a longer question. Partial fractions are also used to expand rational functions as binomial series.
Mechanics and physics
Work done by a variable force, and displacement from a variable acceleration, lead to integrals such as \(\int te^{-kt}\,dt\), which need integration by parts; exponential decay and capacitor discharge give similar integrals.
Key formulae
| Formula | Use | In the formulae list? |
|---|---|---|
| \(\int f(g(x))\,g'(x)\,dx=\int f(u)\,du\), \(u=g(x)\) | integration by substitution | No — learn it |
| \(\int_a^b\dots dx=\int_{g(a)}^{g(b)}\dots du\) | changing the limits for \(u=g(x)\) | No — learn it |
| \(\int u\frac{dv}{dx}\,dx=uv-\int v\frac{du}{dx}\,dx\) | integration by parts | Yes |
| \(\int\ln x\,dx=x\ln x-x+c\) | integrating \(\ln x\) (parts with \(1\times\ln x\)) | No — derive it |
| \(\int\frac k{ax+b}\,dx=\frac ka\ln|ax+b|+c\) | integrating a linear partial fraction | No — learn it |
| \(\int\frac k{(ax+b)^2}\,dx=-\frac k{a(ax+b)}+c\) | integrating a repeated-factor partial fraction | No — derive it |
| \(\int\frac{f'(x)}{f(x)}\,dx=\ln|f(x)|+c\) | recognising a log integral before choosing a method | No — learn it |
Check your understanding
1. Find \(\int xe^{-x}\,dx\).
Parts with \(u=x\), \(v=-e^{-x}\): \(-xe^{-x}+\int e^{-x}\,dx=-xe^{-x}-e^{-x}+c=-(x+1)e^{-x}+c\).
2. Use the substitution \(u=1+x^2\) to find \(\displaystyle\int_0^1\frac{x}{(1+x^2)^2}\,dx\).
\(du=2x\,dx\); limits 1 and 2. \(\int_1^2\frac1{2u^2}\,du=\frac12\left[-\frac1u\right]_1^2=\frac12\left(-\frac12+1\right)=\frac14\).
3. Which method would you use for \(\int\frac1{x^2-1}\,dx\), and what is the result?
Partial fractions: \(\frac1{x^2-1}=\frac{1/2}{x-1}-\frac{1/2}{x+1}\), so the integral is \(\frac12\ln|x-1|-\frac12\ln|x+1|+c=\frac12\ln\left|\frac{x-1}{x+1}\right|+c\).
4. In \(\int x\ln x\,dx\), why is \(u=\ln x\) the right choice rather than \(u=x\)?
With \(u=x\) you would need \(v=\int\ln x\,dx\), itself a parts integral. With \(u=\ln x\), \(\frac{du}{dx}=\frac1x\) cancels against \(v=\frac12x^2\), leaving the easy \(\int\frac12x\,dx\).
5. Find the exact value of \(\int_1^2\ln x\,dx\).
\([x\ln x-x]_1^2=(2\ln2-2)-(0-1)=2\ln2-1\).
6. Find \(\int\frac{x^2+x+1}{x(x+1)}\,dx\).
The fraction is improper, so divide first: \(\frac{x^2+x+1}{x(x+1)}=1+\frac1{x(x+1)}=1+\frac1x-\frac1{x+1}\). The integral is \(x+\ln|x|-\ln|x+1|+c\).
Specification checklist
- (P4 6.2) I can integrate by substitution, replacing every part of the integrand and the \(dx\), and return the answer in terms of \(x\).
- (P4 6.2) I can use a substitution that is given to me, including ones such as \(u^2=ax+b\), \(u=e^x+k\) or \(x=\sin\theta\), and change the limits of a definite integral to the new variable.
- (P4 6.2) I can integrate by parts, choosing \(u\) and \(\frac{dv}{dx}\) sensibly, including \(\int\ln x\,dx\) and products involving \(\ln x\).
- (P4 6.2) I can apply integration by parts twice, keeping track of the signs, and evaluate definite integrals exactly.
- (P4 6.3) I can integrate rational functions by first expressing them in partial fractions, including denominators with a repeated linear factor and improper fractions, and combine logarithms into an exact single form.
- (P4 6.2, 6.3) I can recognise which method an integral needs (a standard result, \(f'/f\), substitution, parts or partial fractions) and combine methods in a longer question.