AREA UNDER THE CURVE

Example for trapezoid rule and Simpson's rule


xyarea of trapezoid
0..5
.1.51P1 : .5 * (.5 +.51) * .1 = .0505
.2.54P2 : .5 * (.51+.54) * .1 = .0525
.3.59P3 : .5 * (.54+.59) * .1 = .0565
.4.66P4 : .5 * (.59+.66) * .1 = .0625
.5.75P5 : .5 * (.66+.75) * .1 = .0705
.6.86P6 : .5 * (.75+.86) * .1 = .0805
total……… ……………….. 0.3730

OR

Area = ( .5 * .5 + .51 + .54 + .59 +.66 +.75 + .5 * .86) * 0.1 = 0.373


xyarea of a pair of panels by Simpson rule
0..5
.1.51
.2.54P1 & P2 : (1/3) * ( .5 + 4 * .51 + .54 ) * .1 = .1026667
.3.59
.4.66P3 & P4 : (1/3) * ( .54 + 4 * .59 + .66 ) * .1 = .1186667
.5.75
.6.86P5 & P6 : (1/3) * ( .66 + 4 * .75 + .86 ) * .1 = .1506667
total……… ………………………………… ……. 0.3720001


OR

(1/3)*( .5 + 4 * .51 + 2 * .54 + 4 * .59 + 2 * .66 + 4 * .75 + .86 ) * .1 =

= 0.372