0% found this document useful (0 votes)
120 views6 pages

Spring 2004 David M. Rocke EAD 115 April 27, 2004

This document contains the text of a midterm examination for a numerical methods course. It includes 6 problems testing various numerical methods for approximating roots and derivatives of the function f(x)=2x^3-3x^2-11x+6. The problems apply techniques like Taylor series, finite differences, bisection, false position, fixed point iteration, and Newton's method to find roots and derivatives of f(x) to varying degrees of accuracy.

Uploaded by

elduke01
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views6 pages

Spring 2004 David M. Rocke EAD 115 April 27, 2004

This document contains the text of a midterm examination for a numerical methods course. It includes 6 problems testing various numerical methods for approximating roots and derivatives of the function f(x)=2x^3-3x^2-11x+6. The problems apply techniques like Taylor series, finite differences, bisection, false position, fixed point iteration, and Newton's method to find roots and derivatives of f(x) to varying degrees of accuracy.

Uploaded by

elduke01
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

University of California, Davis

Department of Applied Science

Spring 2004 Numerical Methods EAD 115


David M. Rocke April 27, 2004

Midterm Examination

NAME

For all problems on this midterm examination, we will use the function

f (x) = 2x3 − 3x2 − 11x + 6

.
1. Compute the 0 through third order Taylor series approximations of f (1) at
x = 0 (i.e., the Maclaurin series). Compute the true absolute error Et and the
approximate relative error Ea in each case, where the latter is obtained from
the change in the approximation from one iteration to the next.
Solution We have

f (x) = 2x3 − 3x2 − 11x + 6 f (0) = 6


 2
f (x) = 6x − 6x − 11 f  (0) = −11
f  (x) = 12x − 6 f  (0) = −6
f  (x) = 12 f  (0) = 12
The first four approximations of f (1) using the Maclaurin series
1 1
f (x) = f (0) + f  (0)x + f  (0)x2 + f (0)x2 + · · ·
2 6
are

fˆ0 (1) = 6
fˆ1 (1) = 6 − 11(1) = −5
fˆ2 (1) = 6 − 11(1) − (1/2)(6)(1) = −8
fˆ3 (1) = 6 − 11(1) − (1/2)(6)(1) + (1/6)(12)(1) = −6

The respective true absolute errors are 12, 1, 2, and 0, while the estimated
absolute errors of the last three are 11, 3, and 2 (the first one has no estimated
error since there is no previous approximation).
NAME 2

2. Compute approximate derivatives of f (x) at x = 1 by the forward difference,


backward difference, and centered difference methods with a step size of h =
0.1. Compare to the true derivative at x = 1 and compute the true absolute
error in the approximation. Explain this in terms of the O() of the theoretical
error in the three cases.
Solution We have

f (1) = −6
f (.9) = −4.872
f (1.1) = −7.068
f  (1) = −11

The three approximations are

(−7.068) − (−6)
fˆF (1) = = −10.68, |Et| = 0.32
0.1
(−6) − (−4.872)
fˆB (1) = = −11.28, |Et| = 0.28
0.1
(−7.068) − (−4.872)
fˆC (1) = = −10.98, |Et| = 0.02
0.2
The centered difference quotient, which has error O(h2 ), has a much smaller
true error than the forward and backward difference quotients, which have
O(h) error.
NAME 3

3. Verify by the signs of the function values that a root of f (x) lies between
0.2 and 0.7. Perform three iterations of the bisection algorithm to obtain an
approximate answer. What is the estimated absolute error in each case? If
the true root is 0.5, what is the true absolute error?
Solution Here are the iterates. Note that the first two are of opposite signs
as required:

f (0.2) = 3.696
f (0.7) = −2.484
f (0.45) = 0.62475, Et = 0.05, Ea = 0.25
f (0.575) = −0.9366, Et = 0.075, Ea = 0.125
f (0.5125) = −0.15625, Et = 0.0125, Ea = 0.0625
NAME 4

4. Using the same starting interval of 0.2 to 0.7, perform two iterations of the
false position algorithm (use 6 significant figures). What are the estimated
and true absolute errors at the second iteration?
Solution We have

f (0.2) = 3.69600
f (0.7) = −2.48400

The next root estimate is

xr = xu − f (xu )(xl − xu )/(f (xl ) − f (xu ))


= 0.7 − (−2.484)(0.2 − 0.7)/(3.696 − (−2.484))
= 0.499029

and f (0.499029) = 0.0121359. The next iteration is

xr = 0.7 − (−2.484)(0.499029 − 0.7)/(0.0121359 − (−2.484))


= 0.500006

This has |Et| = 0.000006 and |Ea| = |0.499029 − 0.500006| = 0.000977.


NAME 5

5. One can construct a fixed point iteration for a root of f (x) as follows:

0 = 2x3 − 3x2 − 11x + 6


11x = 2x3 − 3x2 + 6
x = (2x3 − 3x2 + 6)/11

Show that this will converge if the iterations are started sufficiently close to
x = 0.5. Perform two iterations of the algorithm starting at x = 1. Find the
true and estimated absolute errors in each case.
Solution This will converge when |g (x)| < 1, where g(x) = (2x3 − 3x2 +
6)/11. We have g  (x) = (6x2 − 6x)/11 = 6(x2 − x)/11. At x = 0.5, this is
(6/11)(−1/4) = −3/22 = −0.13636 < 1. All this, so long as the starting point
is near enough to 0.5.1

x0 = 1, |Et| = 0.5
x1 = 5/11 = 0.45454, |Et| = 0.04545 |Ea| = .54545
x2 = 0.50618 |Et| = 0.00618 |Ea| = .05164

1
The derivative is less than 1 in absolute value so long as the starting value is between -0.943
and 1.943, but the fixed point iteration actually converges for a larger region. There are three roots
to f (x), which are -2, 0.5, and 3. If the starting iterate is between -2 and 3, the iterations converge
to the root x = 0.5. If the starting point is larger than 3 or smaller than -2, it diverges.
6. Perform two iterations of Newton-Raphson to find a root of f (x) starting at
x = 1. Carry six significant figures. Find the true and estimated absolute
errors in each case.
Solution We have

f (x) = 2x3 − 3x2 − 11x + 6


f  (x) = 6x2 − 6x − 11

Then

x0 = 1
f (x0 ) = −6
f  (x0 ) = −11
x1 = x0 − f (x0 )/f  (x0 )
= 1 − (−6)/(−11)
= 0.454545 |Et| = 0.045454 |Ea| = 0.5454
f (x1 ) = 0.567994
f  (x1 ) = −12.48760
x2 = 0.454545 − 0.567994/(−12.48760)
= 0.500030 |Et| = 0.000030 |Ea| = 0.4548

You might also like