Homework 6 Solutions | Numerical Analysis | MATH 128A, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Material Type: Assignment; Class: Numerical Analysis; Subject: Mathematics; University: University of California - Berkeley; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 10/01/2009

koofers-user-kh3
koofers-user-kh3 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 128A, Spring 2007
Homework 6 Solution
5.1.12 It’s enough to check exactness for 1, x,x2,x3, etc. The degree of precision
is the first nfor which our rule is not exact for xn+1.
Z1
0
1dx = 1 1
41 + 3
41 = 1
Z1
0
xdx = 1/21
40 + 3
42/3 = 1/2
Z1
0
x2dx = 1/31
40 + 3
44/9 = 1/3
Z1
0
x3dx = 1/41
41 + 3
48/27 = 2/9
so the degree is 2.
5.1.14 We have
I(f) = Z1
1
f(x)
Z1
1
[f(1/3)(3/2)(1/3x) + f(1/3)(3/2)(x+ 1/3)]dx
=f(1/3) + f(1/3)
and we can check the degree is 2 by the method of problem 12.
5.1.15 When f(x) = 1, we have R1
1f(x)dx = 2 = 1 + 1 = f(β) + f(β) for any
β. When f(x) = x, we have R1
1f(x)dx = 0 = β+β=f(β) + f(β)
for any β. Hence the degree is at least 1.
To make it work for f(x) = x2, we need R1
1f(x)dx = 2/3 = f(β) +
f(β)=2β2, i.e. β=±1/3. This choice of βis also exact for f(x) = x3
but not for f(x) = x4. Hence the degree is 3.
5.2.1b By (5.23) with f(x) = ex2and [a, b] = [0,1],
I(f)Tn(f) = h2(ba)
12 f00(cn) = (4c2
n2)ec2
n
12n2
with cn[0,1]. Since
|(4c2
n2)ec2
n| 2
we get a bound
|I(f)Tn(f)| 1
6n2
1
pf3

Partial preview of the text

Download Homework 6 Solutions | Numerical Analysis | MATH 128A and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Math 128A, Spring 2007

Homework 6 Solution

5.1.12 It’s enough to check exactness for 1, x, x^2 , x^3 , etc. The degree of precision is the first n for which our rule is not exact for xn+1. ∫ (^1)

0

1 dx = 1

0

xdx = 1/ 2

4 2 /3 = 1/^2

0

x^2 dx = 1/ 3 1 4

0 +^3

0

x^3 dx = 1/ 4

so the degree is 2.

5.1.14 We have

I(f ) =

− 1

f (x)

− 1

[f (− 1 /3)(3/2)(1/ 3 − x) + f (1/3)(3/2)(x + 1/3)]dx

= f (− 1 /3) + f (1/3)

and we can check the degree is 2 by the method of problem 12.

5.1.15 When f (x) = 1, we have

− 1 f^ (x)dx^ = 2 = 1 + 1 =^ f^ (−β) +^ f^ (β) for any β. When f (x) = x, we have

− 1 f^ (x)dx^ = 0 =^ −β^ +^ β^ =^ f^ (−β) +^ f^ (β) for any β. Hence the degree is at least 1. To make it work for f (x) = x^2 , we need

− 1 f^ (x)dx^ = 2/3 =^ f^ (−β) + f (β) = 2β^2 , i.e. β = ± 1 /

  1. This choice of β is also exact for f (x) = x^3 but not for f (x) = x^4. Hence the degree is 3.

5.2.1b By (5.23) with f (x) = e−x 2 and [a, b] = [0, 1],

I(f ) − Tn(f ) = − h^2 (b − a) 12 f ′′(cn) = (4c^2 n − 2)e−c (^2) n 12 n^2 with cn ∈ [0, 1]. Since |(4c^2 n − 2)e−c (^2) n | ≤ 2 we get a bound |I(f ) − Tn(f )| ≤

6 n^2

5.2.4 For the integral I(2)^ =

0

dx 1 + x^2 the error formula (5.32) says

I(2)^ − Tn(f ) ≈ − h

2 12 [f ′(b) − f ′(a)] = 32 867 n^2 Tabulating the error and error estimates,

n actual estimate 2 -1.33e-1 9.23e- 4 -3.59e-3 2.31e- 8 5.64e-4 5.77e- 16 1.44e-4 1.44e- 32 3.60e-5 3.60e- 64 9.01e-6 9.01e- 128 2.25e-6 2.25e-

5.2.5c As in the previous problem

I(f ) − Tn(f ) ≈ − h

2 12 [f ′(b) − f ′(a)] = − 4 e

− 4 3 n^2 We want |I(f ) − Tn(f )| ≤ 10 −^10 , so we solve 4 e−^4 3 n^2 ≤^10

− 10

and obtain n ≥

4 e−^4 3 · 10 −^10

≈ 1. 56 × 104

5.2.7 (a) By (5.23)

I(f ) − Tn(f ) = − h

(^2) (b − a) 12 f ′′(cn) = 8 12 n^2

c^2 n with cn ∈ [1, 3]. Since 1/c^2 n ≤ 1, we have

|I(f ) − Tn(f )| ≤ 2 3 n^2 By (5.32) I(f ) − Tn(f ) ≈ h^2 12 [f ′(b) − f ′(a)] = h^2 18 To insure that |I(f ) − Tn(f )| ≤ 5 × 10 −^8 it is enough to find n so that 2 3 n^2

≤ 5 × 10 −^8