

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Numerical Computations; Subject: Mathematics; University: Penn State - Main Campus; Term: Spring 2005;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Deadline: Fri Feb 4 in class. Home work will be graded selectively. Remember to put your name on the first page of your home work.
NB! If a problem is not specified to use Matlab, then you should not use Matlab.
Preparation for Matlab home works: Read chapter 3 in the notes of Gockenbach.
(a). The Taylor series for (1 + x)n^ is also known as the binomial series. It states that
(1 + x)n^ = 1 + nx + n(n − 1) 2! x^2 + n(n − 1)(n − 2) 3! x^3 + · · · (x^2 < 1)
Derive the series and for n = 2, n = 3 and n = 1/2, give its particular form. Then use the last form to compute
1 .0001 correct to 15 decimal places (rounded).
(b). (continuation) Use the previous problem to obtain a series for (1 + x^2 )−^1.
(a). Use the Lagrange interpolation process to obtain a polynomial of least degree that assumes these values: x 0 2 3 4 y 7 11 28 63
(b). (Continuation) For the points in the table of (a), find the Newton form of the in- terpolating polynomial. Show that the two polynomials obtained are identical, although their forms may differ.
(c). The polynomial p(x) = x^4 − x^3 + x^2 − x + 1 has the values shown. x -2 -1 0 1 2 3 p(x) 31 5 1 1 11 61 Find a polynomial q that takes these values (you don’t need expand it): x -2 -1 0 1 2 3 p(x) 31 5 1 1 11 30 (Hint: This can be done with little work.)
(a). Show directly that the maximum error associated with linear interpolation is bounded by 18 (x 1 − x 0 )^2 M , where M = maxx 0 ≤x≤x 1 |f ′′(x)|.
(b). An interpolating polynomial of degree 20 is to be used to approximate e−x^ on the interval [0, 2]. How accurate will it be?
(a). Derive the approximation formula
f ′(x) ≈
2 h
[4f (x + h) − 3 f (x) − f (x + 2h)]
and show that its error term is of the form 13 h^2 f ′′′(ξ). (Hints: Consider the polynomial that interpolates the function at the following 3 points: x, x + h, x + 2h.)
(b). Then, use the formula to find the derivative of f (x) = tan(x) at x = 1.0 for h = 0. 1 , 0 .01 and 0.001. Compare the error with the error bound for this formula.
(c). Use Matlab to compute the approximation to tan(x) at x = 1.0, with this formula, with smaller and smaller values of h. Plot the error as a function of h, use log scale (loglog). What is the best result you manage to get? What is your comments to the result? What to hand in for part c): Hand in the Matlab script file, the plot of error, and your comments.
Part (A): Write two functions in Matlab. The first one should read in two vectors x and y, and return a table (a matrix) of the divided difference values. This means, the first line of your divdiff.m file should be:
function a=divdiff(x,y)