Trapezoidal Approximation For Functions That Change Signs Over An Interval

approximationcalculus

I'm given the following function and I'm attempting to approximate the integral of this function over the interval [0,1], using trapezoid approximation and the given points on the graph. The points are all equally spaced across the interval by .2 which represents the height of each trapezoid. The problem I am having is understanding for $(x_0, f(x_0))$ to $(x_1, f(x_1))$ and $(x_1, f(x_1))$ to $(x_2, f(x_2))$, how would the trapezoids be drawn and how would their areas be calculated.

Over the interval $[x_0, x_1]$, the function crosses the $x$ axis. If I used right-endpoint $x_1$ to generate the trapezoid, the length of one base would be $f(x_1)$. What would the length of the base be at $f(x_0)$? Would I say that $f(x_0) = 0$ and calculate $.2[0 + f(x_1)]/2$? Or would I just calculate the area as such: $.2[f(x_0) + f(x_1)]/2$ with the understanding that $f(x_0) < 0$?

I'm confused with how to handle situations like this where an interval spans a crossing of an axis and how to do that calculation. Any help is much appreciated.

Best Answer

I've attempted to draw the first of those trapezoids on your graph. As you can see, it's less of a standard trapezoid and more of a double triangle. You will still calculate its area as $\frac{1}{2}(f(x_0) + f(x_1))(x_1 - x_0)$, but as you note $f(x_0)$ is negative, so the area of the left triangle is also contributing a negative value to the area (and whether the total area calculated is positive or negative will depend on which of the triangles is larger).

Graph of the function with the region of the "trapezoid" drawn in red

Related Question