In this guide
← Maths AI guides

Calculus · AI SL & HL

Trapezoidal rule and numerical integration

Approximate accumulated quantities from a curve or a table, derive trapezoidal weights and assess units and numerical error.

Course focus: AI SL & HL · First-assessment-2021 course. The sections distinguish the mathematical idea, the calculation and its interpretation.

Before you start: Graph coordinates, trapezium area and definite-integral notation.

Start with a small example

Build it from the beginning

When you know only a table of values, approximate the curve between adjacent points by straight lines. The area under each line segment is a trapezoid. Add these local areas; unequal spacings require separate widths.

A first walkthrough

Estimate the integral from x=0 to 2 using values y=1,3,5 at x=0,1,2.

  1. The first trapezoid has width 1 and parallel sides 1 and 3, so area 2.
  2. The second has area \(1(3+5)/2=4\).
  3. The total estimate is 6. It is exact here because the three points lie on a straight line.
Try the practice ladder after learning the methods ↓

The foundations behind the method

Understand what the symbols mean

Numerical integration turns an accumulation problem into a sum of local estimates. The trapezoidal rule replaces the changing rate between each pair of readings by a straight line. Its geometry explains the weighting and exposes what information is assumed between observations.

How the ideas connect

A rate graph and its accumulated quantity have different units and different interpretations. Curvature explains the bias of a chord approximation for a smooth known function, while measurement quality explains uncertainty in a table. Smaller geometric intervals cannot remove an instrument’s systematic error or a wrong model of the rate.

01

Start with the idea

Build your understanding

Local assumption

The rule uses a straight segment between neighbouring values; it does not know how the true rate varies between readings.

Endpoint weighting

Interior readings belong to two trapezia, which is why they receive double weight in the common bracket.

Compare the approaches

Choose by the information in the question, rather than the formula you recognise first.

Table trapezoids

When it helpsUse when readings or a requested interval count define the approximation.

Check before using itCheck spacing; irregular observations require separate widths.

Formula quadrature

When it helpsUse technology for a supplied integrand when an arbitrary numerical approximation is requested.

Check before using itA built-in integral may not use the trapezoidal method the question specifically asks for.

Your method plan

  1. Define the accumulated quantity and distinguish signed from absolute contributions.
  2. Choose interval widths and apply the appropriate trapezoid sum.
  3. State approximation, units and any error-direction or measurement limitation.
02

Learn the methods

Learn step by step

1. Accumulation from limited information

A definite integral accumulates a rate across an interval. Sometimes only a table of readings is available, or an elementary antiderivative is inconvenient. Numerical integration approximates the curve by simpler shapes. A signed integral and a positive geometric area remain different: negative readings contribute negatively unless the required quantity uses absolute values. State what is accumulating and its units before summing heights.

2. Replace each section by a straight chord

Join adjacent graph or table points by straight segments. A trapezium between two readings has width times their average height. Add those trapezia to approximate the integral. This treats the rate as changing linearly between observations, which is an assumption when the observations are sparse. The plotted shape is an approximation to the underlying function, not a claim that the real process has straight corners at each reading.

Straight chords approximate the curved boundary

01201234xy
  • Actual curve: y = x²
  • Straight chords
Two trapezia approximate y=x² on [0,2] using values 0,1,4. Their total is 3, above the exact integral 8/3 because the convex curve lies below each chord.

3. Equal spacing creates repeated interior weights

With equal spacing h, each interior reading belongs to two adjacent trapezia while each endpoint belongs to one. Combining their contributions gives half-weight endpoints and full-weight interior values. Count n intervals and n+1 readings. Do not multiply by the number of readings to find the total interval width. If spacing is unequal, calculate each trapezium with its own width rather than forcing one common h.

Equal-width trapezoids

Why this formula works

Each local trapezium contributes half its width times the sum of its endpoint heights. An interior reading appears once as a right endpoint and once as a left endpoint, giving twice the endpoint weighting in the combined bracket. The n subintervals require n plus one readings.

The formula

\(T_n=\frac h2\left[y_0+2\sum_{i=1}^{n-1}y_i+y_n\right]\) \(h=(b-a)/n\).

Quick example

For x=0,1,2 and y=0,1,4, h=1 gives \(T=\tfrac12[0+2(1)+4]=3\).

Unequal-width form

Why this formula works

Each individual trapezium uses the separation of its own x coordinates. Adding those local areas works without an equal-spacing assumption. Equal widths allow the sum to simplify into the familiar endpoint and interior weighting, but the general expression is the safe setup for irregular observational times.

The formula

\(T=\sum_i\frac{x_{i+1}-x_i}{2}(y_i+y_{i+1})\).

Quick example

For times 0,1,3 and rates 2,4,6, the estimate is \(1(2+4)/2+2(4+6)/2=13\).

Worked example: An irregular rate table

Times in seconds are 0,1,3, and rates in litres per second are 2,4,6. Estimate volume added.

  1. The two widths are 1 and 2 seconds; a single h does not fit.
  2. First contribution is 3 litres and second is 10 litres.
  3. The total is approximately 13 litres.
  4. The estimate assumes linear rate change between measurements. A numerical value alone does not establish that the real flow followed those chords.

4. Curvature controls systematic direction

For a convex-up function, a straight chord lies above the curve, so trapezoids overestimate the signed integral on that segment; for concave-down they underestimate. If curvature changes, errors can partly cancel or vary in direction. More, narrower intervals often improve a sufficiently smooth-function approximation, but measurement noise and fixed tabular data impose limits. Do not claim a universal improvement for arbitrary noisy readings or unchanged endpoints without checking the situation.

Worked example: Approximate a known curve

Approximate \(\int_0^2x^2\,dx\) with two equal trapezia.

  1. Use h=1 and values 0,1,4.
  2. The rule gives \(T=3\).
  3. The exact integral is \(8/3\), so the estimate is above it by \(1/3\).
  4. The graph is convex upward; straight chords lie above the curve, explaining the overestimate.

5. Use the table or calculator precisely

Enter x coordinates and outputs in paired order. Inspect whether time intervals are equal. A numerical integration function for a supplied formula can use a different quadrature method from the trapezoidal rule; do not substitute that value when the task specifically asks for trapezoids. State your rule, spacing and input values so the calculation is reproducible. Keep precision through the sum and compare against an exact result when one is available.

6. Interpret the result and its units

Height units multiplied by horizontal units give the accumulated quantity: metres per second integrated over seconds gives metres. A negative signed contribution is not automatically an error. For total distance, split at velocity zeros or integrate speed. For a physical quantity defined only over a stated interval, do not extrapolate unobserved table sections. Report the result as an approximation, with rounding that reflects the input measurements and the requested precision.

Quick formula reference

For revision once you understand the methods above. Check the conditions before using a formula.

Equal-width trapezoids

\(T_n=\frac h2\left[y_0+2\sum_{i=1}^{n-1}y_i+y_n\right]\), \(h=(b-a)/n\).

Return to the explanation →

Unequal-width form

\(T=\sum_i\frac{x_{i+1}-x_i}{2}(y_i+y_{i+1})\).

Return to the explanation →

Learn to diagnose an error

Spot the mistake

The statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.

Incorrect reasoning

A table with five readings has five trapezia.

Explain and repair the mistake

Five consecutive readings define four intervals. The first and last heights are used once and each interior height twice in the equal-spacing sum. Count the gaps between readings before calculating h or applying the weights.

03

Connect and apply

Put the ideas together

A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.

Worked application

More intervals on a convex curve

Use four trapezia for y=x² on [0,2] and compare with the two-trapezium result.

  1. The step is 0.5; readings are 0,0.25,1,2.25,4.
  2. The estimate is \(0.25[0+2(0.25+1+2.25)+4]=2.75\).
  3. The exact value is \(8/3\), so the error is \(1/12\), smaller than the earlier \(1/3\).
  4. The chord approximation improves for this smooth convex example. It remains an overestimate and is not an exact identity.
Pause and explain

Would the rule be exact for every straight-line function?

Check your reasoning

Yes, because each chord coincides with the function on its subinterval. The trapezoidal construction then uses the exact local region, including signed contributions where applicable.

Common mistakes and how to avoid them

  • Five consecutive readings define four intervals. The first and last heights are used once and each interior height twice in the equal-spacing sum. Count the gaps between readings before calculating h or applying the weights.
  • Check spacing; irregular observations require separate widths.
  • A built-in integral may not use the trapezoidal method the question specifically asks for.
04

Practise independently

Build confidence, then apply it

Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.

  1. 1

    Build confidence

    Estimate using y=0,1,4 at x=0,1,2.

    Need a starting point?

    Apply the same two-trapezoid calculation.

    Show the worked solution
    1. Areas are 0.5 and 2.5.
    2. The estimate is 3; do not claim it is exact for the curved function \(y=x^2\).
  2. 2

    Apply and explain

    Use points (0,2), (1,4), (3,8). Find the estimate.

    Need a starting point?

    The widths are 1 and 2, so do not use one common width.

    Show the worked solution
    1. Areas are \(1(2+4)/2=3\) and \(2(4+8)/2=12\).
    2. The total is 15.
  3. 3

    Check your understanding

    Why is the trapezoidal rule exact for a straight-line function?

    Show the worked solution

    Each chord between sample points coincides with the function itself, so the local trapezium gives the exact signed integral. Curved functions generally leave an approximation error.

  4. 4

    Use the method

    For readings at x=0,1,2 with outputs 1,2,5, find the trapezoidal estimate.

    Show the worked solution

    \(T=\tfrac12[1+2(2)+5]=5\). There are two intervals, not three. The result approximates a signed integral unless the stated quantity requires a positive-area interpretation.

Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.

Using these methods in exam questions

AI Paper 1

GDC required

Short-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.

AI Paper 2

GDC required

Extended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.

For this topic: Distinguish a function value from a derivative value. For a tangent give both the point and slope; for an integral show the integrand and limits, then interpret the sign and units.

HL only · GDC required

Paper 3: build a connected argument

Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.

  1. Identify what the first part establishes and record the conditions under which it holds.
  2. When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
  3. Check the conclusion against an earlier numerical case and explain its meaning or limitation.

For the first-assessment-2021 courses. IB assessment reference ↗

Find a specific method or formula

Now practise the method

If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.

Practise this subtopic →

Want a broader practice session? Explore IB Maths AI SL practice questions →Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →

Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.