The Intermediate Value Theorem and

Một phần của tài liệu Calculus i tunc geveci (Trang 181 - 191)

In some cases, we can compute the exact solutions of equations on our own, or with the help of a computer algebra system. In many cases, we can obtain only approximate solutions with the help of a computational utility. The Intermediate Value Theoremfor continuous functions guarantees the existence of solutions in certain intervals. Newton’s method is the basis of many professional equation solvers, such as the one on your calculator.

The Intermediate Value Theorem

x y

a c b

fa fb

C c, fc

Figure 1: A continuous functionf attains all values betweenf(a)andf(b)

If the function f is continuous on the interval [a, b], the graph of f on the interval [a, b] is a

“continuous curve” without any gaps. Therefore, if f(a)6= f(b)and C is a number between

f(a)andf(b), the liney=C should intersect the graph off at some point(c, C), where cis betweenaandb, as in Figure 1. That is the graphical counterpart of the following theorem:

Theorem 1 (The Intermediate Value Theorem) Assume thatf is continuous on the interval[a, b],f(a)6=f(b),and thatCis a number (strictly) betweenf(a)andf(b).

Then, there existsc (a, b)such thatf(c) =C.

The Intermediate Value Theorem predicts the existence of at least one solution of the equation f(x) = C between a and b if C is an “intermediate value” between the values of f at the endpointsaandb, provided thatf is continuous on[a, b]. In particular, iff(a)and f(b)have dierent signs, the equationf(x) = 0must have a solution betweenaandb.

Corollary to the Intermediate Value Theorem Assume that f is continuous in the interval [a, b] and that f(a) and f(b) have opposite signs. Then, there exists c (a, b)such thatf(c) = 0.

x y

a c b

a, fa

b, fb

Figure 2

Figure 2 illustrates the graphical meaning of the corollary: The graph off must intersect the x-axis at some point betweenaandbiff(a)andf(b)have dierent signs andf is continuous on[a, b](there may be several such points).

We leave the proof of the Intermediate Value Theorem to a course in advanced calculus.

Note that the equationf(x) = 0 need not have a solution if f has a discontinuity, as in the following case:

Let

f(x) =

ẵ x2 if x 1, x if x >1.

The graph off is displayed in Figure 3. We havef(0) =2<0, andf(2) = 2>0, but there is no solution of the equationf(x) = 0in the interval(0,2).

1 1 2 3 x

3 2 1 1 2 3 y

Figure 3

176 CHAPTER 2. THE DERIVATIVE Iff(x)is a quadratic polynomial we have the quadratic formula for the solutions of the equation f(x) = 0. If f(x)is a polynomial of degree 3 or 4, there are formulas for the solutions, even though they are not as user-friendly and popular as the quadratic formula. A computer algebra system can give you the exact values of the solutions based on such formulas. There are no general formulas for the solution off(x) = 0, complicated or otherwise, iff(x)is a polynomial of degree higher than 4. In general, when we are faced with a high degree polynomial, we will rely on the approximate equation solver of our computational utility, as in the following example, unless some of the solutions can be determined by inspection:

Example 1 Let

f(x) =x5+ 4x26x3.

a) Plot the graph of f with the help of your calculator. Does the picture indicate that the equationf(x) = 0has a solution between 1 and 2?

b) Show that the equationf(x) = 0has a solutionrin the interval(1,2). Find an approximation torwith the help of your calculator.

Solution

a) Figure 4 indicates that the graph off intersects thex-axis at a single point between 1 and 2. Therefore, there must be one solution of the equationf(x) = 0in the interval(1,2).

2 1 1 2

x 5

10 20 30 y

Figure 4

b) We havef(1) =4<0and f(2) = 33>0, andf is continuous on[1,2]. By the Corollary to the Intermediate Value Theorem, there must be a solution of the equationf(x) = 0 in the interval(1,2). That solution is approximately1.3171, rounded to 6 signicant digits. ¤ Example 2

a) Plot the graph ofy= cos(x)and the liney= 0.4on the interval[0,2]with the help of your calculator. Show that the equationcos (x) = 0.4 has two solutions in the interval[0,2].

b) Compute approximations to the solutions of the equation cos (x) = 0.4 that belong to the interval[0,2], by making use of the approximate equation solver of your calculator.

Solution

a) Figure 5 displays the graph of cosine and the liney= 0.4on the interval[0,2].

1.2 Π 5.2 2Πx

1 0.4 1 y

ycosx y0.4

Figure 5

The picture indicates that the equation cos (x) = 0.4 has solutions near 1.2 and 5.2 in the interval[0,2]. We can conrm the existence of the solutions with the help of the Intermediate Value Theorem. We have

cos (1)= 0.540 302and cos (1.5)= 7.073 72×102,

so that cos(1) > 0.4 > cos (1.5), and cosine is continuous on the interval [1,1.5]. Therefore, there must existsc1between 1 and 1.5such thatcos (c1) = 0.4.

As for the existence of the other solution, we have

cos (4)=0.653 644and cos (5.4)= 0.634 693,

so that cos(4)<0.4<cos (5.4), and cosine is continuous on[4,5.4]. Therefore, there must exist c2between 4 and 5.4 such thatcos (c2) = 0.4.

b) We havec1= 1.15928andc2= 5.12391, rounded to 6 signicant digits. ¤

Newton’s Method

Assume that the functionf is dierentiable, so thatf is continuous, and we suspect that there is a solutionrof the equation f(x) = 0in an interval[b, c]. An initial idea about the location of a solution of the equation can be gleaned from the graph of the functionf, and numerically supported by observing thatf(x)changes sign. For example, if we notice thatf(b)< 0and f(c)>0, we know that there must be a point rbetween b and csuch that f(r) = 0, by the Corollary to the Intermediate Value Theorem. Letx0denote an “initial guess” for a solution of the equationf(x) = 0, and let

Lx0(x) =f(x0) +f0(x0) (xx0)

be the linear approximation tof based atx0. The graph ofLx0 is the tangent line to the graph off at(x0, f(x0)). Iff0(x0)6= 0, we can determine the solution of the equationLx0(x) = 0:

f(x0) +f0(x0) (xx0) = 0(xx0) =f(x0)

f0(x0) x=x1=x0 f(x0) f0(x0). Thus,x1is the point at which the tangent line intersects thex-axis.

x0 x

x1

r

Figure 6: Newton’s method follows the tangent lines

It is hoped thatx1is a better approximation to the suspected solution of the equationf(x) = 0 than the initial guessx0. The process is repeated: We determinex2as the point at which the tangent line to the graph off at(x1, f(x1))intersects thex-axis:

Lx1(x) = 0f(x1) +f0(x1) (xx1) = 0x=x2=x1 f(x1) f0(x1),

178 CHAPTER 2. THE DERIVATIVE provided that f0(x1) 6= 0. If we have already determined the points x0, x1, x2, . . . , xn, we determinexn+1as

xq+1=xqf(xq) f0(xq).

This describes Newton’s Method for the approximation of the solutions of the equation f(x) = 0. It is hoped that limnxn=r.

Newton’s method generates the sequencex0, x1, x2, . . . , xn, xn+1, . . .iteratively(or recursively).

If we set

g(x) =xf(x) f0(x) then

xq+1=g(xq), n= 0,1,2, . . . .

We will refer togasthe iteration function, and toxq as thenth iterate.

Example 3 Letf(x) =x22. The solutions of f(x) = 0 are

2 and

2. Let’s see how Newton’s method works if we start with the initial guessx0= 2for the positive solution of the equationf(x) = 0.

2 3 x

2 2 y

x02 x1

Figure 7: The rst step of Newton’s method forx22 = 0

Newton’s method generates the sequence x1, x2, . . . , xn, xn+1, . . .recursively, according to the rule

xn+1=xn f(xn)

f0(xn)=xnx22

2xn = 2x2nx2+ 2

2xn = x2n+ 2 2xn . The function

g(x) =x2+ 2 2x

is the iteration function: xn+1=g(xn),n= 0,1,2, . . ..For example, x1= x20+ 2

2x0 = 22+ 2 2 (2) = 3

2 = 1.5, x2= x21+ 2

2x1 = (1.5)2+ 2

2 (1.5) = 1.4166667.

Table 1 displays xn, n= 0,1,2,3,4, rounded to 8 signicant digits, and the absolute value of the error, i.e.,¯¯

2xn¯¯(rounded to 2 signicant digits, as usual). We have

2= 1.414 213 6,

rounded to 8 signicant digits.

n xn ¯¯

2xn¯¯

0 2 0.59

1 1.5 8.6×102

2 1.4166667 2.5×103 3 1.4142157 2.1×106 4 1.4142136 1.6×1012

Table 1

The numbers support the expectation that limnxn =

2. Notice that the absolute value of the error decreases dramatically when we carry out the Newton iterations. In the numerical analysis jargon, Newton’s method “converges rapidly”. Indeed,¯¯

2xn+1¯¯ is approximately

¡2xn¢2

for n = 2 and n = 3: The number106 is small, but¡ 106¢2

= 1012 is even smaller! The rounding of the fourth iteratex4and the rounding of the decimal expansion of

2 to 8 signicant digits results in the same decimal (even thoughx46=

2). ¤

The fast convergence that we saw in Example 3 is quite typical. Iff0(r)6= 0,f00is continuous and the initial guess x0 is suciently close tor, the points x1, x2, x3, . . . , xn, . . . generated by Newton’s methodconverge quadratically to the solutionrof the equationf(x) = 0, in the sense that

|xq+1r| C(xqr)2

whereC is a constant that depends on the functionf, the solutionroff(x) = 0, and the initial guessx0. The analysis that leads to such an error estimate belongs to a post-calculus course.

In practice, one needs a stopping criterion in the implementation of Newton’s method. The simplest criterion is to stop when two successive iterates dier by a number which is less than a given “error tolerance”. Thus, we may stop at xn if |xn+1xn|< , where is a positive number such as5×107and represents the error tolerance. Usually, this ensures that|xnr|is approximately, whereris the relevant solution of the equationf(x) = 0. The approximation xn+1is even better.

Example 4 Letf(x) = cos(x) + cos(3x). Figure 8 displays the graph off on[0, ].

1 Π x

2 1 1 2 y

Π4

Figure 8 We have

f

³ 4

´= cos³ 4

´+ cos 3

4

= 2

2

2 2 = 0,

and/4= 0.785 398. Apply Newton’s method to the equation f(x) = 0, with the initial guess x0= 1. Continue the iterations until|xn+1xn| 103. Compare|xn/4|and|xn+1/4| with103. Do the numbers support the usual quadratic convergence of Newton’s method?

180 CHAPTER 2. THE DERIVATIVE Solution

The iteration function is g(x) =x f(x)

f0(x)=x cos(x) + cos(3x)

sin (x)3 sin (3x)=x+ cos(x) + cos(3x) sin (x) + 3 sin (3x), so thatxn+1=g(xn),n= 0,1,2, . . ..

Table 2 displaysxn and|xn/4|forn= 0,1,2,3,4, and|xn+1xn|forn= 0,1,2,3. We see that|xn+1xn|is a good indication of the absolute error in the approximation of/4 by xn forn= 1,2,3. The numbers are consistent with the quadratic convergence of Newton’s method:

|xn+1/4| = (xn/4)2forn= 2and n= 3. ¤

n xn |xn+1xn| |xn/4| 0 1 3.6×101 2.1×101 1 .644466 1.3×101 1.4×101

2 .775045 102 102

3 .785296 104 104

4 .785 398 108

Table 2

We can use Newton’s method in order to approximate solutions of equations that are not given in the formf(x) = 0initially:

Example 5 Determine the approximate values ofx such that the graphs of y = sin (x) and y=x/2intersect at the corresponding points, with the help of Newton’s method. Continue with the iterations until the absolute value of the dierence between successive iterates is at most 104. Treat the approximate solutions that you obtain with the help of the equation solver of your computational utility as exact, and determine the absolute errors of the Newton iterations.

Solution

Figure 9 displays the graphs ofy= sin (x)andy=x/2. The picture indicates the existence of rnear 2 such that the graphs intersect at the corresponding point. Due to the symmetry with respect to the origin (conrm), there is another point of intersection corresponding tor. We will approximater.

2 2

Π Π x 1

1 y

yx2

ysinx

Figure 9

We must set the stage for the implementation of Newton’s method. We have sin (x) = x

2 x

2 sin (x) = 0.

We will set

f(x) = x

2 sin (x),

and use Newton’s method to approximate the positive solution off(x) = 0. Figure 10 shows the graph off. The picture indicates the existence of a unique solutionrof the equationf(x) = 0 near 2 (you can conrm this with the help of the Intermediate Value Theorem, as in Example 1).

2 2 x

1 1 y

fxx 2sinx

Figure 10

Let’s pickx0 as2.5to test Newton’s method for the approximation of the solution off(x) = 0 near 2 (if we choose 2 as the initial guess, the method converges so fast that we won’t be able to display numbers that illustrate the convergence of Newton’s method!). The iteration function is

g(x) =x f(x) f0(x) =x

x

2sin (x) 1

2cos (x) ,

so thatxn+1=g(xn)forn= 0,1,2, . . .. We have r= 1.895 49, rounded to 6 signicant digits.

Table 3 displaysxn and|xnr|forn= 0,1,2,3,4, and|xn+1xn|for n= 0,1,2,3(as usual, dierences are rounded to 2 signicant digits).The numbers indicate that|xn+1xn|is a good measure of the accuracy with whichxnapproximates the exact solutionr. The numbers|x3r| and|x4r|support the quadratic convergence of Newton’s method. ¤

n xn |xn+1xn| |xnr|

0 2.5 5×101 6×101

1 1.999 27 9.8×102 101 2 1.900 92 5.4×103 5.4×103 3 1.895 51 1.7×105 1.7×105

4 1.895 49 1.7×1010

Table 3

The above examples showed that Newton’s method can be very eective for the approximation of solutions of equations. Nevertheless, let’s take a look at some examples which show that we must be prepared for the occasional sub-optimal performance, even the failure of Newton’s method.

The sequence generated by Newton’s method may converge to a solution r of the equation f(x) = 0even iff0(r) = 0, but the rate of convergence may not be as fast as in the case ofr such thatf0(r)6= 0, as in the following example.

182 CHAPTER 2. THE DERIVATIVE Example 6 Letf(x) = cos2(x). A solution of the equation f(x) = 0is/2. The derivative off is 0 at /2 (conrm). Still, we can test the implementation of Newton’s method for the approximation of the solution/2of the equationf(x) = 0.

Let us setx0= 1. The iteration function is g(x) =x f(x)

f0(x) =x cos2(x)

2 cos (x) sin (x)=x+ cos (x) 2 sin (x).

x 1

y

Π 2

Figure 11: y= cos2(x)

Table 4 displaysxnand|xn/2|forn= 1,2, . . . ,7. The numbers are indicative of convergence (/2 = 1.5708), but the evidence is not as overwhelming as in the previous examples. The numbers are not indicative of quadratic convergence: Even though|xn+1/2|is smaller than

|xn/2|,|xn+1/2|is not comparable to(xn/2)2. ¤ n xn |xn/2| 1 1.32105 0.25 2 1.44858 0.12 3 1.51 6×102 4 1.54043 3×102 5 1.55562 1.5×102 6 1.56321 7.6×103 7 1.567 3.8×103

Table 4

Example 7 An implementation of Newton’s method may generate points that diverge to in- nity:

Let

f(x) = x 1 +x2 The only solution of the equationf(x) = 0is 0.

Let’s test Newton’s method by takingx0= 2as the starting point. We have f0(x) = d

dx x

1 +x2

=

¡1 +x2¢ 2x2

(1 +x2)2 = 1x2 (1 +x2)2. Therefore, the iteration function is

g(x) =x f(x) f0(x)=x

x 1 +x2 1x2 (1 +x2)2

=xx¡1 +x2¢ 1x2 .

Table 5 displaysxnforn= 2,4,6,8,10. The numbers indicate that the sequencexn diverges to innity (you may calculate more points if you are skeptical).

n xn 2 11.055 3 4 44.676 6 178.816 8 715.292 10 2861.18

Table 5

A picture such as Figure 12 provides further evidence of divergence. ¤

x 1

x0 x1 x2

Figure 12: The Newton iterations may diverge to innity

Problems

[C]In problems 1-4,

a) Make use of the corolary of the Intermediate Value Theorem to show that the equation f(x) = 0has a solution in the intervalJ.

b) Make use of your graphing and computational utility to nd approximations to all solutions of the equationf(x) = 0 in the intervalJ. Display 6 signicant digits.

1.

f(x) =x 1

x2+ 4, J = [1,1]. 2.

f(x) = 11 2x2+ 1

24x4, J= [1,2]. 3.

f(x) = sin (x) +1

3cos (3x), J = [2,4]. 4.

f(x) = sin2(x) + 2 cos3(x), J = [3,1]

[C]In problems 5-8,

a) Make use of your graphing utillity in order to plot the graph off on the intervalJ and to determine the approximate locations of the solutions of the equationf(x) = 0inJ.

b) Make use of Newton’s method to determine approximations to the solutions of the equation f(x) = 0 in the interval J. Stop the iterations when the absolute value of the dierence between two iterations is less than104. Assuming that your computational utility provides exact solutions, calculate the absolute error in the approximations.

184 CHAPTER 2. THE DERIVATIVE 5.

f(x) =x35x28x+ 40, J = [1,6]

6.

f(x) =x417x2+ 50, J = [1,4]

7.

f(x) =f, J= [0,2]

8.

f(x) = tan (x) +x2, J = [2,4]

In problems 9 and 10,

a) Make use of your graphing utillity in order to plot the graphs of f and gon the interval J and determine the approximate locations of the solutions of the equationf(x) =g(x)inJ. b) Make use of Newton’s method to determine approximations to the solutions of the equation f(x) = g(x) in the interval J. Stop the iterations when the absolute value of the dierence between two iterations is less than104.

9.

f(x) = 1

x2+ 1, g(x) =x3, J= [2,2]

10.

f(x) = 1

12 cos (x), g(x) = 1

2sin (x), J = [3,5]

Một phần của tài liệu Calculus i tunc geveci (Trang 181 - 191)

Tải bản đầy đủ (PDF)

(540 trang)