9.* Use the error term of a Taylor polynomial to estimate the error involved in using sin x ≈ x... Perform the following computations i exactly, ii using three-digit chopping arithmetic,
Trang 1Mathematical Preliminaries
Review of Calculus
Exercise Set 1.2 (page 14)
1 Show that the following equations have at least one solution in the given intervals.
(a) x cos x − 2x2+ 3x − 1 = 0, [0.2, 0.3] and [1.2, 1.3]
(b) (x − 2)2− ln x = 0, [1, 2] and [e, 4]
(c) 2x cos(2x) − (x − 2)2= 0, [2, 3] and [3, 4]
(d∗ ) x − (ln x) x = 0, [4, 5]
SOLUTION: For each part, f ∈ C[a, b] on the given interval Since f(a) and f(b) are of
opposite sign, the Intermediate Value Theorem implies that a number c exists with f (c) = 0.
For part (d∗ ): It is not possible to algebraically solve for the solution x, but this is not required
in the problem, we must show only that a solution exists Let
f (x) = x − (ln x) x = x − exp(x(ln(ln x))).
Since f is continuous on [4, 5] with f (4) ≈ 0.3066 and f(5) ≈ −5.799, the Intermediate Value
Theorem implies that a number x must exist in (4, 5) with 0 = f (x) = x − (ln x) x
2 Find intervals containing solutions to the following equations.
(a) x − 3 −x= 0
(b) 4x2− e x= 0(c∗ ) x3− 2x2− 4x + 3 = 0
that is, when x = −2
3 and x = 2 Relative maximum and minimum values of f can occur only
at these values There are at most three solutions to f (x) = 0, because f (x) is a polynomial of degree three Since f ( −2) = −5 and f(−2
Trang 2SOLUTION: For each part, f ∈ C[a, b], f ′ exists on (a, b) and f (a) = f (b) = 0 Rolle’s
Theorem implies that a number c exists in (a, b) with f ′ (c) = 0 For part (d), we can use
SOLUTION: (a) First note that f ′ (x) = ( −e x + 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.
SOLUTION: (b) 0.8SOLUTION: (c) 5.164000SOLUTION: (d) 1.582572
5 Let f (x) = x3
(a) Find the second Taylor polynomial P2(x) about x0= 0
(b) Find R2(0.5) and the actual error when using P2(0.5) to approximate f (0.5).
(c) Repeat part (a) with x0= 1
(d) Repeat part (b) for the polynomial found in part (c)
SOLUTION: (a) P2(x) = 0 SOLUTION: (b) R2(0.5) = 0.125; actual error = 0.125 SOLUTION: (c) P2(x) = 1 + 3(x − 1) + 3(x − 1)2
SOLUTION: (d) R2(0.5) = −0.125; actual error = −0.125
Trang 37.* Find the second Taylor polynomial for f (x) = e x cos x about x0= 0.
(a) Use P2(0.5) to approximate f (0.5), find an upper bound for |f(0.5) − P2(0.5) |, and
compare this to the actual error
(b) Find a bound for the error |f(x) − P2(x) |, for x in [0, 1].
(c) Approximate
∫ 1 0
f (x) dx using
∫ 1 0
≤13(0.5)2 max
ξ ∈[0,0.5] |e ξ (sin ξ + cos ξ) |.
To maximize this quantity on [0, 0.5], first note that D x e x (sin x + cos x) = 2e x cos x > 0, for all x in [0, 0.5] This implies that the maximum and minimum values of e x (sin x + cos x) on [0, 0.5] occur at the endpoints of the interval, and
e0(sin 0 + cos 0) = 1 < e 0.5 (sin 0.5 + cos 0.5) ≈ 2.24.
Trang 44 Exercise Set 1.2
(c)
∫ 1 0
f (x) dx ≈
∫ 1 0
= 3
2.
(d) From (b),
∫ 1 0
|R2(x) | dx ≤
∫ 1 0
1
3e
1(cos 1 + sin 1)x3 dx =
∫ 1 0
1.252x3dx = 0.313.
Since
∫ 1 0
so the actual error is|1.3780 − 1.5| ≈ 0.12.
8 Find the third Taylor polynomial P3(x) for the function f (x) = (x − 1) ln x about x0= 1
(a) Use P3(0.5) to approximate f (0.5) Find an upper bound for error |f(0.5) − P3(0.5) |
using the error formula, and compare it to the actual error
SOLUTION: (P3(0.5) = 0.312500, f (0.5) = 0.346574 An error bound is 0.2916, and the actual error is 0.034074.)
(b) Find a bound for the error|f(x) − P3(x) | in using P3(x) to approximate f (x) on the interval [0.5, 1.5].
(c) Approximate∫1.5
0.5 f (x) dx using∫1.5
0.5 P3(x) dx.
(d) Find an upper bound for the error in (c) using∫1.5
0.5 |R3(x) dx |, and compare the bound
to the actual error
SOLUTION: (c) An error bound is 0.0583, and the actual error is 4.687 × 10 −3.
9.* Use the error term of a Taylor polynomial to estimate the error involved in using sin x ≈ x
Trang 5Mathematical Preliminaries 5
If we use the bound| cos ξ| ≤ 1, then
sin(180π )− π
180
= R
2
( π180
) = − cos ξ
3!
( π180
)3
≤ 8.86 × 10 −7 .
10 Use a Taylor polynomial about π/4 to approximate cos 42 ◦to an accuracy of 10−6.
SOLUTION: Since 42◦ = 7π/30 radians, use x
For|Rn(7π30)| < 10 −6 , it suffices to take n = 3 To 7 digits,
cos 42◦ = 0.7431448 and P
3(42◦ ) = P
3(7π
30) = 0.7431446,
so the actual error is 2× 10 −7.
11.* Let f (x) = e x/2 sin(x/3) Use MATLAB to determine the following.
(a) The third Maclaurin polynomial P3(x).
(b) A bound for the error |f(x) − P3(x) | on [0, 1].
SOLUTION: We will use the symbolic toolbox in MATLAB to solve this problem
(a) Define f (x) by
syms x
f =inline(’exp(x/2)*sin(x/3)’,’x’)MATLAB responds with
f = Inline function: f(x) = exp(x/2)*sin(x/3)
In order to use the symbolic toolbox of MATLAB we need to define x as the independent
variable in the problem This requires the syms command We use the taylor command tocompute the first three terms of the Taylor polynomial for f(x)
taylor(f(x),’Order’,3)MATLAB responds with
Trang 66 Exercise Set 1.2
diff(f(x),4)
and MATLAB responds with
ans =(5*cos(x/3)*exp(x/2))/54 - (119*sin(x/3)*exp(x/2))/1296Now define
f4=inline(’(5*cos(x/3)*exp(x/2))/54 - (119*sin(x/3)*exp(x/2))/1296’,’x’)
which results inf4 = Inline function: f4(x) = (5*cos(x/3)*exp(x/2))/54 - (119*sin(x/3)*exp(x/2))/1296Then find the fifth derivative with
diff(f(x),5)
which MATLAB gives as
ans = (61*cos(x/3)*exp(x/2))/3888 - (199*sin(x/3)*exp(x/2))/2592For the evaluations we will use the long format of MATLAB, implemented withformat long
to determine if the fourth derivative has any critical points in [0, 1] we use
fzero(inline(’(61*cos(x/3)*exp(x/2))/3888
- (199*sin(x/3)*exp(x/2))/2592’,’x’),[0,1])
and MATLAB responds with
ans = 0.604738907555866Define this value so that we can evaluate the fourth derivative at this point
Trang 7Mathematical Preliminaries 7
error1=c2/24
MATLAB gives this as
error1 =0.004077990090879
12 Let f (x) = ln(x2+ 2) Use MATLAB to determine the following
(a) The Taylor polynomial P3(x) for f expanded about x0= 1
(b) The maximum error|f(x) − P3(x) | for 0 ≤ x ≤ 1.
(c) The Maclaurin polynomial ˜P3(x) for f
(d) The maximum error|f(x) − ˜ P3(x) | for 0 ≤ x ≤ 1.
(e) Does P3(0) approximate f (0) better than ˜ P3(1) approximates f (1)?
SOLUTION: A bound for the maximum error is 0.0026.
14 The nth Taylor polynomial for a function f at x0 is sometimes referred to as the polynomial
of degree at most n that “best” approximates f near x0
(a) Explain why this description is accurate
(b) Find the quadratic polynomial that best approximates a function f near x0= 1 if the
tangent line at x0= 1 has equation y = 4x − 1, and if f ′′(1) = 6.
SOLUTION: (a) P n (k) (x0) = f (k) (x0) for k = 0, 1, , n The shapes of P n and f are the same at x0
gives the probability that any one of a series of trials will lie within x units of the mean,
assuming that the trials have a normal distribution with mean 0 and standard deviation
√
2/2 This integral cannot be evaluated in terms of elementary functions, so an
approximating technique must be used
(a) Integrate the Maclaurin series for e −t2
Trang 8(c) Use the series in part (a) to approximate erf(1) to within 10−7.
(d) Use the same number of terms used in part (c) to approximate erf(1) with the series inpart (b)
(e) Explain why difficulties occur using the series in part (b) to approximate erf(x).
SOLUTION: (a) Use the series
2
√ π
√
π e
−x2∑∞ k=0
2k x 2k+1
1· 3 · · · (2k + 1) =
2
√ π
We have no such bound for the positive term series in part (b)
16.* In Example 3 it is stated that for all x we have | sin x| ≤ |x| Use the following to verify this
statement
(a) Show that for all x ≥ 0 the function f(x) = x − sin x is non-decreasing, which implies
that sin x ≤ x with equality only when x = 0.
(b) Use the fact that the sine function is odd to reach the conclusion
First observe that for f (x) = x − sin x we have f ′ (x) = 1 − cos x ≥ 0, because −1 ≤ cos x ≤ 1
for all values of x Also, the statement clearly holds when |x| ≥ π, because | sin x| ≤ 1.
Trang 9Mathematical Preliminaries 9
SOLUTION: (a) The observation implies that f (x) is non-decreasing for all values of x, and
in particular that f (x) > f (0) = 0 when x > 0 Hence for x ≥ 0, we have x ≥ sin x, and when
0≤ x ≤ π, we have | sin x| = sin x ≤ x = |x|.
SOLUTION: (b) When −π < x < 0, we have π ≥ −x > 0 Since sin x is an odd function, the
fact (from part (a)) that sin(−x) ≤ (−x) implies that | sin x| = − sin x ≤ −x = |x|.
As a consequence, for all real numbers x we have | sin x| ≤ |x|.
Round-Off Error and Computer Arithmetic
Exercise Set 1.3 (page 20)
1 Compute the absolute error and relative error in approximations of p by p ∗.
2 Perform the following computations (i) exactly, (ii) using three-digit chopping arithmetic, and
(iii) using three-digit rounding arithmetic (iv) Compute the relative errors in parts (ii) and(iii)
(a) 4
5 +
13(b) 4
5 ·1
3(c)
(1
3 − 3
11
)+ 320(d)
(1
3 +
311
)
− 3
20
Trang 1010 Exercise Set 1.3
SOLUTION: (a) (i) 17/15 (ii) 1.13 (iii) 1.13 (iv) both 3× 10 −3
SOLUTION: (b) (i) 4/15 (ii) 0.266 (iii) 0.266 (iv) both 2.5 × 10 −3
SOLUTION: (c) (i) 139/660 (ii) 0.211 (iii) 0.210 (iv) 2× 10 −3, 3× 10 −3
SOLUTION: (d) (i) 301/660 (ii) 0.455 (iii) 0.456 (iv) 2× 10 −3, 1× 10 −4
3 Use three-digit rounding arithmetic to perform the following calculations Compute the
abso-lute error and relative error with the exact value determined to at least five digits
2e − 5.4
(f) −10π + 6e − 3
62(g)
(29
)
·
(97)
(h) π −22
7 1 17
2e − 5.4 =
0.0720 0.0400 = 1.80.
The correct value is approximately 1.954, so the absolute and relative errors to three digits are
Trang 112e − 5.4 =
0.0710 0.0200 = 3.55.
The correct value is approximately 1.954, so the absolute and relative errors to three digits are
|3.55 − 1.954| = 1.60, and |3.55 − 1.954|
1.954 = 0.817,
respectively The results in Exercise 3(e) were considerably better
5 Repeat Exercise 3 using four-digit rounding arithmetic.
6 Repeat Exercise 3 using four-digit chopping arithmetic.
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 12)+ arctan
(13
)]
(b) 16 arctan
(15
)
− 4 arctan
(1239)
SOLUTION: (a) We have P(1
2 + arctan
13
Trang 139 Suppose the points (x0, y0) and (x1, y1) are on a straight line with y1̸= y0 Two formulas are
available to find the x-intercept of the line:
(a) Show that both formulas are algebraically correct
(b) Use the data (x0, y0) = (1.31, 3.24) and (x1, y1) = (1.93, 4.76) and three-digit rounding arithmetic to compute the x-intercept both ways Which method is better, and why?
SOLUTION: The first formula gives −0.00658, and the second formula gives −0.0100 The
true three-digit value is −0.0116.
10 The Taylor polynomial of degree n for f (x) = e xis ∑n
i=0 x i /i! Use the Taylor polynomial of
degree nine and three-digit chopping arithmetic to find an approximation to e −5 by each of
the following methods
9
∑
i=0
(−1) i5i i!
(b) e −5= 1
e5 ≈∑9 1
i=05i /i!
An approximate value of e −5 correct to three digits is 6.74 × 10 −3 Which formula, (a) or
(b), gives the most accuracy, and why?
SOLUTION: (a)−1.82
SOLUTION: (b) 7.09 × 10 −3
The formula in (b) is more accurate since subtraction is not involved
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 1414 Exercise Set 1.3
11.* A rectangular parallelepiped has sides 3 cm, 4 cm, and 5 cm, measured to the nearest
centimeter
(a) What are the best upper and lower bounds for the volume of this parallelepiped?
(b) What are the best upper and lower bounds for the surface area?
SOLUTION: The sides are x = 3 cm, y = 4 cm, and z = 5 cm to the nearest cm This
12 The following MATLAB M-file rounds or chops a number x to t digits where rnd = 1 for
rounding and rnd = 0 for chopping
function [res] = CHIP(rnd,t,x)
% This program is used to round or chop a number x to a specific number t of digits
(a) x = 124.031, t = 5 (b) x = 124.036, t = 5 (c) x = −0.00653, t = 2
(d) x = −0.00656, t = 2
SOLUTION: (a) We have 124.03 for rounding and 124.03 for chopping
SOLUTION: (b) We have 124.04 for rounding and 124.03 for chopping.
SOLUTION: (c) We have−0.0065 for rounding and −0.0065 for chopping.
SOLUTION: (d) We have−0.0065 for rounding and −0.0065 for chopping.
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 15Mathematical Preliminaries 15
13 The binomial coefficient (
m k
)
k! (m − k)!
describes the number of ways of choosing a subset of k objects from a set of m elements.
(a) Suppose decimal machine numbers are of the form
for all k by the definition without causing overflow?
(b) Show that(m
k
)can also be computed by(
m k
by the formula in part (b) without causing overflow?
(d) Use the equation in (b) and four-digit chopping arithmetic to compute the number ofpossible 5-card hands in a 52-card deck Compute the actual and relative errors
SOLUTION: (a) m = 17
SOLUTION: (b)
(
m k
SOLUTION: (c) m = 181707 SOLUTION: (d) 2,597,000; actual error 1960; relative error 7.541 × 10 −4
Errors in Scientific Computation
Exercise Set 1.4 (page 28)
1 (i) Use four-digit rounding arithmetic and the formulas of Example 1 to find the most accurate
approximations to the roots of the following quadratic equations (ii) Compute the absoluteerrors and relative errors for these approximations
Trang 16The actual root is 10.98687488, so the absolute error is|10.98687488−10.98| = 6.87488×10 −3,
and the relative error is
The absolute errors and relative errors for these approximations are:
((ii)) The actual root is 0.001149076 so the absolute error of this approximation is
|0.001149076 − 0.001149| = 7.566 × 10 −8 ,
and the relative error is
7.566 × 10 −8
0.001149076 = 6.5844 × 10 −5 .
2 Repeat Exercise 1 using four-digit chopping arithmetic.
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 17The actual root is 10.98687488, so the absolute error is
|10.98687488 − 10.98| = 6.87488 × 10 −3, and the relative error is
The absolute errors and relative errors for these approximations are:
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 18and four-digit rounding arithmetic.
(c) Compute the absolute and relative errors in parts (a) and (b)
SOLUTION: (a)−0.1000
SOLUTION: (b)−0.1010
SOLUTION: (c) Absolute error for part (a) 2.331 × 10 −3 with relative error 2.387 × 10 −2 .
Absolute error for part (b) 3.331 × 10 −3 with relative error 3.411 × 10 −2 .
and four-digit chopping arithmetic
(c) Compute the absolute and relative errors in parts (a) and (b)
SOLUTION: (a)−0.09000
SOLUTION: (b)−0.1140
SOLUTION: (c) The absolute error for (a) is 7.669 × 10 −3, and the relative error for (a) is
7.852 × 10 −2 The absolute error for (b) is 1.633 × 10 −2, and the relative error for (b) is
(a) Approximate e −0.98using ˆP5(0.49) and four-digit rounding arithmetic.
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
Trang 19Mathematical Preliminaries 19
(b) Compute the absolute and relative error for the approximations in part (a)
(c) Approximate e −0.98 using 1/P
5(0.49) and four-digit rounding arithmetic.
(d) Compute the absolute and relative errors for the approximations in part (c)
SOLUTION: (a) Using four-digit rounding arithmetic to evaluate ˆP5(0.49) gives
P5(0.49) =
1(((((−0.2667)(0.49) + 0.6667)(0.49) + 1.333)(0.49) + 2)(0.49) + 2)(0.49) + 1
6.* (a) Show that the polynomial nesting technique can be used to evaluate
f (x) = 1.01e 4x − 4.62e 3x − 3.11e 2x + 12.2e x − 1.99.
(b) Use three-digit rounding arithmetic and the formula given in the statement of part (a)
to evaluate f (1.53).
Full file at https://TestbankDirect.eu/Solution-Manual-for-Numerical-Methods-4th-Edition-by-Faires
... −0.0065 for chopping.SOLUTION: (d) We have−0.0065 for rounding and −0.0065 for chopping.
Full file at https://TestbankDirect.eu /Solution- Manual- for- Numerical- Methods- 4th- Edition- by- Faires< /h3>... absolute errors and relative errors for these approximations are:
Full file at https://TestbankDirect.eu /Solution- Manual- for- Numerical- Methods- 4th- Edition- by- Faires< /h3>
Trang... the formula given in the statement of part (a)to evaluate f (1.53).
Full file at https://TestbankDirect.eu /Solution- Manual- for- Numerical- Methods- 4th- Edition- by- Faires< /h3>