Figure 1.3 Tha graphs of y-e and y-P,(=1+x. Figure 1. 3 The graphs of y= e and y= Pi(a)=1+a Corollary 1.1. If PN(a) is the Taylor polynomial of degree N given in Theorem 1. 1. then (3.6) Proof. Set r = To in equation(1.2)and(1.3), and the result is Pn(ro)=f(ro). Thus statement(1.6) is true for k =0. Now differentiate the right-hand side of (1.2) and get PN()=yf()(ro) f(+1)(xo) (h O)(x-x0)k-1 kl (3.7) Set a=ro in(1.7) to obtain PN(ro)=f(ro). Thus statement(1.6) is true for k=1 Successive differentiations of(1.7)will establish the other identities in(1.6). The detail are left as an exercise Applying Corollary 1. 1, we see that y= P2(a)has the properties f( o)=P2( o), f(ro) P2(o), and f"(ro)=P2(o); hence the graphs have the same curvature at To. For ey ample, consider f(r)=e and P2()=1+r+x/ 2. The graphs are shown in Figure 1. 4 and it is seen that they curve up in the same fashion at(0, 1) Figure 1. 4 The graphs of yae and yP2(x-1+**xr2
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −1 0 1 2 3 4 5 6 7 8 Figure 1.3 The graphs of y=ex and y=P1 (x)=1+x. x y y=ex y=P1 (x) Figure 1.3 The graphs of y = e x and y = P1(x) = 1 + x. Corollary 1.1. If PN (x) is the Taylor polynomial of degree N given in Theorem 1.1, then P (k) N (x0) = f (k) (x0) for k = 0, 1, . . . , N (3.6) Proof. Set x = x0 in equation (1.2) and (1.3), and the result is Pn(x0) = f(x0). Thus statement (1.6) is true for k = 0. Now differentiate the right-hand side of (1.2) and get P 0 N (x) = X N k=1 f (k) (x0) (k − 1)!(x − x0) k−1 = N X−1 k=0 f (k+1)(x0) k! (x − x0) k . (3.7) Set x = x0 in (1.7) to obtain P 0 N (x0) = f 0 (x0). Thus statement (1.6) is true for k = 1. Successive differentiations of (1.7) will establish the other identities in (1.6). The details are left as an exercise. Applying Corollary 1.1, we see that y = P2(x) has the properties f(x0) = P2(x0), f0 (x0) = P 0 2 (x0), and f 00(x0) = P 00 2 (x0); hence the graphs have the same curvature at x0. For example, consider f(x) = e x and P2(x) = 1 + x + x 2/2. The graphs are shown in Figure 1.4 and it is seen that they curve up in the same fashion at (0, 1). −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 0 1 2 3 4 5 6 7 8 Figure 1.4 The graphs of y=ex and y=P2 (x)=1+x+x2 /2. x y y=ex y=P2 (x) y=P2 (x) y=ex 8
Figure 1.4 The graphs of y=e and y= P2(a)=1+2+2/ 2 In the theory of approximation, one seeks to find an accurate polynomial approxima- tion to the analytic function2 f(a)over [ a, b]. This is one technique used in developing computer software. The accuracy of a Taylor polynomial is increased when N large. The accuracy of any given polynomial will generally decrease as the value of . r moves away from the center o. Hence we must choose N large enough and restrict the maximum value of r- o so that the error does not exceed a specified bound. If we choose the interval width to be 2R and To in the center (i.e, lr -rol R), the absolute value of the error satisfies the relation error=|EN(x)≤ MRN+ (N+1)! where m≤max{f(+1(2):xo-R≤z≤xo+R}. Ifn is fixed and the derivatives ormly bounded, the error bound in(1.8)is proportional to R +/(N+1)! and decreases if R goes to zero as n gets large. Table 1.3 shows how the choices of these two parameters affect the accuracy of approximation e a PN(a)over the interval r< r The error is smallest when N is largest and R smallest. Graphs for P2, P3 and P4 are given in Figure 1.5 Table 1.3 Values for the Error Bound error eRN+/(N + 1)! Using the Ap- proximation e N PN(a) for r R=20,R=1.5,R=1.0,R=0.5, |≤20x≤1.5|x≤ x≤0.5 e≈P(x)0.656804990.070901720.003773900078 e2≈P(x)0.8765837|0.015193231009300016 e≈P(x)0.046914640.002848730.0004240000006 e≈P(x)0010425480007900001900000 1.5 The graphs of yue, yup? o) yPa o and yP,O The function f(a) is analytic at ro if it has continuous derivatives of all orders and can be repre- sented as a Taylor series in an interval about o
Figure 1.4 The graphs of y = e x and y = P2(x) = 1 + x + x 2/2. In the theory of approximation, one seeks to find an accurate polynomial approximation to the analytic function2 f(x) over [a, b]. This is one technique used in developing computer software. The accuracy of a Taylor polynomial is increased when we choose N large. The accuracy of any given polynomial will generally decrease as the value of x moves away from the center x0. Hence we must choose N large enough and restrict the maximum value of |x − x0| so that the error does not exceed a specified bound. If we choose the interval width to be 2R and x0 in the center (i.e., |x − x0| < R), the absolute value of the error satisfies the relation |error| = |EN (x)| ≤ MRN+1 (N + 1)!. (3.8) where M ≤ max{|f (N+1)(z)| : x0 − R ≤ z ≤ x0 + R}. If N is fixed and the derivatives are uniformly bounded, the error bound in (1.8) is proportional to RN+1/(N + 1)! and decreases if R goes to zero as N gets large. Table 1.3 shows how the choices of these two parameters affect the accuracy of approximation e x ≈ PN (x) over the interval |x| ≤ R. The error is smallest when N is largest and R smallest. Graphs for P2, P3 and P4 are given in Figure 1.5. Table 1.3 Values for the Error Bound |error| < eRRN+1/(N + 1)! Using the Approximation e x ≈ PN (x) for |x| < R R = 2.0, |x| ≤ 2.0 R = 1.5, |x| ≤ 1.5 R = 1.0, |x| ≤ 1.0 R = 0.5, |x| ≤ 0.5 e x ≈ P5(x) 0.65680499 0.07090172 0.00377539 0.00003578 e x ≈ P6(x) 0.18765837 0.01519323 0.00053934 0.00000256 e x ≈ P7(x) 0.04691464 0.00284873 0.00006742 0.00000016 e x ≈ P8(x) 0.01042548 0.00047479 0.00000749 0.00000001 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −1 0 1 2 3 4 5 6 7 8 Figure 1.5 The graphs of y=ex , y=P2 (x), y=P3 (x) and y=P4 (x). x y y=ex y=P4 (x) y=P3 (x) y=P2 (x) 2The function f(x) is analytic at x0 if it has continuous derivatives of all orders and can be represented as a Taylor series in an interval about x0. 9
Figure 1. 5 The graphs of y =e, y= P2(),y= P(), and y= P(a) Example 1.2 Establish the error bounds for the approximation e a Ps(ar)on each of the intervals r≤10andx|≤0.5 If =|< 1.0. then letting R=1.0 and Ife)(c)l=lecl M in(1. 8)implies error=|Es(x)≤ 10(1.0) 9!≈0.00004 If =| <0.5, then letting R=0.5 and If9(c)l= le l <e0.s=M in(1. 8)implies that error=|E(x)≤ (0.5)9 ≈0.00000001 Example 1.3. If f(r)=er, show that N=9 is the smallest integer, so that the error= EN(a)l < 0.0000005 for x in [-1, 1]. Hence P9(r) can be used to compute approximate value of e that will be accurate in the sixth decimal place We need to find the smallest integer n so that erro =|E(x)s(1)M+1 (N+1)! ≈0.0000005 igure 1. The graph of the eoryox-e-Pg(). y=E间x Figure 1.6 The graph of the error y= Eg(a)=e-Pg(a) In Example 1.2 we saw that N=& was too small, so we try N=9 and discover that EN(a)se(1)9+/(9+1)!<0.000000749. This value is slightly larger than desired hence we would be likely to choose N=10. But we used ec< e as a crude estimate in finding the error bound. Hence 0.000000749 is a little larger than the actual error Figure 1.6 shows a graph of Eg(ar)=e-Pg(ar). Notice that the maximum vertical range is about 3 x 10 and occurs at the right end point (1, Eg(1)). Indeed, the maximum error on the interval is Eg(1)=2.718281828-2718281526 N 3.024 x10. Therefore, N=9 is justifi
Figure 1.5 The graphs of y = e x , y = P2(x), y = P3(x), and y = P4(x). Example 1.2 Establish the error bounds for the approximation e x ≈ P8(x) on each of the intervals |x| ≤ 1.0 and |x| ≤ 0.5. If |x| ≤ 1.0. then letting R = 1.0 and |f (9)(c)| = |e c | ≤ e 1.0 = M in (1.8) implies that |error| = |E8(x)| ≤ e 1.0 (1.0)9 9! ≈ 0.00000749. If |x| ≤ 0.5, then letting R = 0.5 and |f (9)(c)| = |e c | ≤ e 0.5 = M in (1.8) implies that |error| = |E8(x)| ≤ e 0.5 (0.5)9 9! ≈ 0.00000001. Example 1.3. If f(x) = e x , show that N = 9 is the smallest integer, so that the |error| = |EN (x)| ≤ 0.0000005 for x in [−1, 1]. Hence P9(x) can be used to compute approximate value of e x that will be accurate in the sixth decimal place. We need to find the smallest integer N so that |error| = |EN (x)| ≤ e c (1)N+1 (N + 1)! ≈ 0.0000005. −1.5 −1 −0.5 0 0.5 1 1.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 x 10−5 Figure 1.6 The graph of the error y=E9 (x)=ex−P9 (x). x y y=E9 (x) Figure 1.6 The graph of the error y = E9(x) = e x − P9(x). In Example 1.2 we saw that N = 8 was too small, so we try N = 9 and discover that |EN (x)| ≤ e 1 (1)9+1/(9 + 1)! ≤ 0.000000749. This value is slightly larger than desired; hence we would be likely to choose N = 10. But we used e c ≤ e 1 as a crude estimate in finding the error bound. Hence 0.000000749 is a little larger than the actual error. Figure 1.6 shows a graph of E9(x) = e x−P9(x). Notice that the maximum vertical range is about 3 × 10−7 and occurs at the right end point (1, E9(1)). Indeed, the maximum error on the interval is E9(1) = 2.718281828 − 2.718281526 ≈ 3.024 × 10−7 . Therefore, N = 9 is justified. 10
3.1.1 Methods for Evaluating a Polynomial There are several mathematically equivalent ways to evaluate a polynomial. Consider for example, the function f(x)=(x-1)3 (3.9) The evaluation of f will require the use of an exponential function. Or the binomial formula can be used to expand f(a) in powers of a 0-()+y=2+2++2-+10 Horner's method(see Section 1. 1), which is also called nested multiplication, can be used to evaluate the polynomial in(1.10). When applied to formula(1.10), nested multiplication permits us to write f(x)=(-8)x+28)x-56)x+70)x-56)x+28)x-8)x+1.(3.11) To evaluate f(ar) now requires seven multiplications and eight additions or subtrac tions. The necessity of using an exponential function to evaluate the polynomial has now been eliminated We end this section with the theorem that relates the Taylor series in Table 1.1 and the polynomials of Theorem 1.1 Theorem 1.2(Taylor Series). Assume that f(ar) is analytic and has continuous derivatives of all order N=1.2 · on an interva ral(a, b)containing To. Suppose that the Taylor polynomial(1.2) tend to a limit S(a)=lim PN(a)=lim (a-co) k=0 k! then f(a) has the Taylor series expansion Proof. This follows directly from the definition of convergence of series in Section 1.1 This limit condition is often stated by saying that the error term must go to zero as N goes to infinite. Therefore, a necessary and sufficient condition for(1.13)to hold is that lim EN(a)=lim 3.14) where c depends on N and a 11
3.1.1 Methods for Evaluating a Polynomial There are several mathematically equivalent ways to evaluate a polynomial. Consider, for example, the function f(x) = (x − 1)8 . (3.9) The evaluation of f will require the use of an exponential function. Or the binomial formula can be used to expand f(x) in powers of x: f(x) = X 8 k=0 Ã 8 k ! x 8−k (−1)k = x 8−8x 7+28x 6−56x 5+70x 4−56x 3+28x 2−8x+1. (3.10) Horner’s method (see Section 1.1), which is also called nested multiplication, can be used to evaluate the polynomial in (1.10). When applied to formula (1.10), nested multiplication permits us to write f(x) = (((((((x − 8)x + 28)x − 56)x + 70)x − 56)x + 28)x − 8)x + 1. (3.11) To evaluate f(x) now requires seven multiplications and eight additions or subtractions. The necessity of using an exponential function to evaluate the polynomial has now been eliminated. We end this section with the theorem that relates the Taylor series in Table 1.1 and the polynomials of Theorem 1.1. Theorem 1.2 (Taylor Series). Assume that f(x) is analytic and has continuous derivatives of all order N = 1, 2, . . ., on an interval (a, b) containing x0. Suppose that the Taylor polynomial (1.2) tend to a limit S(x) = limN→∞ PN (x) = limN→∞ X N k=0 f (k) (x0) k! (x − x0) k , (3.12) then f(x) has the Taylor series expansion f(x) = X∞ k=0 f (k) (x0) k! (x − x0) k . (3.13) Proof. This follows directly from the definition of convergence of series in Section 1.1. This limit condition is often stated by saying that the error term must go to zero as N goes to infinite. Therefore, a necessary and sufficient condition for (1.13) to hold is that lim N→∞ EN (x) = limN→∞ f (N+1)(c)(x − x0) N+1 (N + 1)! = 0, (3.14) where c depends on N and x. 11
3.1.2 Exercises for Taylor Series and Calculation of Functions 1. Let f(a)=sin(a)and apply Theorem 1.1 (a) Use to=0 and find P,(r), P7(ar). and Pg(ar) (b) Show that if ar s l then the approximation si()x-3+可-7+g has the error bound eo(x)<1/10!≤2.75574×10-7 (c)Use To=T/4 and find P,(r), which involves powers of(a-/4) 2. Let f(r)=cos(a)and apply Theorem 1.1 (a) Use ao ==0 and find P(a), P6(a)and Ps(a) (b)Show that if al l then the approximation cos()≈1-a+ 4!6!8! has the error bound e(x)<1/9≤275574×10-6 (c) Use to=T/4 and find P(a), which involves powers of (a-T/4 3. Does f()=21/2 have a Taylor series expansion about Io=0?Justify your answer. Does the function f(a)=al/2 have a Taylor series expa ansion about 1? Justify your answe 4.(a)Find the Taylor polynomial of degree N=5 for f(a)=1/(1+a) expanded about To=0 b) Find the error term Es()for the polynomial in part(a) 5. Find the Taylor polynomial of degree N=3 for f(a)=e-x/ expanded 0 6. Find the Taylor polynomial of degree N=3, P3(a), for f(c)=x-2.x2+2.c expanded about o= 1. Show that f(a)= P3(ar) 7.(a) Find the Taylor polynomial of degree N=3 for f(c)=a/2 expanded 4 (b) Find the Taylor polynomial of degree N=3 for f(a)=x/2 expanded 9. (c)Determine which of the polynomials in parts(a)and(b) best approxi- mates(6.5)/ 8. Use f(a)=(2+x)/2 and apply Theorem 1.1 (b) Use P3(a)to find an approximation to 31e about to (a) Find the Taylor polynomial P3(a) expanded (c) Find the maximum value of If(4)(c)) on the interval I <c<3 and find bound for E3(r) 9. Determine the degree of the Taylor polynomial PN(a) expanded about o=0 that should be used to approximate eo. so that the error is less than 10 10. Determine the degree of the Taylor polynomial PN(a) expanded about
3.1.2 Exercises for Taylor Series and Calculation of Functions 1. Let f(x) = sin(x) and apply Theorem 1.1. (a) Use x0 = 0 and find P5(x), P7(x). and P9(x). (b) Show that if |x| ≤ 1 then the approximation sin(x) ≈ x − x 3 3! + x 5 5! − x 7 7! + x 9 9! has the error bound E9(x) < 1/10! ≤ 2.75574 × 10−7 . (c) Use x0 = π/4 and find P5(x), which involves powers of (x − π/4). 2. Let f(x) = cos(x) and apply Theorem 1.1. (a) Use x0 == 0 and find P4(x), P6(x) and P8(x). (b) Show that if |x| ≤ 1 then the approximation cos(x) ≈ 1 − x 2 2! + x 4 4! − x 6 6! + x 8 8! has the error bound E8(x) < 1/9! ≤ 2.75574 × 10−6 . (c) Use x0 = π/4 and find P4(x), which involves powers of (x − π/4). 3. Does f(x) = x 1/2 have a Taylor series expansion about x0 = 0? Justify your answer. Does the function f(x) = x 1/2 have a Taylor series expansion about x0 = 1? Justify your answer. 4. (a) Find the Taylor polynomial of degree N = 5 for f(x) = 1/(1 + x) expanded about x0 = 0. (b) Find the error term E5(x) for the polynomial in part (a). 5. Find the Taylor polynomial of degree N = 3 for f(x) = e −x 2/2 expanded about x0 = 0. 6. Find the Taylor polynomial of degree N = 3, P3(x), for f(x) = x 3 − 2x 2 + 2x expanded about x0 = 1. Show that f(x) = P3(x). 7. (a) Find the Taylor polynomial of degree N = 3 for f(x) = x 1/2 expanded about x0 = 4. (b) Find the Taylor polynomial of degree N = 3 for f(x) = x 1/2 expanded about x0 = 9. (c) Determine which of the polynomials in parts (a) and (b) best approximates (6.5)1/2 . 8. Use f(x) = (2 + x) 1/2 and apply Theorem 1.1. (a) Find the Taylor polynomial P3(x) expanded about x0 = 2. (b) Use P3(x) to find an approximation to 31/2 . (c) Find the maximum value of |f (4)(c)| on the interval 1 ≤ c ≤ 3 and find a bound for |E3(x)|. 9. Determine the degree of the Taylor polynomial PN (x) expanded about x0 = 0 that should be used to approximate e 0.1 so that the error is less than 10−6 . 10. Determine the degree of the Taylor polynomial PN (x) expanded about 12