Professional Documents
Culture Documents
ii
Contents
1 Mathematical Preliminaries
EXERCISE SET 1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EXERCISE SET 1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EXERCISE SET 1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iii
1
1
6
9
iv
CONTENTS
This is a Sample of the Student Solutions Manual for Numerical Methods, Third
Edition, by Faires and Burden. It contains worked out exercises for all the techniques
discussed in the rst Chapter of the book. The full Student Solutions Manual contains
worked out exercises for all the techniques discussed in the entire book. The answers
to the odd exercises are in the back of the text, but the results listed in this Study
Guide go well beyond the answers listed in the text, and the exercises that are solved
in this Student Solutions Manual were carefully chosen as those requiring insight into
the methods presented in the text.
In addition to the solutions to numerous exercises, the Student Solutions Manual
contains a listing of the instructions for the program disk that accompanies Numerical
Methods, together with a copy of the CD that contains the programs in the programming languages C, Pascal, and FORTRAN and for the Computer Algebra Systems
Maple, Mathematica, and Matlab. These programs can be extremely valuable in your
study of approximation techniques since they permit you to see the calculations that
need to be performed without the necessity of performing the calculations by hand.
If you are interested in obtaining the entire Student Solutions Manual, it can likely
be obtained at your local bookstore. If not, you can obtain a copy from the publisher
at
http://www.brookscole.com/math d/
J. Douglas Faires
faires@math.ysu.edu
Richard L. Burden
burden@math.ysu.edu
Chapter 1
x (ln x)x = 0
has at least one solution in the interval [4, 5].
Solution: It is not possible to algebraically solve for the solution x, but this is not
required in the problem, we must only show 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.
c.
Solution: Let
f (x) = x 3 2x 2 4x + 3.
The critical points of f occur when
0 = f (x) = 3x 2 4x 4 = (3x + 2)(x 2),
that is, when x = 23 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, since
f (x) is a polynomial of degree three. Since f (2) = 5 and f (1) = 4; f (0) = 3
and f (1) = 2 and f (2) = 5 and f (4) = 19, solutions lie in the intervals [2, 1],
[0, 1], and [2, 4].
4.
a.
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 0.4620981.
7.
and
R2 (x) =
2e (sin + cos ) 3
x .
3!
a.
1
(0.5)2 max |e (sin + cos )|.
[0,0.5]
3
1
(0.5)3 (2.273) 0.093222.
3
Since P2 (0.5) = 1.5 and f (0.5) = 1.446889, the actual error is 0.053111.
| f (0.5) P2 (0.5)|
c.
Approximate
0
1
(1.0)3 e1 (sin 1 + cos 1) 1.252.
3
f (x) d x
using
0
P2 (x) d x.
Solution:
f (x) d x
x2
1 + x dx = x +
2
1
= 1.5.
0
|R2 (x)| d x
Since
1 1
e (cos 1 + sin 1)x 3 d x =
3
1.252x 3 d x = 0.313.
1
1
ex
e
(cos x + sin x) = (cos 1 + sin 1) (1 + 0) 1.378,
e cos x d x =
2
2
2
0
Use the error term of a Taylor polynomial to estimate the error involved
in using
sin x x
to approximate sin 1 .
9.
Solution: First we need to convert the degree measure for the sine function to radians.
We have 180 = radians, so 1 =
f (x) = sin x,
180
f (x) = cos x,
radians. Since,
f (x) = sin x,
and
and
R2 (x) =
cos 3
x .
3!
cos 3
8.86 107 .
=
sin
= R2
180 180
180
3!
180
11.
a.
Let
x
f (x) = e x/2 sin .
3
Use Maple to determine the third Maclaurin polynomial P3 (x).
1
x
3
>p3:=convert(g,polynom);
p3 :=
1
1
23 3
x + x2 +
x
3
6
648
b. Determine f (4) (x), and bound the error | f (x) P3 (x)| on [0, 1].
1
1
199 (x/2)
61 (x/2)
sin
cos
e
x +
e
x
2592
3
3888
3
Then we see if the fourth derivative has any critical points in [0, 1].
>p:=fsolve(f5=0,x,0..1);
p := .6047389076
The extreme values of the fourth derivative will occur at x = 0, 1, or p.
>c1:=evalf(subs(x=p,f4));
c1 := .09787176213
>c2:=evalf(subs(x=0,f4));
c2 := .09259259259
>c3:=evalf(subs(x=1,f4));
c3 := .09472344463
The maximum absolute value of f (4) (x) is c1 and the error is given by
>err:=c1/24;
err := .004077990089
e.
and
13
14
= 0.929,
6
7
= 0.857, and
Hence,
67
0.0720
=
= 1.80.
2e 5.4
0.0400
The correct value is approximately 1.954, so the absolute and relative errors to three
digits are
|1.80 1.954|
= 0.0788,
|1.80 1.954| = 0.154 and
1.954
respectively.
13
14
7.
a.
Use the rst three terms of the Maclaurin series for the arctangent function
to approximate
1
1
= 4 arctan + arctan
2
3
and determine the absolute and relative errors.
= 0.464583 and P
1
1
= 4 arctan + arctan
3.145576.
2
3
1
2
1
3
= 0.3218107,
and
| 3.145576|
1.268 103 .
| |
10.
f (x) = e x
is
n
xi
i=0
i!
9
(5)i
i=0
i!
9
(1)i 5i
i=0
i!
9
(1)i 5i
i=0
i!
+
2
6
24
120
720
78000 390000 1950000
+
5040
40300
362000
=15+
b. e5 =
1
1
9
e5
i=0
5i
i!
5i
i=0 i!
1
1 + 5 + 12.5 + 20.8 + 26.0 + 26.0 + 21.6 + 15.4 + 9.67 + 5.38
1
= 7.09 103
=
141
=
An approximate value of e5 correct to three digits is 6.74 103 . Part (b) is more
accurate since subtraction is not involved.
11.
Solution: Let the sides be x, y, and z, and suppose that the measurements give
x = 3 cm, y = 4 cm, and z = 5 cm. Since the measurements are accurate to the
nearest centimeter, it follows that the actual values satisfy the inequalities
2.5 x 3.5, 3.5 y 4.5,
a.
and
4.5 z 5.5
What are the best upper and lower bounds for the volume of this parallelepiped?
Solution: Since the volume is V = x yz we have
(2.5)(3.5)(4.5) V (3.5)(4.5)(5.5)
and
39.375 V 86.625
b. What are the best upper and lower bounds for the surface area?
and
S 2(3.5)(4.5) + 2(3.5)(5.5) + 2(4.5)(5.5),
so 71.5 S 119.50.
c.
b +
b2 4ac
2a
and
x2 =
2c
b b2 4ac
to avoid the subtraction of nearly equal numbers. Using four-digit rounding arithmetic
gives
121.2 4.008(0.01265)
11.01 + 121.2 0.05070
=
2.004
2.004
11.01 + 11.00
22.01
11.01 + 121.1
=
=
= 10.98
=
2.004
2.004
2.004
=
11.01 +
2(0.01265)
2c
=
2
b b 4ac
11.01 (11.01)2 4(1.002)(0.01265)
10
0.02530
0.02530
=
= 0.001149.
11.01 11.00
22.01
2.
c.
b +
b2 4ac
2a
and
x2 =
2c
b b2 4ac
to avoid the subtraction of nearly equal numbers. Using four-digit chopping arithmetic
gives
11.01 + 11.00
22.01
11.01 + 121.1
=
=
= 10.98
=
2.004
2.004
2.004
11.01 +
2
b b 4ac
11.01 (11.01)2 4(1.002)(0.01265)
0.02530
0.02530
=
= 0.001149.
=
11.01 11.00
22.01
x2 =
11
5.
and
P5 (x) =
a.
4
2
4
x+
x
x +2 x 2 x +1
15
3
3
12
b. Compute the absolute and relative error for the approximations in part
(a).
Solution: The absolute error is |e0.98 0.3743| = 1.011 103 , and the relative
error is
c.
1.011 103
= 2.694 103 .
e0.98
d. Compute the absolute and relative errors for the approximations in part
(c).
Solution: The absolute error is
|e0.98 0.3755| = 1.889 104 ,
and the relative error is
1.889 104
= 5.033 104 .
e0.98
6.
a.
13
b. Use three-digit rounding arithmetic and the formula given in the state-
Solution: Using e1.53 = 4.62 and three-digit rounding gives e2(1.53) = (4.62)2 =
21.3,
So
c.
Redo the calculations in part (b) using the nesting form of f (x) that was
found in part (a).
Solution:
f (1.53) = (((1.01)4.62 4.62)4.62 3.11)4.62 + 12.2)4.62 1.99
= (((4.67 4.62)4.62 3.11)4.62 + 12.2)4.62 1.99
= ((0.231 3.11)4.62 + 12.2)4.62 1.99
= (13.3 + 12.2)4.62 1.99 = 7.07.
Solution: The exact result is 7.61, so the absolute errors in parts (b) and (c) are,
respectively, | 6.79 + 7.61| = 0.82 and | 7.07 + 7.61| = 0.54. The relative errors
are, respectively, 0.108 and 0.0710.
14
7.
rst by
1
1 1
+ + +
1 4
100
and then by
1
1
1
+
+ + ,
100 81
1
adding left to right. Which method is more accurate, and why?
Solution: Using three-digit chopping arithmetic on
1
100
10
1
i=1 i 2
in the order 1 + 14 + +
gives
1.00 + 0.250 + 0.111 + 0.0625 + 0.0400 + 0.0277
+ 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.25 + 0.111 + 0.0625 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.36 + 0.0625 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.42 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.46 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.48 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.50 + 0.0156 + 0.0123 + 0.0100
= 1.51 + 0.0123 + 0.0100
= 1.52 + 0.0100
= 1.53.
1
100
1
81
+ +
1
4
+ 1 as
0.0100 + .0123 + 0.0156 + 0.0204 + 0.0277 + 0.0400 + 0.0625 + 0.111 + 0.25 + 1.00 = 1.54
The actual value is 1.549. The problem of adding a very small number to an accumulated sum causes signicant round-o errors in the rst method.
8.
a.
15
(1)i+1
i=1
x 2i1
(2i 1)
(1)i+1
i=1
1
2i 1
alternate in sign, the error produced by truncating the series at any term is less than
the magnitude of the next term. To ensure signicant accuracy we need to choose n
so that
4
< 103 or 4000 < 2n + 1.
2(n + 1) 1
To ensure this accuracy requirement we need n 2000.
b. How many terms are required to ensure the 1010 accuracy needed for an
approximation to ?
or
1
lim sin 2
n
n
=0
as n .
Solution: The second Taylor polynomial for f (x) = sin x about x0 = 0 and its
remainder term are sin x = x 16 (cos x )x 3 . We let x = n12 to obtain
sin
1
1
= 2
2
n
n
1
cos
6
1
n2
3
16
1
.
n2
Thus,
sin 1 0 2 1
n2
n2
and the rate of convergence of sin n12 is O n12 .
12.
a.
ai b j ?
i=1 j=1
j=1 ai b j
and
i=
n(n + 1)
2
i 1=
i=1
Multiplications
n(n + 1)
n
2
Additions.
Once the n inner sums are computed, n 1 additions are required for the nal sum.
The nal total is:
n(n + 1)
2
Multiplications
(n + 2)(n 1)
2
and
Additions.
b. Re-express the series in a way that will reduce the number of calculations
ai b j =
n
i=1
ai
i
j=1
bj
17
we can signicantly reduce the amount of calculation. For each i we now need i 1
additions to sum b j s for a total of
n
i 1=
i=1
n(n + 1)
n
2
Additions.
F1 = 1,
and
Fn+2 = Fn+1 + Fn , if n 0,
and dene
xn = Fn+1 /Fn .
Assuming that
lim xn = x
1+ 5
.
x=
2
Solution: Since
lim xn = lim xn+1 = x
we have
x =1+
1
x
and
xn+1 = 1 +
1
,
xn
x 2 x 1 = 0.
5
5
Fn Fn =
.
2
2
5
18
a.
b. Use Maple with the default value of Digits followed by evalf to calculate
F100 .
Solution: We have
> F100:=(((1+sqrt(5))/2)^100-((1-sqrt(5))/2)^100)/sqrt(5);
1 1 100
1 1 100
1
+
5
5
F100 :=
5
2 2
2 2
19
>evalf(F100);
.3542248538 1021
c.
Why is the result from part (a) more accurate than the result from part
(b)?
Solution: The result in part (a) is computed using exact integer arithmetic, and the
result in part (b) is computed using 10-digit rounding arithmetic.
d. Why is the result from part (b) obtained more rapidly than the result
What results when you use the command simplify instead of evalf to
compute F100 ?
Solution: The result is the same as the result in part (a).
The harmonic series
15.
1+
1 1 1
+ + +
2 3 4
1
1
+ + ln n
2
n
Use the default value of Digits in Maple to determine the value of n for
to be within 102 .
b. Use the default value of Digits in Maple to determine the value of n for
to be within 103 .
20
c.
What happens if you use the default value of Digits in Maple to determine the value of n for to be within 104 ?
Solution: The following Maple procedure is used:
>g:=proc(t);
> dne:=1;
> n:=1;
> sm:=0;
> while dne=1 do
> sm:=sm+evalf(1/n);
> gam:=evalf(sm-ln(n));
> err:=abs(evalf(gamma)-gam);
> if err<t then dne:=0
> else n:=n+1;
> fi;
> od;
> n;
>end;
>g(0.01);
>g(0.001);
>g(0.0001);
The results from the procedure are
a. n = 50,
b. n = 500, and c. n = 5001.
If a procedure is not used, as in the following code, the program fails.
>restart;
>tol:=0.0001;
>dne:=1;
>n:=1;
>sm:=0;
>while dne=1 do
> sm:=sm+evalf(1/n);
> gam:=evalf(sm-ln(n));
> err:=abs(evalf(gamma)-gam);
> if err<tol then dne:=0
> else n:=n+1;
> fi;
>od;
>n;