o= T that should be used to approximate cos(33/32) so that the error is less than 10-6 11.(a)Find the Taylor polynomial of degree N=4 for F(r)==cos(t2)dt expanded about Io =0 (b)Use the Taylor polynomial to approximate F(0.1) (c) Find a bound on error to the approximation in part(b) 12.(a) Use the geometric series fo <1 and integrate both sides term by term to obtain arctan( r)=3 357 (b)Use T/6=arctan(3-1/2)and the series in part(a)to show that (c)Use the series in part(b)to compute T accurate to eight digits Fact.丌≈3.141592653589793284 13. Use f(a)=In(1+a) and co=0, and apply Theorem 1.1 (a) Show that f()(x)=(-1)-1(k-1)/(1+x) (b)Show that the Taylor polynomial of degree N is B()=x-2+3-4+ (-1) (c)Show that the error term for PN(ar)is NrN+ (d) Evaluate P3(0, 5), P6(0, 5), and Pg(0, 5). Compute with In(1.5) (e) Show that if 0.0< a <0.5, then the approximation n(ar) has the error bound Egl <.00009765 14. Binomial series. Let f(r)=(1+r)p and To=0 (a) Show that f()(a)=p(p-1).(p-k+1)(1+r)p-k b) Show that the Taylor polynomial of degree N is PN()=1+pc+ p(p-1) (p-1)…(P
x0 = π that should be used to approximate cos(33π/32) so that the error is less than 10−6 . 11. (a) Find the Taylor polynomial of degree N = 4 for F(x) = R x −1 cos(t 2 )dt expanded about x0 = 0. (b) Use the Taylor polynomial to approximate F(0.1). (c) Find a bound on error to the approximation in part (b). 12. (a) Use the geometric series 1 1 + x 2 = 1 − x 2 + x 4 − x 6 + x 8 − · · · for |x| < 1. and integrate both sides term by term to obtain arctan(x) = x − x 3 3 + x 5 5 − x 7 7 + · · · for |x| < 1. (b) Use π/6 = arctan(3−1/2 ) and the series in part (a) to show that π = 31/2 × 2 Ã 1 − 3 −1 3 + 3 −2 5 − 3 −3 7 + 3 −4 9 − · · ·! (c) Use the series in part (b) to compute π accurate to eight digits. Fact. π ≈ 3.141592653589793284 . . .. 13. Use f(x) = ln(1 + x) and x0 = 0, and apply Theorem 1.1. (a) Show that f (k) (x) = (−1)k−1 ((k − 1)!)/(1 + x) k . (b) Show that the Taylor polynomial of degree N is PN (x) = x − x 2 2 + x 3 3 − x 4 4 + · · · + (−1)N−1x N N . (c) Show that the error term for PN (x) is EN (x) = (−1)NxN+1 (N + 1)(1 + c) N+1 . (d) Evaluate P3(0, 5), P6(0, 5), and P9(0, 5). Compute with ln(1.5). (e) Show that if 0.0 ≤ x ≤ 0.5, then the approximation ln(x) ≈ x − x 2 2 + x 3 3 − · · · + x 7 7 − x 8 8 + x 9 9 has the error bound |E9| ≤ 0.00009765 . . .. 14. Binomial series. Let f(x) = (1 + x) p and x0 = 0. (a) Show that f (k) (x) = p(p − 1)· · ·(p − k + 1)(1 + x) p−k . (b) Show that the Taylor polynomial of degree N is PN (x) = 1 + px + p(p − 1)x 2 2! + · · · + p(p − 1)· · ·(p − N + 1)x N N! . 13
EN(x)=p(P-1)…(-N)x+1/(1+c)x+1(N+1) (d)Set p=1/2 and compute P2(0, 5), P4(0, 5), and P6(0, 5). Compute th(1.5 (e) Show that if 0.0 a <0.5 then the approximation (1+x)/≈1+2-8+16-128+26 has the error bound Es <(0.5)(21/1024)=0.0003204 (f) Show that if p= N is a positive integer, then PN(a)=1+Nr N(N-1) +NxN-I+2 Notice that this is the familiar binomial expansion 15. Find c such that E4 10-6 whenever lr-rol<c (a) Let f()=cos()and To (b) Let f(r)= sin(r)and To=T/2 (c)Let f(a)=e and o=0 16.(a)Suppose that y=f (a) is an even function (i.e, f(r)=f(a)for all a in the domain of f). What can be said about PN(a)? (b)Suppose that y= f(a)is an odd function (i.e, f(r)=-f(a) for all a in the domain of f). What can be said about PN(a)? 17. Let y= f(a)be a polynomial of degree N. If f(co)>0 and f(co), .. f((o) >0, show that all real roots of f are less than ro. Hint. Expand f in a Taylor polynomial of degree N about ro 18. Let f(a)=e, Use Theorem 1.1 to find PN(a), for N=1, 2, 3 expanded about o=0. Show that every real root of PN(a) has multiplicity less than of equal to one. Note. If p is a root of multiplicity M of the polynomial P(a), then p is a root of multiplicity M-1 of p(a) 19. Finish the proof of Corollary 1.1 by writing down the expression for PN (a)and showing that P)(x0)=f()(xo)fork=2,3,…,N Exercises 20 and 21 form a proof of Taylor's theorem 20. Let g(t)and its derivatives g()(t), for k= 1, 2,.N+ 1, be continuous on the interval (a, b), which contains o. Suppose that there exist two distinct points r and To such that g(a)=0, and g(ao)=g(ao) 9 (ro)=0. Prove that there exists a value c that lies between to and c such that g(N+I)(c) Remark. Note that g(t) is a function of t, and the values a and o are to
(c) Show that EN (x) = p(p − 1)· · ·(−N)x N+1/((1 + c) N+1(N + 1)!). (d) Set p = 1/2 and compute P2(0, 5), P4(0, 5), and P6(0, 5). Compute with (1.5)1/2 . (e) Show that if 0.0 ≤ x ≤ 0.5 then the approximation (1 + x) 1/2 ≈ 1 + x 2 − x 2 8 + x 3 16 − 5x 4 128 + 7x 5 256 has the error bound |E5| ≤ (0.5)6 (21/1024) = 0.0003204 · · ·. (f) Show that if p = N is a positive integer, then PN (x) = 1 + Nx + N(N − 1)x 2 2! + · · · + NxN−1 + x N . Notice that this is the familiar binomial expansion. 15. Find c such that E4 < 10−6 whenever |x − x0| < c. (a) Let f(x) = cos(x) and x0 = 0. (b) Let f(x) = sin(x) and x0 = π/2. (c) Let f(x) = e x and x0 = 0. 16. (a) Suppose that y = f(x) is an even function (i.e., f(−x) = f(x) for all x in the domain of f). What can be said about PN (x)? (b) Suppose that y = f(x) is an odd function (i.e., f(−x) = −f(x) for all x in the domain of f). What can be said about PN (x)? 17. Let y = f(x) be a polynomial of degree N. If f(x0) > 0 and f 0 (x0), . . . , f(N) (x0) ≥ 0, show that all real roots of f are less than x0. Hint. Expand f in a Taylor polynomial of degree N about x0. 18. Let f(x) = e x , Use Theorem 1.1 to find PN (x), for N = 1, 2, 3, . . ., expanded about x0 = 0. Show that every real root of PN (x) has multiplicity less than of equal to one. Note. If p is a root of multiplicity M of the polynomial P(x), then p is a root of multiplicity M − 1 of p 0 (x). 19. Finish the proof of Corollary 1.1 by writing down the expression for P (k) N (x) and showing that P (k) N (x0) = f (k) (x0) fork = 2, 3, . . . , N. Exercises 20 and 21 form a proof of Taylor’s theorem. 20. Let g(t) and its derivatives g (k) (t), for k = 1, 2, . . . N + 1, be continuous on the interval (a, b), which contains x0. Suppose that there exist two distinct points x and x0 such that g(x) = 0, and g(x0) = g 0 (x0) = . . . = g (N) (x0) = 0. Prove that there exists a value c that lies between x0 and x such that g (N+1)(c) = 0. Remark. Note that g(t) is a function of t, and the values x and x0 are to 14
be treated as constants with respect to the variable t Hint. Use Rolle's theorem(Theorem 1.5, Section 1. 1)on the interval with end points co and to find the g' (t) on the interval with end points o and C1 to find the number c2 such that g(c2)=0. Inductively report he process until the number cN+I is found such that g(N+I(cN+1)=0 21. Use the result of Exercise 20 and the special function g(t)=f(t)-PN(t)-EN(a where PN(a) is the Taylor polynomial of degree N, to prove that the error term EN(r)=f()-PN(r)has the form EN(a)=f(N+l(c) (N+1)! Hint. Find g(+I)(t)and evaluate it at t=c 3.1.3 Algorithms and programs The matrix nature of MATLAB allows us to quickly evaluate functions at a large number of values. If X=(-10 1, then sin(X)will produce [sin(-1)sin(O)sin(1)]. Similarly if X=-1: 0.1: 1, then Y=sin(X)will produce a matrix Y of the same dimension as X with the appropriate values of sine. These two row matrices can be displayed in the form of a table by defining the matrix D=X'Y'](Note. The matrices X and Y must be of the saime length. 1.(a) Use the plot command to plot sin(a), Ps(), P(a), and Pg(a)from Exercise l on the same graph using the interval -1<a<1 (b)Create a table with columns that consist of sin (), P(r). P7) r), and Pg(r) evaluated at 10 equally spaced values of r from the interval (a) Use the plot command to plot cos(ar), P(a), P6(a), and P8(ar)from Exercise 2 on the same graph using the interval -1<a<1 (b)Create a table with columns that consist of cos (a), P(a). P6(a),and P&(r)evaluated at 19 equally spaced values of z from the interval 3.2 Introduction to Interpolation In section 1. 1 we saw how a Taylor polynomial can be used to approximate the function f(r). The information needed to construct the Taylor polynomial is the value of f and its derivatives at o. a shortcoming is that the higher-order derivatives must be known and often they are either not available or they are hard to compute
be treated as constants with respect to the variable t. Hint. Use Rolle’s theorem (Theorem 1.5, Section 1.1) on the interval with end points x0 and x to find the g 0 (t) on the interval with end points x0 and c1 to find the number c2 such that g 00(c2) = 0. Inductively report the process until the number cN+1 is found such that g (N+1)(cN+1) = 0. 21. Use the result of Exercise 20 and the special function g(t) = f(t) − PN (t) − EN (x) (t − x0) N+1 (x − x0) N+1 , where PN (x) is the Taylor polynomial of degree N, to prove that the error term EN (x) = f(x) − PN (x) has the form EN (x) = f (N+1)(c) (x − x0) N+1 (N + 1)! . Hint. Find g (N+1)(t) and evaluate it at t = c. 3.1.3 Algorithms and Programs The matrix nature of MATLAB allows us to quickly evaluate functions at a large number of values. If X=[-1 0 1], then sin(X) will produce [sin(-1) sin(0) sin(1)]. Similarly, if X=-1:0.1:1, then Y=sin(X) will produce a matrix Y of the same dimension as X with the appropriate values of sine. These two row matrices can be displayed in the form of a table by defining the matrix D=[X’ Y’] (Note. The matrices X and Y must be of the same length.) 1. (a) Use the plot command to plot sin(x), P5(x), P7(x), and P9(x) from Exercise 1 on the same graph using the interval −1 ≤ x ≤ 1. (b) Create a table with columns that consist of sin(x), P5(x).P7)x), and P9(x) evaluated at 10 equally spaced values of x from the interval [−1, 1]. 2. (a) Use the plot command to plot cos(x), P4(x), P6(x), and P8(x) from Exercise 2 on the same graph using the interval −1 ≤ x ≤ 1. (b) Create a table with columns that consist of cos(x), P4(x).P6(x), and P8(x) evaluated at 19 equally spaced values of x from the interval [−1, 1]. 3.2 Introduction to Interpolation In section 1.1 we saw how a Taylor polynomial can be used to approximate the function f(x). The information needed to construct the Taylor polynomial is the value of f and its derivatives at x0. A shortcoming is that the higher-order derivatives must be known, and often they are either not available or they are hard to compute. 15
Suppose that the function y= f(a) is known at the N+ I points(o, yo), (N, 3N), where the values ck are spread out over the interval a, b and satisfy a≤x0<x1<…<xN< b and yk=f(xk) a polynomial P(r) of degree N will be constructed that passes through these N+1 points. In the construction, only the numerical values k and yk are needed. Hence the higher-order derivatives are not necessary. The polynomial P(ar)can be used to approximate f(a) over the entire interval [ a, b]. However, if the error function E(a) f(a)-P()is required. then we will need to know f(N+D(a)and a bound for its magnitude that is M=max{f(+)(x):a≤x≤b} Situations in statistical and scientific analysis arise where the function y=f(ar)is available only at N+l tabulated points(k, yk), and a method is needed to approximate f(ar)at nontabulated abscissas. If there is a significant amount of error in the tabulated values, then the methods of curve fitting in Chapter 5 should be considered. On the other hand, if the points(ak, yk)are known to a high degree of accuracy, then the polynomial curve y= P(ar) that passes through them can be considered. When o <. N, the approximation P(a)is called an interpolated value. If either ro <a< N, the approximation P(a)is called an extrapolated value. Polynomial are used to design software algorithms to approximate functions, for numerical differentiation, fo numerical integration, and for making computer-drawn curves that must pass through recited points Figure 1.7(a) The approximating polynomial P(ar)can be used for interpolation at the point(4, P(4)) and extrapolation at the point (5.5, P(5.5))
Suppose that the function y = f(x) is known at the N + 1 points (x0, y0), . . . , (xN , yN ), where the values xk are spread out over the interval [a, b] and satisfy a ≤ x0 < x1 < · · · < xN ≤ b and yk = f(xk). A polynomial P(x) of degree N will be constructed that passes through these N + 1 points. In the construction, only the numerical values xk and yk are needed. Hence the higher-order derivatives are not necessary. The polynomial P(x) can be used to approximate f(x) over the entire interval [a, b]. However, if the error function E(x) = f(x) − P(x) is required. then we will need to know f (N+1)(x) and a bound for its magnitude, that is M = max{|f (N+1)(x)| : a ≤ x ≤ b}. Situations in statistical and scientific analysis arise where the function y = f(x) is available only at N +1 tabulated points (xk, yk), and a method is needed to approximate f(x) at nontabulated abscissas. If there is a significant amount of error in the tabulated values, then the methods of curve fitting in Chapter 5 should be considered. On the other hand, if the points (xk, yk) are known to a high degree of accuracy, then the polynomial curve y = P(x) that passes through them can be considered. When x0 < x < xN , the approximation P(x) is called an interpolated value. If either x0 < x < xN , the approximation P(x) is called an extrapolated value. Polynomial are used to design software algorithms to approximate functions, for numerical differentiation, for numerical integration, and for making computer-drawn curves that must pass through specified points. 0 1 2 3 4 5 6 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Figure 7(a) y=P(x) (4,P(4)) (5.5,P(5.5)) Figure 1.7 (a) The approximating polynomial P(x) can be used for interpolation at the point (4, P(4)) and extrapolation at the point (5.5, P(5.5)). 16
he tangent line (4P(4) y=P(x) Figure 7(b) Figure 1.7(b) The approximating polynomial P(ar)is differentiated and P'(ar) is used to find the slope at the interpolation point(4, P(4)) Let us briefly mention how to evaluate the polynomial P(a) P(x)=aNxN+aN-1x-xN-1+…+a2x2+a1x+ao (3.15 Horner's method of synthetic division is an efficient way to evaluate P(r). The deriva- tive P(ar)is Pr(a)=NaNTN-+(N-1)aN-1 and the indefinite integral I(r)= P(a)d r, which satisfies I'(a)=P(a),is aNC+1 aN-1- N+1 N 3 where C is the constant of integration. Algorithm 1.1(end of Section 1. 2)shows how to adapt Horner's method to P(a) and I(a) Example 1. 4. The polynomial P(a)=-002x+0.2.r-0.4.r2+1.28 passes through the four points(1,1.06),(2,1.12),(3,1.34),and(5,1.78).Find(a)P(4),(b)P(4),(c) h P(r)dr, and(d)P(5.5). Finally,(e) show how to find the coefficients of p(a) Use Algorithm 1.1(i)-(iii)(this is equivalent to the process in Table 1.2) with a=4 b3=a3=-0.02 b2=a2+b3x=0.2+(-0.02)(4)=0.12 b1=a1+b2x=-0.4+(0.12)(4)=0.08 bo=ao+bx=128+(0.08)(4)=1.60 The interpolated value is P(4)=1.60(see Figure 1.7(a))
0 1 2 3 4 5 6 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Figure 7(b) y=P(x) (4,P(4)) The tangent line has slope P’(4). Figure 1.7 (b) The approximating polynomial P(x) is differentiated and P 0 (x) is used to find the slope at the interpolation point (4, P(4)). Let us briefly mention how to evaluate the polynomial P(x): P(x) = aN x N + aN−1x N−1x N−1 + · · · + a2x 2 + a1x + a0. (3.15) Horner’s method of synthetic division is an efficient way to evaluate P(x). The derivative P 0 (x) is P 0 (x) = N aN x N−1 + (N − 1)aN−1x N−1x N−1 + · · · + 2a2x + a1. (3.16) and the indefinite integral I(x) = R P(x)dx, which satisfies I 0 (x) = P(x), is I(x) = aN x N+1 N + 1 + aN−1x N N + · · · + a2x 3 3 + a1x 2 2 + a0x + C, (3.17) where C is the constant of integration. Algorithm 1.1 (end of Section 1.2) shows how to adapt Horner’s method to P 0 (x) and I(x). Example 1.4. The polynomial P(x) = −0.02x 3 + 0.2x 3 − 0.4x 2 + 1.28 passes through the four points (1, 1.06),(2, 1.12),(3, 1.34), and (5, 1.78). Find (a) P(4), (b) P 0 (4), (c) R 4 1 P(x)dx, and (d) P(5.5). Finally, (e) show how to find the coefficients of P(x). Use Algorithm 1.1(i)-(iii)(this is equivalent to the process in Table 1.2) with x = 4. (a) b3 = a3 = −0.02 b2 = a2 + b3x = 0.2 + (−0.02)(4) = 0.12 b1 = a1 + b2x = −0.4 + (0.12)(4) = 0.08 b0 = a0 + b1x = 1.28 + (0.08)(4) = 1.60. The interpolated value is P(4) = 1.60(see Figure 1.7(a)). (b) d2 = 3a3 = −0.06 17