P. 1
ch10

ch10

|Views: 3|Likes:
Published by Andrés Karabin

More info:

Published by: Andrés Karabin on Oct 16, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/01/2016

pdf

text

original

CHAPTER 10

Numerical Methods

Ü10.1. Taylor Approximation
Suppose that f is a function defined in a neighborhood of a point c, and suppose that f has derivatives of all orders near c. In Chapter 9.5 we introduced the Taylor polynomials for f : Definition 10.1 The Taylor polynomial of degree n of f , centered at c is (10.1)
´Tc
´nµ

f µ´xµ

k 0

n

f ´k µ ´ c µ k ´x   cµ k!

We discovered these polynomials by looking for the best polynomial approximation to f . Proposition 10.1 The Taylor polynomial Tc´nµ f is the polynomial of degree n or less which approximates f near c to nth order. In this section, we shall show how the Taylor polynomials effectively approximate the function f . Thus we need information on the error incurred by these approximations. This also was given in the previous section: Proposition 10.2 Suppose that f is differentiable to order n · 1 in the interval c   a c · a centered at the point c. Then the error in approximating f in this interval by its Taylor polynomial of degree n, Tc´nµ f is bounded by (10.2) Mn·1 x   c n·1 ´n · 1 µ!

where Mn·1 is a bound of the values of f ´n·1µ over the interval c   a c · a . To be precise, we have the inequality (10.3) f ´xµ   Tcn f ´xµ Mn·1 ´n · 1µ! x   c n·1 for all x between c   a and c · a

147

just be careful with signs. Furthermore. The argument for any n just bootstraps from this. So.9) f ´xµ   Tc´nµ f Mn·1 x n·1 ´n · 1µ! If this error estimate converges to 0 as n (10. let us see how it comes about. Suppose that f ´0µ 0 f ¼ ´0µ 0 f ´nµ ´0µ 0. First. Applying the lemma to g. we have the desired result: (10. Mn·1 . Thus g´n·1µ has the same bound. so we know that (10.10) in the interval c   a c · a . we go to the proposition itself. Let g f   Tc´nµ f Then g satisfies the hypotheses of the lemma. the same argument works for x negative. Now that the lemma is verified. Then (10. We have f ¼¼ ´sµ f ¼ ´t µ 0 t Mn·1 x n·1 ´n · 1µ! M2 for all s 0 t 0 s M2 x. we just have to be careful with the signs. a preliminary step: Lemma. we have f ¼¼ ´sµds f ¼¼ ´sµ ds ds 0 M2t (10. its ´n · 1µth derivative is identically zero. we shall take c to be the origin. To simplify the notation.8) f ´xµ 0 f ¼ ´t µdt 0 x f ¼ ´t µ dt 0 x Mn·1 n t dt n! Mn·1 t n·1 n! n · 1 Mn·1 x n·1 ´n · 1µ! The argument for x 0 is the same.7) f ¼ ´t µ Mn·1 t n! n for all t in the interval  a a (We have Mn·1 because the nth derivative of f ¼ is the ´n · 1µth derivative of f ). Now we argue independently on each side of 0: for x 0: x (10.5) But now.4) Let’s show the case n (10. since Tc´nµ f is a polynomial of degree n.6) f ´xµ 0 f ¼ ´t µdt 0 x f ¼ ´t µ dt 0 x M2tdt M2 x2 2 Of course. Suppose we have gotten to the (n   1)th case. proceeding from the estimate for n   1 to the estimate for n (this is called a proof by induction). f ´x µ ∞.Chapter 10 Numerical Methods 148 Before using this estimate. x f ´xµ 1. for any t 0 t t x. Then the lemma applies (at n   1) to the derivative f ¼ . then we saw that f is be represented by its Taylor series: n 0 ∑ ∞ f ´nµ ´cµ n ´x   cµ n! .

let’s review what has to be done. Then we have to calculate the values of (10.18) n 6: E ´6 µ Thus.16) n 4: E ´4µ (10. To use the Taylor polynomials to find approximate values to a function. Then we calculate using the Taylor polynomial of degree n   1. We have. This is e1 2 .19) T05 ´ex µ´1 2µ 1· 1 11 11 1 1 1 1 · · · · 2 2 4 6 8 24 16 120 32 1 6487 Example 10. Now we estimate the error at stage n which we’ll call E ´nµ.13) n 1: (10.12) E ´nµ 3 1 n ´ µ n! 2 E ´1µ 3 2 31 24 31 68 3 1 24 16 3 48 3 384 7 8 ¢ 10 4 10 4 for successive values of n until we have found one which is within the desired error.1 Find e to within an error of 10 4 .Ü10. Here we start with the Maclaurin series for sin x: (10. we can use the Maclaurin series for ex and the bounds Mn e1 . Since 3 is more manageable than e.14) n 2: E ´2 µ (10. Since f ´nµ ´xµ ex for all n. we have our estimate to within 10 4 by taking the fifth Taylor polynomial: (10.11) Mn x c n n! Example 10. we first have to find bounds Mn for the successive derivatives of the function.20) sin x x  x3 6 · x5 · ¡¡¡ 120 .17) n 5: E ´5µ 3 1 120 32 3 1 720 64 (10. Ô (10. we take Mn 3. so we look at the function f ´xµ ex . and the value x 1 2 is within 1 of 0. in this example (10.1 Taylor Approximation 149 Before doing some examples.2 Find sin π 8 to within an error of 10 3.15) n 3: E ´3 µ (10.

We (10.3 Use the Maclaurin series (10. First we calculate the successive derivatives of f ´xµ ln´1 · xµ to obtain the bounds Mn . But if a get this inequality until n 12. if the series has a factorial in the denominator.27) ln´1 · xµ n 1 ∑ ´ 1µn·1 n ∞ xn to estimate ln´1 · aµ for a 0 to within 4 decimal places.22) n 1: E ´1 µ π 8 1 π 2 ´ µ 2 8 1 π 3 ´ µ 6 8 1 π 4 ´ µ 24 8 3927 (10. so we’ll need 11 terms of the series. Example 10. As a rule. correct to three decimal places. then the estimate occurs at n 4. for x a: ´n   1µ! n a E ´n µ n! If a 1 10.24) n 3: E ´3µ 010 (10. we may take Mn need to choose n large enough that the Taylor error estimate E ´nµ satisfies (10.29) ´n f ´nµ ´xµ ´  1µn 1´n   1µ!´1 · xµ n an n 10 4 1 2. Thus we need. . this technique will work efficiently.Chapter 10 Numerical Methods 150 Since the derivatives of sin x alternate between ¦ sin x and ¦ cos x.21) E ´nµ 1 π n ´ µ n! 8 1  3 10 2 1 for all n. otherwise.28) so we can take Mn (10. we don’t   1µ!. it will not. The estimate is T03 ´sin xµ´π 8µ π 8   1 ´ π µ2 6 8 3826 383.23) n 2: E ´2µ 077 (10.25) so we need only go to n (10.26) or sin´π 8µ n 4: E ´4 µ 0009 3. We have (10. Some Taylor series converge too slowly to get a reasonable approximation by just a few terms of the series. so the first three terms will do.

with f ´aµ (relatively) we start with the function y close to zero. The important point is to start with a decent guess for x0 . and have found an approximation x a. Newton’s method thus.32) x2 2 8333   ´2 8333µ2   8 2 ¡ 2 8333 2 8284 . if the successive approximations are getting closer and closer together.30). This intersects the x-axis where y 0. If it is not good enough. Newton’s method Suppose that we want to estimate the solution of the equation f ´xµ 0. until the result is good enough. and we’ll have to start with a better estimate. and continue until we reach stability in the first 4 decimal places: (10.4 Find 8 correct to within 4 decimal places. so we have (10. Newton’s idea is that. over and over again. This process is illustrated in figure 10.2 x0 x1 x2 x1 x0 x0 x1 x2 Ü10. Let’s start with x0 3. since the tangent line approximates the graph. it doesn’t always work so well. That is our first approximation. Since 32   8 2 8333 2¢3 We now use this in the recursion. If not. there is no problem: we just look for the point at which the line crosses the x-axis.1. and the equation of the tangent line is y   f ´aµ f ¼ ´aµ´x   aµ. and repeat the process.2 Figure 10. why not take as the estimate the point at which the tangent line f ´x0 µ.2 shows.30)   f ´aµ f ¼ ´aµ´x   aµ which has the solution x f ´aµ a  ¼ f ´a µ We now replace a by this value. Here we want to find the root of the equation f ´xµ x2   8 ¼ ´xµ 2x. the process won’t work at all. so that we start in a range of the function where the concavity of the curve forces convergence of these successive approximations. then we’re through. that is.31) x1 3  Ô 0. the next estimate is f (10. If we have started with an estimate which is too far off. Suppose f ´xµ. is a technique for replacing an approximation by a better one. to make sense of this. and repeat the process. let’s start at some value x0 and calculate y0 If that is 0. The slope of the tangent line at x a is f ¼ ´aµ. as figure 10.2. If this is a linear equation. This is called a recursion given by the recursion formula (10. Example 10.Ü10. then we can stop as soon as they are within e of each other. let x1 be the point at which the tangent line at ´x0 y0 µ crosses the x-axis.1 Newton’s method 151 Figure 10. replace x0 with x1 . crosses the x-axis? Well. However. How do we know when we are within an error e of the solution? If the process is working.

and the graph is as shown in figure 10. another larger than 2.5 Find the solutions of f ´xµ x3   12x · 1 0 to three decimal places.35) x1 08333   ´ 0  1  12 1 12 08333 (10. Now. 4. Before going on to other examples. x2 x0 x1 First.38) x1 3  33   12´3µ · 1 3´32 µ   12 3   8 15 3 5333 . Calculate the recursion relation (10. to find the solution larger than 2. we have f ¼ ´3µ 15.36) (10. But if we take x0 3..34) x¼ f ´xµ x  ¼ f ´x µ 0: Example 10. At x 0. find the solution near zero. so the recursion should work. We find (10. since the derivative is 0 there. and a third less than -2. so that f ´x0 µ is small and f ¼ ´x0 µ is large. it will not do to take x0 2. one close to 0. We have f ¼ ´xµ 3x2   12.3. Figure 10. 5. There are three solutions.3: Graph of y x3   12x · 1 3. Calculate f ¼ ´xµ. so the local maximum and minimum of y f ´xµ are at (-2.17). First we graph the function so as to make an intelligent first estimate. -15). (2. a nice large number.Chapter 10 Numerical Methods 8284µ2   8 2 ¡ 2 8284 152 (10. Repeat step 4 until the successive estimates are no further from each other than the desired estimate. Now we calculate successive estimates: (10. Select a first estimate x0 .37) x2 08333µ3   12´ 08333µ · 1 3´ 08333µ2   12 x3 08338 08338 so this solution is x 08338 up to four decimal places. Find x1 from x0 by taking x x0 x¼ x1 in the recursion relation. so we can take our first estimate to be x0 0. we summarize the process: To solve f ´xµ 1. 2. y 1.33) x3 2 8284   ´2 2 8284 which we conclude is the estimate accurate to 4 decimal places. We see from the graph that the derivative is well away from zero in a range including x 0 and the solution.

3 (10. we first review the definition of the definite integral. No formula for the integral exists in any integral tables. For example f ´xµ 1 · x .44) ∑ f ´x¼i µ∆xi where ∆xi is the length xi   xi 1 of the ith interval. Since the derivative is increasing. x¼ is any point on that interval. and approximate the definite integral by the approximating sums. so that the convergence is slower than in the preceding examples.3. we have to return to the definition of the integral. However. Notice that in this range.40) x3 3 4215 so this is the answer correct to four decimal places.43) a x0 x1 ¡¡¡ n 1 xn 1 xn b of points in the interval. we find the 1. In the same way.41) x¼ x  ex   x   2 ex   1 e x ´x   1 µ · 2 ex   1 We now calculate the successive estimates: (10. Numerical Integration We have learned techniques for calculating definite integrals which are based on finding antiderivatives of the function to be integrated.2 Let y f ´xµ be a function defined on the interval a b .4). starting at x0 third solution. . Here f ´xµ ex   x   2 f ¼ ´xµ ex   1.6 Solve ex x · 2 correct to three decimal places.  3.42) x1 1 16395 x2 1 1464 x3 1 1462 x4 1 1462 so this is the desired estimate. Definition 10. and greater than 1 at x and f ´1µ 0. the derivative is not very large.Ü10. and ∑ indicates that i we add all these products together (see Figure 10. So. Ü10. in many cases we cannot find an expression for the antiderivative. In such a case. while f ´2µ 0. a good first estimate will be any number between 1 and 2.39) x2 3 5333   Numerical Integration 5333µ3   12´3 5333µ · 1 3´3 5333µ2   12 x4 3 4215 153 ´3 3 4267 (10. Ô 3 and these techniques will not lead to an answer. take x0 The recursion is (10. A partition of the interval is any increasing sequence (10. To explain this. The definite integral is defined as follows. 1. Example 10. The corresponding approximating sum is (10.

and form the sum (10. we can approximate a definite integral by the sums (10.47) 1 · x3dx this way. One way to accomplish this is the following. denoted b (10.46) ∑ f ´xi µ∆xi 1 N ´b   aµ N N 1 ∑ f ´xi µ ´Approximating Rectanglesµ 1Ô 0 Example 10.8 Just to see how well this method is working. Pick an integer N.49) ´´1 1µ · ´1 2µ · ´1 3µ · ¡¡¡ ´2µ µ 10 . If we take more subdivisions. let us use it to approximate 1 x1 4 dx. and divide the interval a b into N subintervals. by computer .7 Let’s find an approximate value for into 10 subintervals. we get a better approximation. this limit is the definite integral of f over the interval a b . Then the sum (10. all of size ´b   aµ N.44). It is a good idea to try these using a spreadsheet. which we know to be ´22 4   1µ ´2 4µ 1 782513 . For example.completely trivial. Let’s divide the interval Ô Ô Ô 1 Ô ´ 1 · ´1 10µ3 · 1 · ´2 10µ3 · 1 · ´3 10µ3 · ¡¡¡ 1 · ´10 10µ3µ 10 1 ´1 0005 · 1 0040 · 1 0134 · 1 0315 · 1 0607 · 1 1027 · 1 1589 10 ·1 2296 · 1 3149 · 1 4142µ 1 1330 Of course these calculations are tedious if done by hand. evaluate the function at the right endpoint xi .Chapter 10 Numerical Methods 154 Figure 10. The approximating sum is 1 14 14 14 14 (10.4: Approximation to the area under a curve. if we take N 100 we get (10.46) is (10. Let’s first take N 10. but.48) Ô Ô 1 Ô ´ 1 · ´1 100µ3 · 1 · ´2 100µ3 · 1 · ´3 100µ3 · 100 Ô ¡¡¡ 1 · ´100 100µ3µ 1 113528 2 an apparently better approximation. Example 10.45) a f ´xµdx Thus. because there you get to follow the computation. For each subinterval. y f ´xµ a b If these approximating sums approach a limit as the partition becomes increasingly fine (the lengths of the subdivisions go to zero).

First.10 N Let’s compare the estimates of 0 x1 4 dx with these two new methods.5 y f ´xµ a b This comes down to (10. note that we have estimated the integral in each subinterval by the area of the rectangle of height at the right endpoint. it makes sense that this is a better estimate.Ü10. First. this leads to the rule (10. If instead we estimate this area using the trapezoid whose upper side is the line segment joining the two endpoints (see figure 10.790712.53) 1 · x3 dx using the Trapezoidal rule and N 10 gives us Ô Ô  Ô 1 ´1 · 2 1 · ´1 10µ3 · 1 · ´2 10µ3 · 1 · ´3 10µ3 · ¡¡¡ 20 Ô ¡ Ô · 1 · ´9 10µ3 · 2µ   ¡ 1 ´1 · 2 1 0005 · 1 0040 · 1 0134 · ¡¡¡ · 1 2296 · 1 3149 20 ·1 4142µ 1 0123 1 Example 10. For N We can improve this method by improving the estimate in each subinterval.50) 1 ´1 1427 · 1 2908 · 1 4438 · 1 6017 · 1 7641 · 1 9309 · 2 1020 · 10 2 2771 · 2 4562 · 2 6390µ 1 8648 100 we obtain the estimate 1. we might replace the upper curve by the best parabolic approximation. For N even. but not great.3 Numerical Integration 155 (10.9 The calculation of (10. and the trapezoid rule: (10. Figure 10.5). which is better.54)   ¡ 1 14 14 14 14 14 ·2 ´1 · 2 ´1 1µ · ´1 2µ · ´1 3µ · ¡¡¡ ´1 9µ 20 .51) ´b 2N   aµ ´ f ´aµ · 2 N 1 f ´x µ · f ´bµµ ∑ 1 i ´Trapezoid Ruleµ Going one step further. with 10.52)   aµ ´ f ´aµ · 4 f ´x µ · 2 f ´x µ · 4 f ´x µ · ¡¡¡ · 4 f ´x µ · f ´bµµ 1 2 3 N  1 3N Let us now do the above examples using these two rules: ´b 1Ô 0 ´Simpson ¼ s Ruleµ Example 10.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->