Unit 17 · Computational Methods OR Mechanics · 29 min read
Appendix: Retained Examinable Topics
What the syllabus asks for 3
- Elementary Group Theory: binary operation, group, abelian group, finite and infinite groups
- Rolle's theorem and Mean Value Theorem
- Numerical integration: trapezoidal and Simpson's rule (revision)
This chapter is an appendix, not a timetabled unit. The CDC curriculum of 2078 BS allots it 0 teaching hours, because the topics in it were dropped from the 2078 syllabus grid. They had been part of the 2076 curriculum, and NEB question papers have continued to set questions on them — so a candidate who has never met them can lose marks on the day. Everything here is examinable in practice even though it carries no teaching hours: work through it after you have finished your main units, and treat it as revision plus a small amount of new material.
- Elementary group theory — binary operations, the group axioms, abelian groups, finite and infinite groups. Usually a Group B question asking you to build a Cayley table and verify the four axioms.
- Rolle's theorem and the Mean Value Theorem — the two "verify the theorem for f on [a, b] and find c" questions. Short, standard, and free marks once you know the method.
- Numerical integration — the trapezoidal and Simpson's rules, revised here as the ordinate table you actually write in the exam, with the error bounds.
17.1 Elementary Group Theory: binary operation, group, abelian group, finite and infinite groups
Binary operations
A binary operation * on a non-empty set G is a rule that assigns to every ordered pair (a, b) of elements of G exactly one element a * b of G.
The requirement that a * b lies back in G is called closure: a binary operation is by definition a map G \times G \rightarrow G.
Ordinary addition is a binary operation on \mathbb{N}, but subtraction is not: 3 - 5 = -2 \notin \mathbb{N}. Division is a binary operation on \mathbb{R} \setminus \{0\} but not on \mathbb{R}, because a \div 0 is undefined.
Problem. State, with a reason, whether each is a binary operation on the set shown. (a) a * b = a + b on \mathbb{N} (b) a * b = a - b on \mathbb{N} (c) a * b = ab on \mathbb{Z} (d) a * b = \dfrac{a}{b} on \mathbb{Z}
Solution. (a) Yes. The sum of two natural numbers is a natural number, so * is closed.
(b) No. Take a = 3, b = 5: 3 - 5 = -2, which is not in \mathbb{N}. A single counter-example is enough to destroy closure.
(c) Yes. The product of two integers is an integer.
(d) No. 1 \div 2 = 0.5 \notin \mathbb{Z} (and division by 0 is not defined either).
The group axioms
A non-empty set G with a binary operation * is a group (G, *) if:
- Closure. a * b \in G for all a, b \in G.
- Associativity. (a * b) * c = a * (b * c) for all a, b, c \in G.
- Identity. There is e \in G with e * a = a * e = a for all a \in G.
- Inverse. For each a \in G there is a^{-1} \in G with a * a^{-1} = a^{-1} * a = e.
If in addition a * b = b * a for all a, b \in G, the group is abelian (commutative).
A group with finitely many elements is a finite group, and the number of elements is its order, written o(G) or |G|; otherwise it is an infinite group.
For a finite group, the Cayley table (composition table) lists a * b with a from the left-hand column and b from the top row. Reading it:
- closure — every entry lies in the set;
- identity — some row is a copy of the heading row (and the matching column a copy of the heading column);
- inverses — the identity appears exactly once in every row and column;
- abelian — the table is symmetric about the leading diagonal.
Associativity cannot be read off quickly; quote it from the known associativity of addition, multiplication or composition.
Problem. Show that Z_4 = \{0, 1, 2, 3\} is an abelian group under addition modulo 4, and state its order.
Solution. The Cayley table above is the working. Take the four axioms in turn.
Closure. Every entry of the table is 0, 1, 2 or 3, so Z_4 is closed under +_4.
Associativity. Addition of integers is associative, and reducing modulo 4 does not change this: (a +_4 b) +_4 c and a +_4 (b +_4 c) are both the remainder of a+b+c on division by 4.
Identity. The row headed 0 reads 0, 1, 2, 3 — the heading row — and the column headed 0 likewise. So e = 0.
Inverse. The entry 0 occurs once in each row: 0 +_4 0 = 0, 1 +_4 3 = 0, 2 +_4 2 = 0, 3 +_4 1 = 0. Hence 0^{-1} = 0, 1^{-1} = 3, 2^{-1} = 2, 3^{-1} = 1.
So (Z_4, +_4) is a group. The table is symmetric about the leading diagonal, so it is abelian, and it is finite of order 4.
Problem. Show that G = \{1, -1, i, -i\} is an abelian group under multiplication of complex numbers, and find the inverse of each element.
Solution. Read the table in the figure.
Closure. Every product is again one of 1, -1, i, -i; for instance i \times i = i^2 = -1 and i \times (-i) = -i^2 = 1.
Associativity. Multiplication of complex numbers is associative.
Identity. e = 1, since 1 \times z = z \times 1 = z for each element.
Inverses. The 1s in the table give 1^{-1} = 1, (-1)^{-1} = -1, i^{-1} = -i, (-i)^{-1} = i.
The table is symmetric about the leading diagonal (equivalently, multiplication of complex numbers is commutative), so G is an abelian group of order 4.
Problem. Show that (\mathbb{Z}, +) is an infinite abelian group but (\mathbb{N}, +) is not a group.
Solution. For (\mathbb{Z}, +):
- closure: the sum of two integers is an integer;
- associativity: (a+b)+c = a+(b+c) for integers;
- identity: e = 0, because a + 0 = 0 + a = a;
- inverse: the inverse of a is -a \in \mathbb{Z}, since a + (-a) = 0;
- commutativity: a + b = b + a.
\mathbb{Z} has infinitely many elements, so (\mathbb{Z}, +) is an infinite abelian group.
For (\mathbb{N}, +) the identity 0 is not in \mathbb{N} (and even taking \mathbb{N} to contain 0, the element 3 would need the inverse -3, which is not a natural number). Axiom 4 fails, so (\mathbb{N}, +) is not a group.
Problem. Show that G = \{1, 2, 3, 4\} is a group under multiplication modulo 5, and find the inverse of each element.
Solution. The composition table (computed entry by entry, e.g. 2 \times_5 3 = 6 \equiv 1 modulo 5) is
| \times_5 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 |
| 2 | 2 | 4 | 1 | 3 |
| 3 | 3 | 1 | 4 | 2 |
| 4 | 4 | 3 | 2 | 1 |
Closure. No entry is 0 and every entry lies in G. (This is why 5 must be prime: modulo 6, 2 \times_6 3 = 0 \notin G.)
Associativity. Inherited from multiplication of integers.
Identity. The row and column headed 1 repeat the headings, so e = 1.
Inverses. The identity 1 appears once in each row:
The table is symmetric, so G is an abelian group of order 4.
Problem. Prove that in any group (G, *) the identity element is unique and each element has exactly one inverse.
Solution. Identity. Suppose e and e' are both identities. Treating e as the identity, e * e' = e'. Treating e' as the identity, e * e' = e. Hence e = e'.
Inverse. Suppose b and c are both inverses of a. Then
using in turn the identity axiom, a*c = e, associativity, b*a = e, and the identity axiom again. So b = c.
Problem. Using the table above, show that S_3 is a non-abelian group of order 6, and find (r \circ a)^{-1}.
Solution. Every entry is one of the six symbols, so S_3 is closed; composition of functions is always associative; the row and column headed e repeat the headings, so e is the identity; and e appears once in every row and column, so every element has an inverse. Hence S_3 is a group of order 6.
From the table, r \circ a = c but a \circ r = b, and b \ne c, so
and the group is not abelian. Finally (r \circ a)^{-1} = c^{-1}, and the row for c contains e in the column headed c (that is, c \circ c = e), so (r \circ a)^{-1} = c.
Most lost marks in this topic come from writing "clearly closed" for a set where closure fails. Always check it against the table. And remember that the identity must work on both sides, and must itself belong to the set — this is exactly why (\mathbb{N}, +) and \{1, 2, 3, 4, 5\} under \times_6 are not groups.
17.2 Rolle's theorem and Mean Value Theorem
If f is (i) continuous on the closed interval [a, b], (ii) differentiable on the open interval (a, b), and (iii) f(a) = f(b),
then there exists at least one c \in (a, b) such that
Geometrically: a curve that starts and finishes at the same height, with no break and no corner, must have at least one point where the tangent is horizontal.
If f is continuous on [a, b] and differentiable on (a, b), then there is at least one c \in (a, b) with
Geometrically: somewhere in the interval the tangent is parallel to the chord joining the end points. Rolle's theorem is the special case f(a) = f(b).
Let f satisfy the conditions of the MVT and put
g is continuous on [a, b] and differentiable on (a, b), being the difference of f and a linear function. Also
so g(a) = g(b) and Rolle's theorem applies: there is c \in (a, b) with g'(c) = 0. But
so g'(c) = 0 gives f'(c) = \dfrac{f(b)-f(a)}{b-a}, as required.
Problem. Verify Rolle's theorem for f(x) = x^2 - 4x + 3 on [1, 3] and find the value of c.
Solution. Check the three conditions.
(i) f is a polynomial, so it is continuous on [1, 3]. (ii) f is a polynomial, so it is differentiable on (1, 3). (iii) f(1) = 1 - 4 + 3 = 0 and f(3) = 9 - 12 + 3 = 0, so f(1) = f(3).
All three hold, so Rolle's theorem guarantees a c \in (1, 3) with f'(c) = 0.
Find c. f'(x) = 2x - 4, so
Since 1 < 2 < 3, the value c = 2 lies in the open interval and the theorem is verified.
Problem. Verify Rolle's theorem for f(x) = x^3 - 4x on [-2, 2].
Solution. f is a polynomial, hence continuous on [-2, 2] and differentiable on (-2, 2).
so f(-2) = f(2) and Rolle's theorem applies. Now f'(x) = 3x^2 - 4, so
Both values lie in (-2, 2), so there are two such points. (The theorem promises at least one; it does not say only one.)
Problem. Explain why Rolle's theorem does not apply to (a) f(x) = |x| on [-1, 1], (b) f(x) = \dfrac{1}{x} on [-1, 1].
Solution. (a) f(-1) = f(1) = 1 and f is continuous, but f is not differentiable at x = 0 — the graph has a corner there. Condition (ii) fails, and indeed f'(x) = \pm 1 is never zero.
(b) f is not continuous on [-1, 1]: it is not even defined at x = 0. Condition (i) fails. (f(-1) = -1 and f(1) = 1 are not equal either.)
Problem. Verify the Mean Value Theorem for f(x) = x^2 on [1, 3].
Solution. f is a polynomial, so it is continuous on [1, 3] and differentiable on (1, 3); the MVT applies.
f'(x) = 2x, so f'(c) = 4 gives
The tangent at x = 2 has gradient 4, the same as the chord.
Problem. Verify the Mean Value Theorem for f(x) = \sqrt{x} on [1, 4].
Solution. f is continuous on [1, 4] and differentiable on (1, 4) (the only bad point, x = 0, is outside the interval).
f'(x) = \dfrac{1}{2\sqrt{x}}, so f'(c) = \dfrac13 gives
and 1 < 2.25 < 4, so the theorem is verified.
Problem. Verify the Mean Value Theorem for f(x) = \ln x on [1, e].
Solution. \ln x is continuous on [1, e] and differentiable on (1, e).
f'(x) = \dfrac1x, so
Since 1 < 1.718 < 2.718, the value c = e-1 lies in (1, e).
Check continuity, check differentiability, check f(a) = f(b) (Rolle only), then solve one equation: f'(c) = 0 for Rolle, f'(c) = \frac{f(b)-f(a)}{b-a} for the MVT. Always finish by confirming that your c lies in the open interval (a, b) — that sentence is worth a mark.
17.3 Numerical integration: trapezoidal and Simpson's rule (revision)
Divide [a, b] into n equal strips of width h = \dfrac{b-a}{n} and label the ordinates y_i = f(a + ih) for i = 0, 1, \ldots, n.
Trapezoidal rule (any n) — join the ordinates by straight lines:
Simpson's rule (n even) — join the ordinates in threes by parabolas:
The trapezoidal error falls like h^2; Simpson's falls like h^4, so halving h divides the trapezium error by 4 but Simpson's by 16.
Problem. Evaluate \displaystyle\int_1^2 \frac{dx}{x} by the trapezoidal rule with n = 4, correct to six decimal places, and state a bound for the error. Compare with the exact value \ln 2 = 0.693147.
Solution. h = \dfrac{2-1}{4} = 0.25. Make the ordinate table.
| i | x_i | y_i = 1/x_i | end / odd / even |
|---|---|---|---|
| 0 | 1.00 | 1.000000 | end |
| 1 | 1.25 | 0.800000 | interior |
| 2 | 1.50 | 0.666667 | interior |
| 3 | 1.75 | 0.571429 | interior |
| 4 | 2.00 | 0.500000 | end |
Error bound. f(x) = x^{-1}, so f''(x) = 2x^{-3}, and on [1, 2] this is largest at x = 1: \max|f''| = 2. Hence
Comparison. The actual error is 0.697024 - 0.693147 = 0.003877, comfortably inside the bound, and the estimate is too large — as expected, since 1/x is concave up and the chords lie above the curve.
Problem. Repeat with Simpson's rule, n = 4, and state the error bound.
Solution. The same five ordinates are used, now with the weights 1, 4, 2, 4, 1.
| y_0 | y_1 | y_2 | y_3 | y_4 | |
|---|---|---|---|---|---|
| ordinate | 1.000000 | 0.800000 | 0.666667 | 0.571429 | 0.500000 |
| weight | 1 | 4 | 2 | 4 | 1 |
Error bound. f^{(4)}(x) = 24x^{-5}, largest at x = 1, so \max|f^{(4)}| = 24 and
The actual error is 0.693254 - 0.693147 = 0.000107 — about 36 times smaller than the trapezium error from exactly the same five function values.
Problem. Evaluate \displaystyle\int_0^6 \frac{dx}{1+x} by (a) the trapezoidal rule and (b) Simpson's rule, both with n = 6. The exact value is \ln 7 = 1.945910.
Solution. h = \dfrac{6-0}{6} = 1.
| i | x_i | y_i = 1/(1+x_i) | weight (T) | weight (S) |
|---|---|---|---|---|
| 0 | 0 | 1.000000 | 1 | 1 |
| 1 | 1 | 0.500000 | 2 | 4 |
| 2 | 2 | 0.333333 | 2 | 2 |
| 3 | 3 | 0.250000 | 2 | 4 |
| 4 | 4 | 0.200000 | 2 | 2 |
| 5 | 5 | 0.166667 | 2 | 4 |
| 6 | 6 | 0.142857 | 1 | 1 |
(a) Sum of the five interior ordinates = 0.500000 + 0.333333 + 0.250000 + 0.200000 + 0.166667 = 1.450000.
(b) Odd-numbered ordinates: 0.500000 + 0.250000 + 0.166667 = 0.916667. Even interior ordinates: 0.333333 + 0.200000 = 0.533333.
Errors: 2.021429 - 1.945910 = 0.075519 for the trapezium against 1.958730 - 1.945910 = 0.012820 for Simpson's rule. The strips are wide here (h = 1), so both errors are large, but Simpson's is nearly six times better.
n must be even (an odd number of ordinates), because the ordinates are taken three at a time. With n = 5 Simpson's rule simply does not apply. Also be sure that the 4s go on the odd-numbered ordinates y_1, y_3, y_5, \ldots and the 2s on the even-numbered interior ones.
Chapter summary
- A binary operation on G assigns to each ordered pair (a, b) a unique element a * b of G; the closure requirement is part of the definition.
- (G, *) is a group if it is closed, associative, has an identity e and every element has an inverse; it is abelian if a*b = b*a for all a, b, and the order |G| is the number of elements.
- The Cayley table shows closure (all entries in G), the identity (a row repeating the heading), inverses (one e in each row and column) and the abelian property (symmetry about the leading diagonal).
- Standard examples: (\mathbb{Z}, +) infinite abelian; (Z_4, +_4) and \{1, -1, i, -i\} under \times finite abelian of order 4; (\{1,2,3,4\}, \times_5) abelian of order 4; S_3 non-abelian of order 6.
- In any group the identity and each inverse are unique.
- Rolle's theorem. f continuous on [a,b], differentiable on (a,b) and fa= fb \Rightarrow there is c \in (a,b) with f'c= 0.
- Mean Value Theorem. f continuous on [a,b] and differentiable on (a,b) \Rightarrow there is c \in (a,b) with f'(c) = \dfrac{f(b)-f(a) }{b-a}; it follows from Rolle applied to g(x) = f(x) - f(a) - \frac{f(b) -f(a)}{b-a}(x-a).
- Trapezoidal rule \dfrac{h}{2}[(y_0+y_n) + 2(\text{interior})] with |E_T| \leq \dfrac{(b-a)h^2}{12}\max|f''|; Simpson's rule (n even) \dfrac{h}{3}[(y_0+y_n) + 4(\text{odd}) + 2(\text{even})] with |E_S| \leq \dfrac{(b-a)h^4}{180}\max|f^{(4)}|.
Practice questions
Group A — Multiple choice (1 mark each)
- Which of these is not a binary operation on \mathbb{N}? [1]aa+bbabca-bd\max(a,b)
- The identity element of (Z_4, +_4) is [1]a0b1c2d4
- In the group \{1, -1, i, -i\} under multiplication, the inverse of i is [1]aib-ic1d-1
- A Cayley table symmetric about the leading diagonal shows the group is [1]afinitebinfinitecabeliandnon-abelian
- Rolle's theorem requires, in addition to continuity and differentiability, [1]af(a) = 0bf(a) = f(b)cf'(a) = f'(b)df increasing
- For f(x) = x^2 on [0, 2], the value of c given by the MVT is [1]a0.5b1c1.5d2
- Simpson's rule with n strips requires [1]an oddbn evencn primedany n
Answers to Group A
1. (c) — 3 - 5 = -2 \notin \mathbb{N}, so subtraction is not closed.
2. (a) — 0 +_4 a = a for every a.
3. (b) — i \times (-i) = -i^2 = 1.
4. (c) — symmetry means a*b = b*a for all a, b.
5. (b) — the end values must be equal.
6. (b) — \dfrac{f(2)-f(0)}{2-0} = \dfrac{4}{2} = 2 and f'(c) = 2c = 2 gives c = 1.
7. (b) — the ordinates are taken three at a time, so n must be even.
Group B — Short answer (5 marks each)
- Construct the composition table of Z_4 = \{0,1,2,3\} under addition modulo 4 and hence show that it is an abelian group. State the inverse of each element. [5]
- Show that G = \{1, -1, i, -i\} is a group under multiplication. Is it abelian? State the inverse of each element. [5]
- Verify Rolle's theorem for f(x) = x^2 - 5x + 6 on [2, 3] and find c. [5]
- Verify the Mean Value Theorem for f(x) = x^2 + 2x + 3 on [1, 2] and find c. [5]
- Evaluate \displaystyle\int_1^2 \frac{dx}{x} by the trapezoidal rule with n = 4 and state a bound for the error. [5]
- Use Simpson's rule with n = 6 to evaluate \displaystyle\int_0^6 \frac{dx}{1+x}. [5]
Answers to Group B
1.
| +_4 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 3 |
| 1 | 1 | 2 | 3 | 0 |
| 2 | 2 | 3 | 0 | 1 |
| 3 | 3 | 0 | 1 | 2 |
Closure: every entry is in \{0,1,2,3\}. Associativity: inherited from addition of integers. Identity: the row and column headed 0 repeat the headings, so e = 0. Inverses: 0^{-1} = 0, 1^{-1} = 3, 2^{-1} = 2, 3^{-1} = 1 (each row contains exactly one 0). The table is symmetric about the leading diagonal, so (Z_4, +_4) is an abelian group of order 4.
2.
| \times | 1 | -1 | i | -i |
|---|---|---|---|---|
| 1 | 1 | -1 | i | -i |
| -1 | -1 | 1 | -i | i |
| i | i | -i | -1 | 1 |
| -i | -i | i | 1 | -1 |
Closed (using i^2 = -1); associative, since complex multiplication is associative; identity e = 1; and each row contains one 1, giving 1^{-1} = 1, (-1)^{-1} = -1, i^{-1} = -i, (-i)^{-1} = i. The table is symmetric, so the group is abelian, of order 4.
3. f is a polynomial, hence continuous on [2, 3] and differentiable on (2, 3).
so f(2) = f(3) and Rolle's theorem applies. With f'(x) = 2x - 5,
Rolle's theorem is verified.
4. f is a polynomial, so it is continuous on [1, 2] and differentiable on (1, 2).
f'(x) = 2x + 2, so f'(c) = 5 gives
5. h = 0.25; ordinates y_0 = 1.000000, y_1 = 0.800000, y_2 = 0.666667, y_3 = 0.571429, y_4 = 0.500000.
With f''(x) = 2/x^3 and \max_{[1,2]}|f''| = 2,
(The true value is \ln 2 = 0.693147, so the actual error 0.003877 satisfies the bound.)
6. h = 1; ordinates 1.000000, 0.500000, 0.333333, 0.250000, 0.200000, 0.166667, 0.142857.
Odd ordinates: 0.500000 + 0.250000 + 0.166667 = 0.916667. Even interior: 0.333333 + 0.200000 = 0.533333.
compared with the exact \ln 7 = 1.945910.
Group C — Long answer (8 marks each)
- (a) Define a binary operation, a group, an abelian group, and the order of a finite group. [3](b) Show that G = \{1, 2, 3, 4\} is an abelian group under multiplication modulo 5, giving the composition table and the inverse of each element. Explain why \{1, 2, 3, 4, 5\} under multiplication modulo 6 is not a group. [5]
- (a) State Rolle's theorem and the Mean Value Theorem, and deduce the Mean Value Theorem from Rolle's theorem. [5](b) Verify the Mean Value Theorem for f(x) = x^3 on [0, 1]. [3]
- (a) Derive the trapezoidal rule for n strips from the area of a single trapezium, and write down Simpson's rule with its error bound. [4](b) Using n = 4, evaluate \displaystyle\int_0^1 \frac{dx}{1+x^2} by both rules and hence estimate \pi. [4]
Answers to Group C
1. (a) A binary operation * on a non-empty set G is a rule assigning to each ordered pair (a,b) of elements of G a unique element a*b \in G. A group (G,*) is a set with a binary operation that is closed and associative, has an identity element e with e*a = a*e = a, and in which every a has an inverse a^{-1} with a*a^{-1} = a^{-1}*a = e. It is abelian if a*b = b*a for all a, b \in G. The order of a finite group is the number of its elements.
(b)
| \times_5 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 |
| 2 | 2 | 4 | 1 | 3 |
| 3 | 3 | 1 | 4 | 2 |
| 4 | 4 | 3 | 2 | 1 |
Closure: no entry is 0 and all lie in G. Associativity: inherited from integer multiplication. Identity: e = 1. Inverses: 1^{-1} = 1, 2^{-1} = 3 (since 2 \times 3 = 6 \equiv 1), 3^{-1} = 2, 4^{-1} = 4 (since 16 \equiv 1). The table is symmetric, so G is abelian, of order 4.
For \{1,2,3,4,5\} under \times_6, closure fails: 2 \times_6 3 = 6 \equiv 0, and 0 is not in the set. (Equivalently 2 and 3 are not coprime to 6 and have no inverses.) Since 6 is not prime, the construction breaks down.
2. (a) Rolle's theorem. If f is continuous on [a,b], differentiable on (a,b) and f(a) = f(b), then there is at least one c \in (a,b) with f'(c) = 0.
Mean Value Theorem. If f is continuous on [a,b] and differentiable on (a,b), then there is at least one c \in (a,b) with f'(c) = \dfrac{f(b)-f(a)}{b-a}.
Deduction. Define
Then g is continuous on [a,b] and differentiable on (a,b), being f minus a linear function, and
So g(a) = g(b) and Rolle's theorem gives c \in (a,b) with g'(c) = 0. Since g'(x) = f'(x) - \dfrac{f(b)-f(a)}{b-a}, this says
(b) f(x) = x^3 is a polynomial, so it is continuous on [0,1] and differentiable on (0,1).
f'(x) = 3x^2, so 3c^2 = 1 gives c^2 = \dfrac13 and
taking the positive root because c must lie in (0, 1). The theorem is verified.
3. (a) Divide [a,b] into n strips of width h = \dfrac{b-a}{n} with ordinates y_0, y_1, \ldots, y_n. Replacing the curve over the ith strip by the chord makes that strip a trapezium of parallel sides y_{i-1}, y_i and width h, of area \dfrac{h}{2}(y_{i-1} + y_i). Adding over i = 1, \ldots, n, each interior ordinate appears in two strips and the two end ordinates in one:
Simpson's rule, for n even, replaces each pair of strips by a parabola through three ordinates:
(b) h = 0.25 and f(x) = \dfrac{1}{1+x^2}:
| i | x_i | y_i |
|---|---|---|
| 0 | 0.00 | 1.000000 |
| 1 | 0.25 | 0.941176 |
| 2 | 0.50 | 0.800000 |
| 3 | 0.75 | 0.640000 |
| 4 | 1.00 | 0.500000 |
Trapezoidal. Interior sum = 0.941176 + 0.800000 + 0.640000 = 2.381176.
Simpson. y_1 + y_3 = 1.581176 and y_2 = 0.800000.
Since \displaystyle\int_0^1 \frac{dx}{1+x^2} = \left[\tan^{-1}x\right]_0^1 = \frac{\pi}{4},
Simpson's rule gives \pi correct to four decimal places from the same five ordinates (\pi = 3.141593).
Practise more: Mathematics question bank