Mid-ordinate and Simpson's rules

Mid-ordinate and Simpson's rules

Spec J1 · AQA A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Numerical integration splits [a,b][a,b] into nn strips of width h=b−anh=\dfrac{b-a}{n}.
  • Mid-ordinate rule: h[y1/2+y3/2+⋯+yn−1/2]h\left[y_{1/2}+y_{3/2}+\cdots+y_{n-1/2}\right].
  • Simpson's rule (even nn): h3[y0+yn+4(odd)+2(even)]\dfrac h3\left[y_0+y_n+4(\text{odd})+2(\text{even})\right], with coefficients 1,4,2,4,…,4,11,4,2,4,\ldots,4,1.
  • Simpson's rule is exact for cubics.
  • The mid-ordinate rule underestimates when f′′>0f''>0 and overestimates when f′′<0f''<0.

Why numerical integration

Some integrands have no simple antiderivative, so split the interval into strips and add approximate areas.

Many integrands, such as 1+x3\sqrt{1+x^3}, have no simple antiderivative, or only discrete data are known.

Numerical integration approximates ∫abf(x) dx\int_a^bf(x)\,dx by splitting [a,b][a,b] into nn strips of equal width h=b−anh=\frac{b-a}{n} and adding approximate strip areas.

The ordinates are yr=f(a+rh)y_r=f(a+rh) for r=0,1,…,nr=0,1,\ldots,n.

−0.50.511.522.50.511.522.533.5xyy = √(1 + x³)
The area under y = √(1 + x³) from 0 to 2 has no simple exact integral, so we approximate it with strips.
  • Strip widthh=b−anh=\dfrac{b-a}{n}
  • Ordinatesyr=f(a+rh)y_r=f(a+rh) for r=0,1,…,nr=0,1,\ldots,n

You use n=6n=6 strips on [0,3][0,3]. What is hh, and how many ordinates are there?

The mid-ordinate rule

Replace each strip by a rectangle whose height is the function value at the midpoint of the strip.

The mid-ordinate rule replaces each strip by a rectangle whose height is the function value at the midpoint of the strip.

∫abf(x) dx≈h[y1/2+y3/2+⋯+yn−1/2]\int_a^bf(x)\,dx\approx h\left[y_{1/2}+y_{3/2}+\cdots+y_{n-1/2}\right]

Here yr+1/2=f(a+(r+12)h)y_{r+1/2}=f\left(a+(r+\tfrac12)h\right).

0.10.20.30.40.50.60.70.80.911.11.20.20.40.60.81xy0.88890.72730.61540.5333y = 1/(1+x)
Mid-ordinate rule, n = 4: heights are y at the strip midpoints

Worked example

Estimate ∫0111+xdx\int_0^1\frac{1}{1+x}dx using the mid-ordinate rule with n=4n=4.

Using the mid-ordinate rule with n=4n=4 on [0,1][0,1], where is the first ordinate taken?

Simpson's rule

Fit a parabola through each pair of strips, which needs an even number of strips.

Simpson's rule fits a parabola through each pair of strips (three ordinates). For an even number nn of strips:

∫abf(x) dx≈h3[y0+yn+4(y1+y3+⋯+yn−1)+2(y2+y4+⋯+yn−2)]\int_a^bf(x)\,dx\approx\frac{h}{3}\Big[y_0+y_n+4(y_1+y_3+\cdots+y_{n-1})+2(y_2+y_4+\cdots+y_{n-2})\Big]

The two end ordinates have coefficient 1, the odd-numbered ordinates 4, and the even-numbered interior ordinates 2.

0.811.21.41.61.822.22.42.62.833.23.40.20.40.60.811.21.4xy(1, 1)(2, 0.5)(3, 0.33)y = 1/xparabola through 3 points
Simpson fits a parabola (dashed) through three ordinates: here y = 1/x at x = 1, 2, 3.

xx

y0y_0:
0
y1y_1:
0.25
y2y_2:
0.5
y3y_3:
0.75
y4y_4:
1

yy

y0y_0:
1
y1y_1:
0.8
y2y_2:
0.6667
y3y_3:
0.5714
y4y_4:
0.5

Coefficient

y0y_0:
1
y1y_1:
4
y2y_2:
2
y3y_3:
4
y4y_4:
1

Worked example

Estimate ∫0111+xdx\int_0^1\frac{1}{1+x}dx using Simpson's rule with n=4n=4.

Which set of coefficients is correct for Simpson's rule with n=6n=6?

Working from data

Apply the rule directly to equally spaced values, using the data as the midpoints for the mid-ordinate rule.

If only data at equal spacing are given (a river's depth, a velocity at 1 s intervals), apply the rule to the values directly.

Simpson's rule uses the data at the strip boundaries. For the mid-ordinate rule, use wider strips so that the data points lie at the midpoints: values at x=1,3,5x=1,3,5 give three strips of width 2.

Give a unit with the area, and keep full calculator values until the final rounding.

−0.500.511.522.533.544.555.566.50data2data4data6
Data at x = 1, 3, 5 are the midpoints of three strips of width 2, with boundaries at 0, 2, 4 and 6.
  • Data at x=1,3,5x=1,3,5 as midpointsthree strips of width 2, from x=0x=0 to x=6x=6

Data are given at x=1,3,5x=1,3,5 and you use the mid-ordinate rule with these as the midpoints. Over what interval are you integrating?

Accuracy and error

More strips give better accuracy; Simpson's rule is exact for cubics.

Accuracy improves as hh decreases (more strips).

Simpson's rule is exact for cubics (or any polynomial of degree up to 3).

The mid-ordinate rule underestimates when the function is convex (f′′>0f''>0) and overestimates when it is concave (f′′<0f''<0).

Quote an error as a percentage: ∣estimate−exact∣exact×100\frac{|\text{estimate}-\text{exact}|}{\text{exact}}\times100.

02468102468Number of stripsError (%)
  • Mid-ordinate
  • Simpson
Percentage error when estimating the integral of sin x from 0 to π (exact value 2): more strips give smaller errors, and Simpson is far more accurate.
  • Simpson's ruleexact for polynomials up to degree 3
  • Mid-ordinate ruleunder if f′′>0f''>0, over if f′′<0f''<0

Worked example

Show that Simpson's rule with two strips is exact for ∫02x3dx\int_0^2x^3dx.

The mid-ordinate rule is used for ∫01x2dx\int_0^1x^2dx. Is the estimate an over- or underestimate?

Try an exam question

Use Simpson's rule with 4 strips to estimate ∫0211+x2 dx\int_0^2\dfrac{1}{1+x^2}\,dx, giving your answer to 3 decimal places.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

At which values of xx does the mid-ordinate rule with four strips evaluate the function?

1 mark, marked against the mark scheme

Revision notes