
256 Introduction to Computational Models with Python
17.7 A tr apezoid is a four-sided region with two opposite sides paralle l. The
area of a trapezoid is the average length of the parallel sides, times the
distance between them. The area of the trapezoid with width ∆x =
x
2
− x
1
, is computed with ∆x times the average height (y
2
+ y
1
)/2.
A
t
= ∆x
y
1
+ y
2
2
For the interval of [a, b] on variable x, it is divided into n − 1 equal
segments of length ∆x. Any value of y
k
is defined as y
k
= f (x
k
). The
trapezoid sum to compute the area under the curve for the interval of
[a, b], is defined by the summation of the areas of the individual trape-
zoids and is express e ...