

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!


1(d). f (x) = x − (ln x)x^ is continuous when x > 1 (since ln(x) > 0), hence on [4, 5]. f (4) ≈ 0. 3066 > 0 and f (5) ≈ − 5. 799 < 0, so by the intermediate value theorem there is an x ∈ [4, 5] with f (x) = 0. 4(a). First note that f ′(x) = (−ex^ + 2)/3, so the only critical point of f occurs at x = ln 2, which lies in the interval [0, 1]. The maximum for |f (x)| must consequently be max{|f (0)|, |f (ln 2)|, |f (1)|} = max{ 1 / 3 , (2 ln 2)/ 3 , (4 − e)/ 3 } = (2 ln 2)/ 3.
P 2 (x) =
eπ/^6 +
eπ/^6 (x − π/6) −
eπ/^6 (x − π/6)^2.
Since f ′′′(x) = ex(−2 cos x − 2 sin x), the error R 2 (x) is given by −^2 e
ξ(x)(cos ξ(x)+sin ξ(x)) 3! (x^ −^ π/6)
− 13 eξ(x)(cos ξ(x) + sin ξ(x))(x − π 6 )^3 , where ξ(x) is a number between π/6 and x. (a) P 2 (0.5) ≈ 1 .44688. The error is 13 eξ^ (cos ξ+sin ξ)( π 6 − 12 )^3 , for some ξ ∈ [0. 5 , π/6]. This quantity’s maximum value is 1. 01019 · 10 −^5 , obtained when ξ = π/6; one may also overestimate it to find an error bound: for example, |R 2 (0.5)| < 13 eπ/^6 (cos 0 + sin π 6 )( π 6 − 12 )^3 < 13 (3)^1 (1 + 12 )( 46 − 12 )^3 ≈
√3+ 2 (^
π 6 )
10 −^1 when x ∈ [0, π/6], and |R 2 (x)| ≤ 13 ex(cos x + sin x)(x − π 6 )^3 ≤ 13 e^1 (cos 1 + sin 1)(1 − π 6 )^3 ≈
(c)
0 P^2 (x)dx^ = 1.37654. (d) Integrating the “overkill” estimates for R 2 (x) from (b) yields 2. 93300 · 10 −^2. It’s also correct to integrate the answer to (b) (i.e., repeat it). The actual error, 1. 48276 · 10 −^3 , is much smaller. (This is because P 2 (x) both overestimates and underestimates f (x) on part of [0, 1].)
ξ(1) 3! (1)
(^3) ≤ e/6. Whoever gave an error bound of 1/6 should be fired, as it’s too low by up to (e − 1)/6 [and it’s smaller than the true error].
6(c). (121 0 .327) 119 = 120. 7 119 = 1.7. Absolute error is .027; relative error is .016139. 6(d). (121 119) 0 .327 = 2 0 .327 = 1.673. This is exact. 12(a) Using L’Hospital’s Rule, we have
lim x→ 0
ex^ − e−x x
= lim x→ 0
ex^ + e−x 1
12(b) With three-digit rounding arithmetic we have e^0.^100 = 1.11 and e−^0.^100 = 0.905, so f (0.100) =
11 − 0. 905
100 =^
205
100 = 2.05.
Date: Due Thursday 6/25. 1
12(c) The third Maclaurin polynomials give
ex^ ≈ 1 + x +
x^2 +
x^3 and e−x^ ≈ 1 − x +
x^2 −
x^3 , so
f (x) =
ex^ ≈ 1 + x + 12 x^2 + 16 x^3
e−x^ ≈ 1 − x + 12 x^2 − 16 x^3
x
2 x + 13 x x
x^2.
Thus, with three-digit rounding, we have
f (0.100) ≈ 2 +
12(d) The relative error for the approximation y is |y− 2.^2003335000.^003335000 |. For (b) and (c) this gives relative error of 2. 329 × 10 −^2 and 1. 665 × 10 −^3. Note: Replacing the exponentials with Maclaurin polynomials improved accuracy by preventing the cancellation of significant digits. Simplifying the expression in part (c) is essential; omitting this step results in the same answer found in (b). 16(c). This number has a sign of + and exponent of 1023 − 1023 = 0. By inspection, the same is true for the next smallest or largest machine number. Thus, these numbers are 2−^52 smaller and 2−^52 larger than the original, respectively. In exact decimals: c−^ =1. c =1. c+^ =1.
25(a). If overflow occurs at all, it will overflow when computing m!. (k!(m − k)! is smaller.) Trial and error shows that up to m = 17 is safe, but m = 18 overflows. 25(b). m!/(m−k)! = (1)... (m−k)(m−k+1)... (m)/(1)... (m−k) = (m−k+1)... (m). So m!/k!(m−k)! = (m − k + 1)... (m)/(1)... (k) = mk · m k−− 11... m− 1 k +1. 25(c). The calculation would be m 3 · m− 2 1 · m 1 − 2. A search near
6 · 0. 9999 · 1015 finds that up to m = 181707 works. (What’s important is that this is much larger.)
6(a)–(c). O(n−^1 ), O(n−^2 ), and O(n−^2 ), respectively, since sin h = O(h) as h → 0. 6(d). ln(n + 1) − ln(n) = ln((n + 1)/n) = ln(1 + 1/n) = (1/n) − (1/n)^2 /2 + (1/n)^3 / 3 − · · · = O(n−^1 ).
8(a). There are
∑^ n
i=
∑^ i
j=
1 = n(n + 1)/2 multiplications and (n − 1) +
∑n i=1(i^ −^ 1) = (n^ −^ 1)(n^ + 1)/^2
additions. (Any answer that implies O(n^2 ) for both is acceptable.) 8(b).
∑n i=
∑i j=1 aibj^ =^
∑n i=1 ai
∑i j=1 bj^. The latter summation involves only^ n^ multiplications. 14(a). If F (h) = L + O(hp), there are constants K and δ such that |F (h) − L| ≤ K|hp| whenver |h| < δ. If q < p, we also have |F (h) − L| ≤ Kδp−q^ |h|q^ whenever |h| < δ, so F (h) = L + O(hq^ ) as well.
Extra (a) The semicolons suppressed output; without them, MATLAB would have printed the values of f and g. The .^ means to exponentiate each entry of x if x is a vector or matrix—g can be called on a list of data. (b) Multiply f (x)/1 by
x^2 + 1 + x on top and bottom. The numerator expands as (
x^2 + 1)^2 − x^2 = x^2 + 1 − x^2 = 1. (c) When a computer calculates f (x), for large x, it must subtract x from
x^2 + 1. When x is large, the first several significant (binary) digits of these numbers are the same; they are cancelled, and only the remaining bits are significant in the answer. The computation of g(10^7 ) has no such problem with catastrophic cancellation, and is therefore more accurate.
2