For the function ∫_0^2▒ f(x)=(x-2)^2+2 dx we are going to estimate the area under the curve using the Simpson’s rule where n = 6.
The domain is [a, b] – [0, 2].
We have n = 6 intervals, with n+1 = 7 points with 7 f-values.
(x0, f(x0), (x1, f(x1)), (x2, f(x2)), (x3, f(x3)), (x4, f(x4)), (x5, f(x5)), (x6, f(x6)).
Δ = (b – a) = (2 – 0) = 2
h = Δ/n = Δ/6 = 2/6 = 1/3. (i.e. there are n=6 intervals of length = 1/3)
This gives us,
x0 = 0, x1 = 1/3, x2 = 2/3, x3 = 1, x4 = 4/3, x5 = 5/3, x6 = 2.
Using f(x) = (x – 2)^2 – 2,
f(x0) = 2, f(x1) = 7/9, f(x2) = -2/9, f(x3) = -1, f(x4) = -14/9, f(x5) = -17/9, f(x6) = -2,
Simpson’s rule is,
A ≈ (h/3)(f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) + 4f(x5) + f(x6))
Substituting for h and the various values of f(x),
A ≈ (1/9)(2 + 4(7/9) + 2(-2/9) + 4(-1) + 2(-14/9) + 4(-17/9) + (-2))
A ≈ (1/81)(18 + 4(7) + 2(-2) + 4(-9) + 2(-14) + 4(-17) + (-18))
A ≈ (1/81)(18 + 28 – 4 – 36 – 28 – 68 – 18)
A ≈ (1/81)(-108)
A ≈ -4/3