From charlesreid1

Read Before You Begin

Before you begin with this worksheet, let's talk about what it will cover.

This worksheet is intended to answer the following questions: How do we evaluate integrals with a computer? When do we evaluate integrals with computers?

Student expectations

You will submit a one-page report that answers each of the questions.

You will need to do some analytical work, and some numerical work. You will need to show your work for both kinds of questions.

If a question asks for a plot or a chart, attach it to your report and refer to it in your answer.

Answer questions with complete sentences.

Problem setup

(Essential information is on handout, but go through it with board/slides/etc)

Numerical integration: background

Equation derivation: referring back to introduction to integrals, rectangle approximations, then through linear and quadratic approximations

Cover each question, cover strategy and writing out before implementing, how to implement in spreadsheet

Spend one day working in computer lab

Worksheet Content

Instructions

The following worksheet will introduce you to numerical integration techniques that can be implemented in a spreadsheet program like Microsoft Excel or Google Sheets.

Read through each section of the worksheet carefully. It contains the information you need to successfully implement Simpson's Rule in a spreadsheet.

You will submit a one-page report that answers each question at the end of the worksheet. Answer each question with complete sentences. This assignment is due in class on (date).

Numerical Integration

Let's start with a review of some numerical integration techniques we learned early on in the course: the left-hand, right-hand, and midpoint rules. These use constants to approximate a function in order to integrate it. We'll then review the Trapezoid Rule and Simpson's Rule, which use lines and quadratics, respectively, to improve the numerical approximation.

In each case, we're interested in approximating the integral of a function,

We can approximate this integral by splitting up the interval into N sub-intervals, build rectangular strips, and compute their area to approximate the integral. The width of each sub-interval is called the step size is related to the number of sub-intervals N and the limits of integration via the formula:

This partitioning, as applied to a function, is shown in the figure on the right. There are N sub-intervals. The behavior of the function between the points depends on the numerical integration technique being used.

SimpsonsRule1.jpg

Left Hand, Right Hand, and Midpoint Rules

The left-hand, right-hand, and midpoint rules approximate the behavior of the function as a constant over the interval . Recall that we covered these when we were first introduced to the topic of integration. The constant function has one unknown parameter (y=c), and therefore requires one function evaluation.

SimpsonsRule2.jpg

SimpsonsRule3.jpg

Trapezoid Rule

The Trapezoid Rule uses a line to approximate the behavior of the function (thus turning the “approximating rectangle” into an “approximating trapezoid”). This has two unknowns and requires the function to be evaluated at two points (see Fig. X). The trapezoid rule approximates the area as:

This formula may also be easier to program as a recurrence relation:

To approximate the total area, simply sum all of the terms.

SimpsonsRule4.jpg

Simpson's Rule

Simpson's Rule uses a polynomial to approximate the behavior of the function between points and better approximate its integral. The approximating polynomial has three coefficients (three unknowns) and requires three function evaluations. Because Simpson's Rule requires the function at three points (two intervals), it operates two intervals at a time, and therefore Simpson's Rule requires an even number of intervals N.

If we consider the simplest case of Simpson's Rule, with only two intervals, the area under the curve can be approximated using the formula:

Combining these expressions for a large number of intervals, we can get a general expression for Simpson's Rule:

Similarly, a recurrence relation that's easier to program is:

To approximate the total area, simply sum all of the terms.

Simpson's Rule fits a polynomial of degree 2 every three data points (two sub-intervals) and approximates the real function with a set of polynomials . Therefore, Simpson's Rule is exact when is a polynomial of degree 2 or less.

SimpsonsRule5.jpg


Worksheet Questions for Calculus 2

On a separate sheet of paper, answer each of the following questions with a complete sentence. Please be considerate of the environment – do not print out your spreadsheets.

Consider the following integral for the questions below:

Question 1

Create a new worksheet using a spreadsheet program. Use it to approximate the value of the integral I using Simpson's Rule with N = 10 subintervals. Report the absolute error in scientific notation. Report the relative error as a percentage.

Question 2

In a new worksheet, approximate the value of the integral I using Simpson's Rule with N = 50 subintervals. Report the absolute error in scientific notation. Report the relative error as a percentage.

Question 3

In a new worksheet, approximate the value of the integral I using Simpson's Rule with N = 100 subintervals. Report the absolute error in scientific notation. Report the relative error as a percentage.

Question 4

We would expect that the error would be a function of the step size , . Determine what the form of the functional relationship is by plotting vs for the cases above. What is the functional form? Some examples to consider:

Extra Credit

Verify, using the substitution , that the indefinite integral is given by:

References

Flags

Link to all worksheets idea list: Worksheets

Calc II:


Calc III: