James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA HL › Topic 5: Calculus › Substitution & parts

Integration by substitution & by parts

The two main techniques for integrals that are not standard: substitution (reversing the chain rule) and integration by parts (reversing the product rule), including changing limits, repeated parts and the cyclic case.

AHL 5.16HL onlyPaper 1Paper 2≈ 90 min to work through
Before you start: standard integrals, including those giving arctan and arcsin. See Integration and areas and Further derivatives.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Integrate by substitution, including a given substitutionAHL 5.16
  • Change the limits in a definite integral after substitutingAHL 5.16
  • Integrate by parts, choosing u and dvdx wellAHL 5.16
  • Use repeated integration by parts, including the cyclic caseAHL 5.16
  • Integrate lnx and inverse trig functions by partsAHL 5.16

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

Each differentiation rule has a reverse. The chain rule reversed is substitution: if the integrand contains a function and (a multiple of) its derivative, a new variable u collapses it to a standard integral. The product rule reversed is integration by parts: it trades an integral you cannot do for one you can.

2.1 Integration by substitution

Choose u (usually the "inside" function), find dudx, replace dx by dudu/dx, and check that every x disappears. Integrate in u, then substitute back.

Worked example 1Paper 1
Find ∫x(x2+1)5dx.
Let u=x2+1, so du=2xdx, i.e. xdx=12du.
The x outside is (half) the derivative of the inside.
∫u5·12du=u612+C
=(x2+1)612+C
Worked example 2Paper 1
Find ∫tanxdx.
∫sinxcosxdx. Let u=cosx, du=−sinxdx.
−∫1udu=−ln|u|+C=−ln|cosx|+C

2.2 Changing the limits

In a definite integral, change the limits to u-values at the same time as you substitute. Then there is no need to substitute back.

Worked example 3Paper 1
Find ∫02xx2+5dx.
u=x2+5, du=2xdx. Limits: x=0⇒u=5; x=2⇒u=9.
12∫59u−1/2du=[u]59
=3−5

2.3 Harder substitutions

Sometimes the substitution is given, or the derivative is not obviously present. Then rewrite everything, including leftover x’s, in terms of u.

Worked example 4Paper 1
Use the substitution u=x−1 to find ∫xx−1dx.
x=u+1, dx=du: ∫(u+1)u1/2du=∫(u3/2+u1/2)du
Express the leftover x in terms of u.
=25u5/2+23u3/2+C=25(x−1)5/2+23(x−1)3/2+C
Worked example 5Paper 1
Use the substitution x=sinθ to find ∫011−x2dx.
dx=cosθdθ; limits θ=0 to π2. 1−sin2θ=cosθ.
∫0π/2cos2θdθ=∫0π/21+cos2θ2dθ
Double angle identity for cos2.
=[θ2+sin2θ4]0π/2=π4
A quarter of the area of a unit circle, as it should be.

2.4 Integration by parts

Integration by parts In formula booklet
∫udvdxdx=uv−∫vdudxdx

Choose u to be the factor that gets simpler when differentiated, and dvdx to be something you can integrate. A useful order of preference for u: Logarithms, Inverse trig, Algebraic (powers of x), Trig, Exponentials (LIATE).

Worked example 6Paper 1
Find ∫xe2xdx.
u=x⇒dudx=1; dvdx=e2x⇒v=12e2x
∫xe2xdx=x2e2x−∫12e2xdx
=x2e2x−14e2x+C
Worked example 7Paper 1
Find ∫lnxdx.
Write as ∫1·lnxdx: u=lnx, dvdx=1⇒v=x.
The hidden factor 1 is the trick: lnx is easy to differentiate but not to integrate.
xlnx−∫x·1xdx=xlnx−x+C

The same "multiply by 1" trick integrates the inverse trig functions: ∫arctanxdx=xarctanx−12ln(1+x2)+C.

2.5 Repeated and cyclic integration by parts

Worked example 8Paper 1
Find ∫x2sinxdx.
u=x2, v=−cosx: −x2cosx+∫2xcosxdx
Parts again with u=2x, v=sinx: ∫2xcosxdx=2xsinx−∫2sinxdx=2xsinx+2cosx
Each application lowers the power of x by one.
−x2cosx+2xsinx+2cosx+C

For ∫exsinxdx, neither factor gets simpler. After two applications the original integral reappears. Call it I and solve for it. This is the hard case in this topic.

Worked example 9Paper 1
Find I=∫exsinxdx.
u=sinx, dvdx=ex: I=exsinx−∫excosxdx
Keep the same choice (trig as u) in both applications, or you undo the first step.
Again with u=cosx: ∫excosxdx=excosx+∫exsinxdx=excosx+I
So I=exsinx−excosx−I
2I=ex(sinx−cosx)⇒I=12ex(sinx−cosx)+C
Worked example 10 (faded)Paper 1
Find ∫1exlnxdx.
u=lnx, v=x22: [x22lnx]1e−∫1ex2dx=e22−[x24]1e= (e² + 1)/4  ← you work this out
Which method?
  • Is it a standard integral, possibly after simplifying or using an identity? Do that first.
  • Is there a function and (a multiple of) its derivative? Substitution.
  • Is it a product of two unrelated types (polynomial × exponential, polynomial × trig, log × anything)? Parts.
  • Rational function with factorising denominator? Partial fractions. Quadratic denominator with no roots? Complete the square and use arctan.
On your TI-Nspire Calculator tricks →

Check any definite integral with Calculus → Numerical integral, e.g. ∫01xe2xdx≈2.097. The CAS-free TI-Nspire cannot give an antiderivative, so indefinite integrals must be checked by differentiating your answer.

3Explore it

The shaded area is ∫abf(x)dx. The dashed curve is the antiderivative F found on this page; the area always equals F(b)−F(a).

4Common mistakes & exam tips

Common mistakes

  • Leaving some x’s in the integral after substituting.
  • Forgetting to change the limits, or changing them and then substituting back as well.
  • Choosing u=ex in ∫xexdx, which makes the integral harder.
  • Sign errors in parts, especially with ∫sinxdx=−cosx.
  • In the cyclic case, switching the choice of u on the second application, which returns I=I.

Exam tips

  • When a substitution is given, follow it: it is usually the only route the markscheme expects.
  • Write u, dudx, dvdx and v in a small box before applying the formula.
  • Differentiate your answer to check an indefinite integral.
  • On Paper 2, check definite integrals numerically on the GDC.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
Find ∫cosxesinxdx.
u=sinx: esinx+C
FluencyP2
Find ∫012xx2+1dx.
[ln(x2+1)]01=ln2
FluencyP3
Find ∫xcosxdx.
xsinx+cosx+C
FluencyP4
Find ∫x2lnxdx.
x33lnx−x39+C
Problem solvingP5
Find ∫arctanxdx.
xarctanx−12ln(1+x2)+C
Problem solvingP6
Use u=ex to find ∫ex1+e2xdx.
∫du1+u2=arctan(ex)+C

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[5 marks]

Find the exact value of ∫01xe2xdx.

attempt at integration by parts with u=xM1
x2e2x−∫12e2xdxA1
[x2e2x−14e2x]01A1
e22−e24+14M1
e2+14A1
Question 2Paper 1[6 marks]

Using the substitution u=1+x, find the exact value of ∫141x(1+x)dx.

dudx=12xA1
∫2uduM1A1
limits u=2 and u=3A1
[2lnu]23M1
2ln32A1
Question 3Paper 1[7 marks]

Let I=∫excosxdx.

  • (a)Show that I=12ex(sinx+cosx)+C.[5]
  • (b)Hence find the exact value of ∫0π/2excosxdx.[2]
(a)
I=excosx+∫exsinxdxM1A1
∫exsinxdx=exsinx−IM1A1
2I=ex(sinx+cosx)A1AG
(b)
12(eπ/2(1+0)−(0+1))M1
eπ/2−12A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
May 2021 · TZ2 · Paper 1Q9Integration using the substitution u=sinx★★
May 2022 · TZ2 · Paper 1Q7Using u=secx to integrate secnxtanx★★★
May 2023 · TZ2 · Paper 1Q12Showing a result by an appropriate substitution★★★
Nov 2025 · TZ1 · Paper 2Q11Integrating arccosx by parts★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake