Assignment2 Cse330 Fall2024
Assignment2 Cse330 Fall2024
• Write your name, ID#, and Section number clearly in the very front page.
• Write all answers sequentially.
• Start answering a question (not the pat of the question) from the top of a new page.
• Write legibly and in orderly fashion maintaining all mathematical norms and rules. Prepare a single solution file.
• Start working right away. There is no late submission form. If you miss the deadline, you need to use the make-up
assignment to cover up the marks.
1. Let f (x) = tan(x). In the following we would like to calculate the truncation errors.
(a) (3 marks) First write down the approximate polynomial, p3 (x), for the function f (x) and identify the Taylor
coefficients, a0 , · · · , a3 .
(b) (2 marks) Compute the percentage relative error at x = π/4 if f (x) is approximated by p3 (x) polynomial.
(c) (5 marks) Use the Lagrange reminder form to evaluate the upper bound of truncation error at x = π/4 for
some ξ ∈ [0, π/4].
2. Consider the function f (x) = ex − e−x and the nodes are at -1, 0, and 1. Now answer the following questions using
3 significant figures:
(a) (1 mark) Write down the matrices b and V used in Vandermonde method.
(b) (2 marks) Compute the determinant of the Vandermonde matrix V .
(c) (3 marks) Using The results of the previous two parts, calculate the Taylor coefficients a0 , a1 and a2 ; and
finally find the interpolating polynomial.
(d) (4 marks) Evaluate the upper bound of interpolation error for the given function for the interval ξ ∈ [−2.1, 2.1].
3. Consider the function f (x) = ex + e−x and the nodes are at -1, 0, and 1. Now answer the following questions using
3 significant figures:
(a) (4 marks) Evaluate the Lagrange bases for the given function and nodes.
(b) (3 marks) Compute the Lagrange interpolation polynomial for the given function, and express the result in
the natural basis. Also use this polynomial to find an approximate value of f (6).
(c) (3 marks) Evaluate the relative error in percentage form at x = 1.5.
4. Consider the function f (x) = ex − e−x and the nodes are at -2, 0, and 2. Now answer the following questions using
3 significant figures:
(a) (4 marks) Evaluate the Newton coefficients ak = f [x0 , · · · , xk ] using Newton’s divided-difference method for
the given function and nodes.
(b) (3 marks) Compute the Newton interpolation polynomial for the given function, and express the result in the
natural basis. Also use this polynomial to find an approximate value of f (6).
(c) (3 marks) Evaluate the relative error in percentage form at x = 1.5.
Motto: Mathematics is NOT difficult, but what is difficult is to believe that mathematics is NOT difficult.