Lab 3: Integral approximations - part 2


Lab Preparation: Find the first four derivatives of \(\displaystyle f(x) = e^{-x^2}\).
Hint: It will be helpful to factor out \(\displaystyle e^{-x^2}\) in each derivative before taking the next. Do you see why?

 

Lab Instructions: The error for each method of approximating a definite integral \(\displaystyle \int_a^b f(x) dx\) with \(n\) subintervals can be bound using the following formulas:

 

Method

Error Bound

Left-hand or Right-hand Sum

error \(\displaystyle < \frac{(b-a)^2}{2n}\cdot \max|f'(x)|\)

Trapeziod Rule

error \(\displaystyle < \frac{(b-a)^3}{12n^2}\cdot \max|f''(x)|\)

Midpoint Rule

error \(\displaystyle < \frac{(b-a)^3}{24n^2}\cdot \max|f''(x)|\)

Simpson's Rule*

error \(\displaystyle < \frac{(b-a)^5}{2880n^4}\cdot \max|f^{(4)}(x)|\)

The maximum values for these error formulas are computed on the interval \(a<x<b\).

*Note: Using standard nomenclature, the error bound for Simpson's method is \(\displaystyle \frac{(b-a)^5}{180n^4}\cdot \max|f^{(4)}(x)| \)

 

  1. Compute the error bounds for your approximations of \(\displaystyle\int_{-1}^2 2^{-x} dx\) in Lab 2 using \(n=4\) with the formulas above. Show all work needed to obtain the error bounds. Compare the sizes of your actual errors to the error bounds to make sure your computations are reasonable.

  2. Find the approximations for \(\displaystyle\int_{-1}^4 e^{-x^2} dx\) with 20 subintervals using

    1. A left-hand sum

    2. A right-hand sum

    3. The trapezoid method

    4. The midpoint method

    5. Simpson’s rule

    Note: You cannot find an antiderivative using elementary functions. Thus you won’t be able to compute the integral exactly or determine exact values for the errors.

    Hint: Use the sum(seq(...)) or ∑ command on your calculator.

  3. Compute the error bounds for your approximations of \(\displaystyle\int_{-1}^4 e^{-x^2} dx\).

    Hint: You should be able to quickly determine where \(\max|f'(x)|\) occurs. To save you time on the others, graph them and notice that \(\max|f''(x)|\) and \(\max|f^{(4)}(x)|\) both occur at \(x = 0\).

  4. For each method, determine \(n\), the minimum number of subintervals required to guarantee accuracy to 5 decimal places (i.e., error \(\leq 5 \times 10^{-6}\)) according to the error bounds.

  5. Use Simpson's rule to determine \(\displaystyle\int_{-1}^4 e^{-x^2} dx\) to 5 decimal places.