You are on page 1of 1

For a function f on interval [a, b], with midpoint m =

(a + b)/2, using Lagrange Interpolation with these 3 points


(a, f (a))), (b, f (b)), (m, f (m)),

P (x) = f (a) (x−m)(x−b)


(a−m)(a−b) + ... + ...

The integral of a polynomial function is easy to calculate,


Rb b−a
a P (x)dx = 6 [f (a) + 4f ( a+b
2 ) + f (b))]

Suppose the interval [a, b] is divided into n sub-intervals


with length h, with n an even number, we have,

Rb n/2
h
P
a f (x)dx ≈ 3 [f (x2i−2) + 4f (x2i−1) + f (x2i)]
i=1
n/2 n/2−1
= h3 [f (x0) + 4
P P
f (x2i−1) + 2 f (x2i) + f (xn)]
i=1 i=1

You might also like