Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

Numerical Integration

( \newcommand{\kernel}{\mathrm{null}\,}\)

Review of Left and Right Sums

We first encourage you to review left and right sums in class. For more information click here

The Midpoint Approximation

To get a better approximation of , for example,

52x2dx

we could instead use the y-value of the midpoint of each interval as the height. We will use six rectangles.

numint15.gif

Notice that the first midpoint is at 2.25 and each rectangle width

Δx=526=0.5.

The new numbers are as follows:

2.25+0(0.5),2.25+1(0.5),2.25+2(0.5),2.25+3(0.5),2.25+4(0.5),2.25+5(0.5)

so that the y-coordinates are

(2.25+0(0.5))2,(2.25+1(0.5))2,(2.25+2(0.5))2,(2.25+3(0.5))2,(2.25+4(0.5))2,(2.25+5(0.5))2.

We see that the ith rectangle has y-coordinate:

height=(2.25+i(.5))2.

To get the area of the ith rectangle we multiply the height by the base:

(2.25+i(.5))2(.5).

Finally to get the total area we add the terms up:

S(2.25+i(.5))2(.5)=38.9975.

The true solution is 37.66... . The left endpoint approximation would have yielded 33.875 and the right endpoint approximation would have yielded 44.375. We see that for this case, the midpoint approximation yields a closer approximation.

This approximation is called the midpoint approximation and is given in general by:

Definition: The Midpoint Approximation

baf(x)dxbanni=1f(xi1+xi2)=banni=1f(ba2n+bani).

The Trapezoidal Approximation

A fourth method involves the trapezoidal rule which geometrically calculates the area of the trapezoid with base on the x-axis and heights f(xi) and f(x_{i+1}). The area of the trapezoid is

Δx2[f(xi)+f(xi+1)]

or the base times the average of the heights. Adding up all the trapeziods gives:

Definition: The Trapezoidal Approximation

T(n)=ba2n[f(x0)+2f(x1)+2f(x2)+...+2f(xn1)+f(xn)].

We can compare this with the true answer of 7.8475.
1331+x3dx.

Error

The error in approximating an integral can be found by subtracting the true value from the estimated value. The graphs show that the error is directly inked to the concavity of the integrand. Without proof, bounds for the errors using the midpoint and trapezoid approximations are:

|EM|B(ba)324n2

|ET|B(ba)312n2.

Where

B=max|f(x)|.

we are guaranteed to have an error less than 0.001.

Simpson's Estimate

We saw that the Trapezoidal and Midpoint estimates provided better accuracy than the Left and Right endpoint estimates. It turns out that a certain combination of the Trapezoid and Midpoint estimates is even better.

Definition: Simpson's Approximation

Let f(x) be a function defined on [a,b]. Then

S(n)=T(n)3+2M(n)3

where T(n) and M(n) are the Trapezoidal and Midpoint Estimates. S(n) is called Simpson's Estimate for the integral.

Geometrically, if n is an even number then Simpson's Estimate gives the area under the parabolas defined by connecting three adjacent points. Let n be even then using the even subscripted x values for the trapezoidal estimate and the midpoint estimate, gives

S(n)=13[(ba)2n(f(x0)+2f(x2)+...+f(x2n2)+f(x2n))]+23[ban(f(x1)f(x3)+f(x5)+...+f(x2n1))]=ba3n(f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+4f(x5)+...+2f(xn2)+4f(xn1)+f(xn))

Notice the
1 2 4 2 4 ... 2 4 2 4 1
pattern.

=0.3426.
1281xdx.

Error in Simpson's Estimate

Without proof, we state

Let

M=max|f(x)|

and let ES be the error in using Simpson's estimate. Then

|ES|M(ba)5180n4.

Hence, if we choose n=6 we are guaranteed two decimals of accuracy.
with n=5, determine the maximum errors that occur using the midpoint, the trapezoidal, and Simpson's approximation.

Larry Green (Lake Tahoe Community College)


This page titled Numerical Integration is shared under a not declared license and was authored, remixed, and/or curated by Larry Green.

  • Was this article helpful?

Support Center

How can we help?