Trapezoidal Rule calculation for the integral, An, is given by the recurrence relation:
An=An-1+h(yn+yn-1)/2 for n>0 with A0=0 and where h is the sampling interval.