Numerical integration with the trapezium rule

Numerical integration with the trapezium rule

Spec 9.4 · Edexcel A-Level Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Trapezium rule: ∫aby dx≈h2[y0+yn+2(y1+⋯+yn−1)]\int_a^by\,dx\approx\dfrac h2\left[y_0+y_n+2(y_1+\dots+y_{n-1})\right] with h=b−anh=\dfrac{b-a}{n}.
  • nn strips need n+1n+1 ordinates; the end ordinates appear once, all others are doubled.
  • A convex curve gives an over-estimate; a concave curve gives an under-estimate.
  • For an increasing function, left-hand rectangles give a lower limit and right-hand rectangles an upper limit.
  • More strips give a more accurate estimate.

The trapezium rule

It replaces the curve with straight chords, so each strip is a trapezium.

With nn strips of width h=b−anh=\frac{b-a}{n} and ordinates y0,…,yny_0,\dots,y_n, the trapezium rule estimates the area. There are n+1n+1 ordinates for nn strips.

The formula is in the booklet, but use it correctly: first and last ordinates once, every other ordinate doubled.

hy₀y₁ABCD
One strip is a trapezium: parallel sides y₀ and y₁, width h.
  • ∫aby dx\displaystyle\int_a^b y\,dxh2[y0+yn+2(y1+⋯+yn−1)]\dfrac h2\left[y_0+y_n+2(y_1+\dots+y_{n-1})\right]

How many ordinates are there for 6 strips?

Worked examples

List xx and yy values in a table, then apply the formula with full calculator accuracy.

Keep full values until the end, then round. For ∫01(2x+1) dx\int_0^1(2x+1)\,dx with 44 strips the ordinates are 1,1.5,2,2.5,31,1.5,2,2.5,3, giving 0.252[4+12]=2\frac{0.25}{2}[4+12]=2, exact because the graph is a straight line.

0.20.40.60.811.21.41.61.820.511.522.5xy11.1181.4141.8032.236y = √(x² + 1)
y = √(x² + 1) with the ordinates for 4 strips.

Worked example

Estimate ∫02x2+1 dx\int_0^2\sqrt{x^2+1}\,dx using 44 strips.

Estimate ∫02x2 dx\int_0^2x^2\,dx with 2 strips.

Over-estimate or under-estimate

Convex curves give an over-estimate; concave curves give an under-estimate.

Use a sketch to decide whether the chords lie above or below the curve. A straight line gives the exact value.

State the reason, not just the answer: ‘the curve is convex, so the chords lie above the curve’.

0.511.522.533.50.511.52xy(1, 1)(3, 1/3)y = 1/xchord from (1, 1) to (3, 1/3)
For the convex curve y = 1/x, the chord lies above the curve: over-estimate.

Convex

Gradient:
f′′>0f''>0
Examples:
e.g. 1x\frac1x, ex\mathrm{e}^x
Chords:
Chords above the curve
Estimate:
Over-estimate

Concave

Gradient:
f′′<0f''<0
Examples:
e.g. ln⁡x\ln x, x\sqrt x
Chords:
Chords below the curve
Estimate:
Under-estimate

The trapezium rule is applied to y=ln⁡xy=\ln x. Is the estimate an over- or under-estimate?

Limits the area must lie between

For an increasing function, left-hand rectangles give a lower limit and right-hand rectangles an upper limit.

lower =h(y0+⋯+yn−1)=h(y_0+\dots+y_{n-1}) and upper =h(y1+⋯+yn)=h(y_1+\dots+y_n).

For speeds 0,4.5,7.5,9.0,9.50,4.5,7.5,9.0,9.5 with h=2h=2: lower limit 4242, upper limit 6161, and the trapezium estimate 51.551.5 lies between. For a decreasing function the roles swap.

0102030405060Lower limitTrapeziumUpper limitEstimateArea
Estimates of the area for speeds 0, 4.5, 7.5, 9.0, 9.5 with h = 2.

For a decreasing function, which rectangles give the upper limit?

Accuracy and more strips

More strips give a more accurate estimate; doubling the strips roughly quarters the error.

The rule is used when a function cannot be integrated analytically, or when only data values are given, such as speeds at regular times.

State any assumption: equal strip widths, and that chords approximate the curve well between ordinates.

00.0050.010.0154 strips8 stripsNumber of stripsError
Error in estimating ∫ 1/x dx from 1 to 3 (exact value ln 3 = 1.0986).

The error with 4 strips is 0.0181. Roughly what error do you expect with 8 strips?

Try an exam question

Use the trapezium rule with 44 strips to estimate ∫131x dx\int_1^3\frac1x\,dx to 3 d.p., and state with a reason whether it is an over-estimate or an under-estimate.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Which expression gives the trapezium rule estimate of II?

1 mark, marked against the mark scheme

Revision notes