Docsity

Practice Assignment 4 - Numerical Analysis | Math 105, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Jim Lambers
Math 105A
Summer Session I 2003-04
Homework Assignment 4
This assignment is due at 6pm on Wednesday, August 4. The exercises are from the textbook,
Numerical Analysis, 7th Edition, by Burden and Faires. Note: These exercises have been modi-
fied to indicate tasks that must be performed using MATLAB. For other exercises, you may use
MATLAB if you wish.
For all exercises, you must show your work to receive full credit. For exercises involving MAT-
LAB, you must submit your code and your output.
Section 4.5
1. Use Romberg integration to compute R3,3for the integral
Z1.5
1
x2ln x dx.
Note: R3,3corresponds to N3(h) from Lecture 13, with h=b−a= 0.5.
3. Use Romberg integration to approximate the integral in Exercise 1 to within 10−6. Compute
the Romberg table until either |Rn−1,n−1−Rn,n|<10−6, or n= 10. Compare your result to
the exact value of the integral, which is 0.192259357732796.
5. Use the following data to approximate R5
1f(x)dx as accurately as possible.
x12345
f(x) 2.4142 2.6734 2.8974 3.0976 3.2804
11. Show that the approximation Rk,2is the same as that given by the Composite Simpson’s rule
described in Theorem 4.4 with h=hk.
Section 4.6
1. Compute the Simpson’s rule approximations to S(a, b), S(a, (a+b)/2), and S((a+b)/2, b)
for the integral
Z1
0
x2e−xdx,
1
pf2

Partial preview of the text

Download Practice Assignment 4 - Numerical Analysis | Math 105 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Jim Lambers

Math 105A

Summer Session I 2003-

Homework Assignment 4

This assignment is due at 6pm on Wednesday, August 4. The exercises are from the textbook,

Numerical Analysis, 7th Edition, by Burden and Faires. Note: These exercises have been modi-

fied to indicate tasks that must be performed using MATLAB. For other exercises, you may use

MATLAB if you wish.

For all exercises, you must show your work to receive full credit. For exercises involving MAT-

LAB, you must submit your code and your output.

Section 4.

  1. Use Romberg integration to compute R 3 , 3 for the integral

1

x

2 ln x dx.

Note: R 3 , 3 corresponds to N 3 (h) from Lecture 13, with h = b − a = 0.5.

  1. Use Romberg integration to approximate the integral in Exercise 1 to within 10

− 6

. Compute

the Romberg table until either |Rn− 1 ,n− 1 − Rn,n| < 10

− 6 , or n = 10. Compare your result to

the exact value of the integral, which is 0.192259357732796.

  1. Use the following data to approximate

1

f (x) dx as accurately as possible.

x 1 2 3 4 5

f (x) 2.4142 2.6734 2.8974 3.0976 3.

  1. Show that the approximation Rk, 2 is the same as that given by the Composite Simpson’s rule

described in Theorem 4.4 with h = hk.

Section 4.

  1. Compute the Simpson’s rule approximations to S(a, b), S(a, (a + b)/2), and S((a + b)/ 2 , b)

for the integral ∫ 1

0

x

2 e

−x dx,

and verify that

S(a, b) − S

a,

a + b

− S

a + b

, b

∫ (^) b

a

f (x) dx − S

a,

a + b

− S

a + b

, b

where the exact value of the integral is 0.16060279414279.

  1. Use Adaptive quadrature to approximate the integral

∫ (^) π/ 4

0

e

3 x sin 2x dx

to within 10

− 3

. You may not use MATLAB.

Section 4.

  1. Approximate the integral ∫ (^) π/ 4

0

x

2 sin x dx

using Gaussian quadrature with n = 2, and compare your result to the exact value, which is

0.08875528443527.

  1. Repeat Exercise 1 with n = 4.

Section 4.

  1. Use Algorithm 4.4 with n = m = 14 to approximate ∫

R

e

−(x+y) dA

where R is the region in the plane bounded by the curves y = x

2 and y =

x. Implement

the algorithm using MATLAB.

Section 4.

  1. Write a MATLAB function that approximates an integral of a given function f (x) on an

given interval [a, b], using the Composite Simpson’s rule with a given value of n. Then, use

the transformation t = x

− 1 and your function to approximate the improper integral ∫ (^) ∞

1

x^2 + 9

dx

with n = 4.