0% found this document useful (0 votes)
4 views

Numerical Methods

Homework

Uploaded by

xinyueya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Numerical Methods

Homework

Uploaded by

xinyueya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

NUMERICAL METHODS

HOMEWORK 9

• Due date: Friday, November 15, 2024 at 11:59PM on Canvas/Gradescope


• The assignment will be graded out of 20 points. Point values of each problem
are labeled.
• Remember: You are allowed to discuss the assignment with your fellow stu-
dents or consult other references as long as the solution write up is your own
and you provide citation of who you discussed with or what reference you
used.
Exercise 1 (2 points). If (h) = f (x+h)h f (x) = f 0 (x) c1 h c2 h2 c3 h3 · · · ,
then what combination of (h) and (h/2) gives an O(h2 ) accurate approximation
of f 0 (x)? Write down the finite di↵erence formula of this combination
Exercise 2 (2 points). Let (h) = f (x+h)2hf (x h) = f 0 (x) + a2 h2 + a4 h4 + · · · . Let
eh = (h) f (x+h)2hf (x h) . Find a number c such that ẽh = (h) + c (h/2) satisfies
|ẽh eh |
lim = 0.
h!0 |eh |
This tells us that ẽh = (h) + c (h/2) is a good estimate of the error eh .
Exercise 3 (2 points). Exercise 12 in Chapter
R 25.1 from textbook. Obtain an upper
bound on the absolute error when we compute 1 sin(x)dx with composite trapezoid
rule and h = 0.01.
Exercise 4 (4 points). Exercise 24 in Chapter 5.1 from textbook.
Establish an error term for the following quadrature rules on the RHS of the
following approximations (2 points each).
R a+h
a) a f (x)dx ⇡ hf (a)
R a+h 2
b) a f (x)dx ⇡ hf (a) + h2 f 0 (a)
Exercise 5 (2 points). Exercise R4 from Chapter 5.1 in the book.
4
Let f (x) = 2x . Approximate 0 f (x)dx by the trapezoid method using points
0, 2, 4. Repeat by using partition points 0, 1, 2, 3, 4. Now apply one step of Romberg
integration (essentially Richardson extrapolation) to obtain a better approximation.
Exercise 6 (2 points). Modification
R 2 2of Exercise 4 from Chapter 5.3 in the book.
Find an approximate value of 1 x dx using composite Simpson’s rule with h =
0.25. Give a bound on the error.
Exercise 7 (2 points). Exercise 5 from Chapter 5.3 in the book.
Use Simpson’s rule and its error formula to prove that if a cubic polynomial and
a quadratic polynomial cross at 3 equally spaced points, then the two areas enclosed
are equal.
1
NUMERICAL METHODS HOMEWORK 9

Exercise 8 (2 points). We want to approximate the integral of


Z ⇡
I= cos2 (x)dx.
0
Using the table of function values
⇡ ⇡ 3⇡
x 0 4 2 4

1 1
cos2 (x) 1 2
0 2
1

Approximate I using composite Simpson’s rule with the points 0, ⇡4 , ⇡2 , 3⇡


4
, ⇡. Also,
2 1
derive an upper bound of the error of your approximation. Hint: cos x = 2 cos (2x)+
1
2
will make calculating derivatives easier.
Exercise 9 (2 points). We want to approximate the integral of
Z 4
I= ex dx.
0
Using the table of function values

x 0 1 2 3 4
x
e 1 2.718 7.389 20.0856 54.598

Use Romberg integration and the above table of values to approximate I. That
is, compute R(2, 2).
1 h 2 f x Ic h Gh csh

20 h z h f x c h Gh Icsh
f x c h c h Csh

f x ah Csh

f x 01h3

2 h f x ash 94h
E f x ach't to94h4
en f x 0 h as h 94h och

In adchi co E
W7 S lien en och's
a 0 h c 1 f x a ach t at to a 4h

o gtc
fate a 1 19
In ash É a4h
l En en l I at h och's

em i i a in

So in 4 ch 540 t is a goodestimate
f
3 By THM Sba fix dx ÉÉn Etcb a f is

gg Lsinc8il sinE
a 1 b 2 h 0.01 me 811 1

So let 1 21 1 1 1 2.5 10 5

4 a Taylor expansion around X a


fix f a fis x a where 8 E a

59ᵗʰ f x dx fat fia fis x a dx


hfla f s

b Taylor expansion around X a

fix f a fia x a f 8 X a where 8 t a

59ᵗʰ f x dx fat fia fia x a f 8 x a dx


h fla f a f S
5 R 1,0 12 0 1 14 4 2

flo 2 f 2 f 4

2 2 22 24
25
R 2 0 421 Itp 44
2 21 22 234 24
22.5

R L2 1 R 2,0 R 2,0 R 1,01

22.5 2.5

21.67

6 S fix dx f 1 4 f 1 v5 2 11 5 4 f 1.75 f 2

1 4 0.64 2 0 44 4 0.33 0.25

0.5

error 1 h b a f c for some CE a b


f 1811 120 61 120
19 19
error 1 Fo 0.5 2 1 1201 2 6 10 3
7 Let p x ax bx ex d Palx mx nx tr

P Xo Xoth 2h and 73 X Pa X EP

let f x P3 X P2 X
f fix dx f Xo 4 Xo h fixotan
By Simpson's rule
0 4.0 to 0

So S psex dx 5 Pax dx

8 I f co f x 4 f É it f It z f É

I 1 1 4 1 2.0

error Fo h b a f c for ceca b

call 8 cos 2c 1 8
1 7 1
error 1 É 1 81 0
017

9 210 0
111 4 0 2 1 54.598 111 196
R 1,0 R o o 4 f 2 111.196 2 7 389 70 376
R 2,0 R 1,0 f 1 f3 x 70.376 2 718 20086 57 992
R 1 1 R 110 k 1,0 210,07 56 77
R 2 1 2,01 R 2,0 R 1,01 53 864

R 2 2 k 2,1 Tf R 211 R 1,1 53 67

You might also like