Numerical Integration: F (X) DX C F (X
Numerical Integration: F (X) DX C F (X
∫ f(x) dx ≈ ∑ ci f(xi)
a i=0
• Integration finds the “Area” under
• Trapezoidal rule: a curve, between two points (a and b).
y
• To approximate the area under a curve,
f(b) use a familiar shape whose area we
already know how to calculate easily.
f(a) • In this case, we’ll use a trapezoid shape.
• Area of trapezoid = ½ (b1 + b2) h
base 2 (b1)
x
a b h
base 2 (b2)
Numerical Integration
• Trapezoidal
y
Rule (con’t):
• Area under curve ≈ Area of trapezoid
f(b) under the curve
f(a) • Area of trapezoid = ½ h [ b1 + b2 ]
• Area under curve ≈ ½ (b-a) [ f(a) + f(b) ]
Simplify:
½ ((b-a)/2) [ f(a) + f(x1) + f(x1) + f(b) ]
b x1 x2 b