AREA UNDER THE CURVE
Example for trapezoid rule and Simpson's rule
x | y | area of trapezoid |
0. | .5 | |
.1 | .51 | P1 : .5 * (.5 +.51) * .1 = .0505 |
.2 | .54 | P2 : .5 * (.51+.54) * .1 = .0525 |
.3 | .59 | P3 : .5 * (.54+.59) * .1 = .0565 |
.4 | .66 | P4 : .5 * (.59+.66) * .1 = .0625 |
.5 | .75 | P5 : .5 * (.66+.75) * .1 = .0705 |
.6 | .86 | P6 : .5 * (.75+.86) * .1 = .0805 |
total | .. 0.3730 |
OR
Area = ( .5 * .5 + .51 + .54 + .59 +.66 +.75 + .5 * .86) * 0.1
= 0.373
x | y | area of a pair of panels by Simpson rule |
0. | .5 | |
.1 | .51 | |
.2 | .54 | P1 & P2 : (1/3) * ( .5 + 4 * .51 + .54 ) * .1 = .1026667 |
.3 | .59 | |
.4 | .66 | P3 & P4 : (1/3) * ( .54 + 4 * .59 + .66 ) * .1 = .1186667 |
.5 | .75 | |
.6 | .86 | P5 & 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