






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Math 433 - Numerical Analysis - Spring 2008 Homework 2: SOLUTIONS Assigned: Friday, January 18, 2008. Due: Friday, January 25, 2008.
PROBLEMS:
Discuss the results, especially the rate of convergence (order of accuracy).
Some Problems Using Taylor Polynomials.
f ′′(x) =
f (x − h) − 2 f (x) + f (x + h) h^2
for sufficiently small h by expanding f (x ± h) out to at least fourth order using Taylor polynomials.
a) Expand f (x) in a Taylor series about the point x 0 = 0. b) Find an expression for the remainder. c) Estimate the number of terms that would be required to guarantee accuracy for f (x) within 10−^5 (six significant digit accuracy) for all x in the interval [− 1 , 1]. d) Plot f (x) and its 1st, 3rd, 5th and 7th degree Taylor polynomials over [− 2 , 2]. (Use the Matlab command subplot to generate a number of plots on the same page).
Finite Precision Arithmetic
(a)
∑^6
k=
3 k^
(b)
∑^6
k=
37 −k
observe this behavior from the loglog plot of the error vs. h. For h up to 10−^5 , the error decreases linearly in agreement with the linear convergence of the given finite difference formula. For smaller h, error starts increasing due to roundoff errors, which means that approximations with h smaller than 10−^5 are not accurate.
10 ! 10 10 ! 9 10 ! 8 10 ! 7 10 ! 6 10 ! 5 10 ! 4 10 ! 3 10 ! 2 10
(^10)! 1 ! 11
10!^10
10 ! 9
10!^8
10 ! 7
10 ! 6
10 ! 5
10 ! 4
10!^3
10 ! 2
h
abs(error)
loglog plot of error vs h
! 2 !1.5! 1 !0.5 0 0.5 1 1.5 2
! 4
! 3
! 2
! 1
0
1
2
x
y
Taylor polynomials of function f(x)=cos(pi x/2)
f(x) P 1 (x)=P 0 (x) P 3 (x)=P 2 (x) P 5 (x)=P 4 (x) P 7 (x)=P 6 (x)