Starting from:

$20

MA322-Lab 4 Solved

1.    Apply Mid-point, Trapezoidal and Simpson methods to evaluate

(a)    I =            dx (exact value ≈ 0.623225)

(b)    I =               dx (exact value ≈ 1.047198) (c) I =          )dx (exact value ≈ 0.746824)

2.    A function f has the values shown below:

x
1
1.25
1.50
1.75
2
f(x)
10
8
7
6
5
(a)    Use trapezoidal rule to approximate .

(b)    Use Simpson’s rule to approximate .

3.    Use composite Simpson’s and composite Trapezoidal rules to obtain an approx-matevalue for the improper integral

                                                                       ,      with n = 4.

4.    Compute the integral

 dx

using the trapezoidal and Simpson’s rules and compare the results with help of plots. 5. Determine the values of n and h required to approximate

 dx

to within 10−5 and compute the approximation. Use

(a)    Composite Trapezoidal rule.

(b)    Composite Simpson’s rule.

(c)    Composite Midpoint rule.

6.    Write a program that approximates )dx by the composite trapezoidal rule T(h). Starting with h = (b − a) to compute

and reduce h by a factor of 2 until  .

Your program should return a table with   and it should return the total number of function evaluations f(x). Your program should reuse computed function values as much as possible.

Apply your program to approximate the integrals

 dx =   ln10,

 dx = ln20,

 

7.    Suppose that the function f : R → R cannot be evaluated exactly, but instead of f(x) a value fˆ(x) = f(x) + δ(x) is computed, where |δ(x) ≤ δ for all x ∈ R. Suppose one is interested in the integral



 
 
 

 )dx

and wants to approximate the integral by composite trapezoidal rule T(h) with step size h = (b − a)/N.

(a)    Derive an estimate for the error

 

when inexact function evaluations are used.

(b)    Given δ, what would the range of ”reasonable” step sizes h be? Justify your answer. Demonstrate your findings by approximating

 ,

where instead of

f(x) = x3,

the function

fˆ(x) = x3 + 0.01 ∗ rand

is used in the composite trapezoidal formula.

More products