EXAM-Introduction to scientific computing math
Math 551 Homework Assignment 1 Page 1 of 2
Name and section:
ID number:
E-mail:
1. (15 points) Recall Taylor’s theorem from Calculus: “Assume a function f(x) that has k + 1 derivatives in an interval [a, b], or simply, f ∈ Ck+1 [a, b] and x0 ∈ [a, b]. Then, for every x ∈ [a, b], ∃ ξ between x0 and x such that
f(x) =
k ∑
n=0
f(n)(x0)
n! (x − x0)
n
︸ ︷︷ ︸
Pk(x)
+ f(k+1)(ξ)
(k + 1)! (x − x0)
k+1
︸ ︷︷ ︸
Rk(x)
, (1)
where Pk(x) is called the kth Taylor polynomial for f around x0 and Rk(x) is called the remainder, or truncation error”. Note that
lim k→∞
Pk(x)
gives the Taylor series for the same function f about x = x0 and also a function f is analytic in (a, b) if the Taylor series equals f ∀x ∈ (a, b). Finally, the Taylor series around x = x0 ≡ 0 is called Maclaurin series.
(a) (5 points) Find P1(x), P2(x) and P3(x) around x0 = 0 if f(x) = x 2 − 4x + 3.
How P3(x) is related to f(x)?
(b) (5 points) Same as part (a) but consider x0 = 1.
(c) (5 points) In general, given a polynomial f(x) with degree m, what can you say about f(x) − Pk(x) for k ≥ m?
2. (10 points) Given the function f(x) = cos x, find both P2(x) and P3(x) about x0 = 0, and use them to approximate cos (0.1). Show that in each case the remainder term provides an upper bound for the true (absolute) error.
3. (10 points) If f(x) = ex, then
(a) (5 points) derive the Maclaurin series of the function f(x) = ex, i.e., the Taylor series about x0 = 0 (write separately Pk(x) and Rk(x)),
(b) (5 points) find a minimum value of k necessary for Pk(x) to approximate f(x) to within 10−6 on the interval [0, 0.5] (here, you must use the remainder term).
Math 551 Homework Assignment 1 Page 2 of 2
4. (25 points) Let f(x) be: f(x) = cosh x + cos x − γ,
where γ is a parameter and takes the values of γ = 0, 1, 2, 3. Make a graph of the function f(x) for each value of γ on the interval [−3, 3] and determine whether f(x) has a root. To do so, you have to check the criteria required by the Intermediate Value Theorem. Then, using the m-file “bisect.m”, approximate the root with absolute tolerance 10−10 for the value of γ that f(x) does have a root. Include a copy of the graph of f(x) for the respective cases and MATLAB output.