Simple Integration Example

Lower limit

A = 0

Upper limit

B = 1

Number of subintervals

N = 100

Function to integrate

f x = x 3

Size of each subinterval

h = ( B - A ) N

Starting location of each subinterval

a i = A + i h

Approximation to integral

Integral = h 2 ( f ( a 0 ) + f ( a N ) ) + h i = 1 N - 1 f ( a i )