1 Tylor polynomils In Section 3.5, we discussed how to pproximte function f(x) round point in terms of its first derivtive f (x) evluted t, tht is using the liner pproximtion f() + f ()(x ). We clled this pproximtion the first order pproximtion of f(x) round the point. In Section 3.6, we then extended our definition of first order pproximtion to second order pproximtion involving the vlues of both f () nd f (), provided tht both the first nd second derivtives of f(x) exists t the point. We clled the resulting qudrtic function the second order pproximtion of f(x) round the point. This process cn be generlized to n th order, to obtin n n th order polynomil pproximtion. Consider pproximting the function f(x) round the specific point x = 0 using polynomil of degree n: P n (x) = 0 + 1 x + x + 3 x 3 + + n x n If we wnt to use P n (x) to pproximte the function f(x) t the point x = 0, we my wnt to find the vlues of the constnts 1,,..., n such tht the derivtives of f nd P n gree up to order n t x = 0. Nmely, we wnt f(0) = P n (0), f (0) = P n(0), f (0) = P n (0),..., f (n) (0) = P n (n) (0). To get things strted, consider the cse of n = 3 in the following exmple. Exmple 1. A cubic pproximtion to the function f(x) If P 3 (x) = 0 + 1 x + x + 3 x 3 is cubic pproximtion to the function f(x) stisfying f(0) = P 3 (0), f (0) = P 3(0), f (0) = P 3 (0) nd f (0) = P 3 (0), then find 0, 1,, 3 in terms of f nd its derivtives evluted t x = 0. Solution. Differentiting P 3 (x) three times nd evluting these derivtes t x = 0 yields P 3 (x) = 0 + 1 x + x + 3 x 3 which implies f(0) = P 3 (0) = 0 P 3(x) = 1 + x + 3 3 x which implies f (0) = P 3(0) = 1 P 3 (x) = + (3 ) 3 x which implies f (0) = P 3 (0) = P 3 (x) = (3 ) 3 which implies f (0) = P 3 (0) = 6 3 Thus, we get 0 = f(0), 1 = f (0), = f (0)/, nd 3 = f (0)/6, yielding the Tylor polynomil P 3 (x) = f(0) + f (0)x + f (0) x + f (0) x 3 6 To obtin the vlue of 3 in Exmple 1, we differentited the term 3 x 3 three times to obtin the term ( 3) 3 = f (0). If we follow the sme procedure for qurtic polynomil P 4 (x) = 0 + 1 x + x + 3 x 3 + 4 x 4, we hve to differentite the term 4 x 4 four times to obtin ( 3 4) 4 = f (4) (0), implying tht 4 = f (4) (0) 3 4. In the problem set, you re sked to show, in generl, the n th order term is n = f (n) (0) 3 n. To void writing ( 3 n) ll the time, we use fctoril nottion. Fctoril notttion For positive integer, we define = 1 3 (n 1) n. This quntity is clled n fctoril. Under this definition 1! = 1. For nottionl convenience, we lso define 0! = 1. Using this definition, we cn write down more concise expression for our pproximtion of f.
If function f(x) hs n derivtives t the point x = 0, then the polynomil Tylor polynomil pproximtions round x = 0 is clled the n th P n (0) = f(0) nd P n (x) = f(0) + f (0)x + f (0)! x + f (0) 3! x 3 + + f (n) (0) x n order Tylor polynomil of f t x = 0, nd stisfies P n (i) (0) = f (i) (0) for i = 1,..., n Higher order Tylor polynomils cn provide surprisingly good pproximtions of functions, s the next exmple illustrtes. Exmple. Fifth order pproximtion of sin x round x = 0 Find the 5 th order Tylor polynomil pproximtion of sin x round the point x = 0. Plot both sin x nd P 5 (x) over the intervl [ π, π]. Solution. For f(x) = sin x, we hve f (x) = cos x, f (x) = sin x, f (x) = cos x, f (4) (x) = sin x nd f (5) (x) = cos x. Therefore, f(0) = f (0) = f (4) (0) = 0 nd f (0) = 1, f (0) = 1, nd f (5) (0) = 1, so tht the 5 th order Tylor polynomil expnded bout x = 0 is P 5 (x) = x x3 3! + x5 5! From Figure 1, we see tht the fifth order Tylor polynomil pproximtion is n extrordinrily good fit on the intervl [ π/, π/]. Figure 1: Plots on the intervl [ π, π] of y = sin x (blue) nd its fifth order Tylor polynomil pproximtion y = P 5 (x) (red). Tylor polynomils bout the point x = 0 re specil cse of Tylor polynomils round n rbitrry point x =. In the Problem Set, you re sked to verify tht the following definition mkes sense.
3 Let f(x) be function with derivtives up to order n t x =. polynomil of degree n f(x) round the point x = is The Tylor Tylor polynomil of degree n P n (x) = f()+f ()(x )+ f ()! nd stisfies P n () = f() nd (x ) + f () 3! (x ) 3 + + f (n) () (x ) n P n (i) () = f (i) () for i = 1,..., n Exmple illustrted how well the trnscendentl function sin x is pproximted by Tylor polynomil round the point x = 0. The next exmple illustrtes how we cn get good pproximtion of ln x by Tylor polynomil round the point x = 1, provided the intervl over which the pproximtion is mde is not too lrge. Figure : Plots over the intervl [0.5, 3] of y = ln x (blue) nd its fourth order Tylor polynomil pproximtion y = P 4 (x) round the point = 1 (red). Exmple 3. Tylor pproximtion of the logrithm Consider the function f(x) = ln x.. Find 4 th degree Tylor pproximtion of f(x) round the point x = 1 nd illustrte how well it fits by plotting this pproximtion nd the function ln x on the intervl [0.5, 3]. b. Use the Tylor pproximtion in. to estimte the hlf-life for drug with clernce rte of 0.1/hour. Compre your nswer to wht you get if you use technology to compute ln x. Solution.. We hve f(1) = ln 1 = 0 nd f (x) = 1 x f (1) = 1 f (x) = 1 x f (1) = 1 f (3) (x) = x 3 f (3) (1) = f (4) (x) = 6 x 4 f (4) (1) = 6
4 Therefore, the 4 th degree Tylor pproximtion is P 4 (x) = (x 1) 1 (x 1) + 1 3 (x 1)3 1 (x 1)4 4 Plotting P 4 (x) nd ln x, s illustrted in Figure, demonstrtes tht this pproximtion works rther well over the intervl [0.4, 1.7]. b. The hlf-life T for drug with clernce rte 0.1/hour stisfies 1 = e 0.1T. Solving for T gives T = 10 ln Using our pproximtion from. we get T 10 P 4 () = 10 [( 1) 1 ( 1) + 13 ( 1)3 14 ] ( 1)4 10 0.583 = 5.83 hours Alterntively, using clcultor to compute ln, we get T = 10 ln 6.93 hours Hence, the pproximtion overestimtes the true vlue by lmost 0%. Exmple 3 illustrtes tht the pproximtion by Tylor s polynomil isn t lwys tht good. This rises the question: how good is the Tylor pproximtion in generl? The next exmple illustrtes how to get n error bound on first order Tylor s pproximtion, using methods of integrtion. Exmple 4. An error bound for P 1 (x) f(x) round the point x = 1. Use the Fundmentl Theorem of Clculus (Theorem 5.) to show tht f(x) = f() + f ()(x ) + f (t)(x t)dt b. Let P 1 (x) be the first order Tylor s pproximtion for f(x) bout x =. Use the result from. to show tht if f (x) K for ll x in [, b], then Solution. for ll x in [, b]. f(x) P 1 () K (b ). From the Fundmentl Theorem of Clculus (Theorem 5.), we hve which we cn rewritten s f(x) f() = f(x) = f() + f (t)dt f (t)dt If f (t) is differentible on [, x], then we cn use integrtion by prts to build on this formul. Define u = f (t), which implies du = f (t)dt. Define dv = dt, which implies we cn choose v = t x. Integrtion by prts yields f (t)dt = f (t)(t x) x (t x)f (t)dt = f ()(x ) + (x t)f (t)dt
5 Combining this eqution with the one derived from the Fundmentl Theorem of Clculus, we obtin f(x) = f() + f ()(x ) + b. Recll tht P 1 (x) = f() + f ()(x ). Therefore f(x) P 1 (x) = (x t)f (t)dt (x t)f (t)dt Using the fct tht the bsolute vlue of n integrl is less thn or equl thn the integrl of the bsolute vlue of the integrnd, we get f(x) P 1 (x) x t f (t) dt Choosing K such tht f (t) K for ll t in [, b] implies tht (x ) f(x) P 1 (x) K x t dt = K K (b ) The pproch in Exmple 4 cn be generlized to obtin n error bound for the n th order Tylor polynomil pproximtion to f(x). In Problem 4 of the problem set, you re sked to iterte the procedure in Exmple 4 to get the following generl formul. Tylor s formul Exmple 5. Using the reminder term If function f(x) is defined on closed intervl I nd its first n + 1 derivtives re continuous on I, then f(x) = f() + f ()(x ) + f ()(x ) where the reminder term R n+1 (x) stisfies! R n+1 (x) K n+1 x n+1 (n + 1)! + + f (n) ()(x ) n for ny K n+1 such tht f (n+1) (y) K n+1 nd for ll y in the intervl I. Let P n (x) be the n th degree Tylor pproximtion of sin x bout the point x = 0.. Find n error bound for estimting sin 1 with P 5 (1). b. Determine the miniml degree n tht ensures P n (1) sin 1 1 10,000. Solution. + R n+1 (x). Since, s shown in Exmple, f (5) (x) = cos x, it follows tht f (6) = sin x. Thus f (6) (x) 1 nd we cn choose K 6 = 1. By Tylor s formul, R 6 (1) K 6 1 0 6 6! = 1 6! = 1 70 0.00139 Therefore, P 5 (1) = 1 1 3! + 1 5! 0.84167 is gurnteed to be within 0.00139 of sin 1. Using technology, we get tht the ctul error P 5 (1) sin 1 0.000196. In prticulr, the ctul error is round seven times smller thn the estimted error bound of 0.00139.
6 b. As the derivtives of sin x re lternte between cos x, sin x, cos x, nd sin x, we cn choose K n+1 = 1 for ll n. We wnt R n+1 (1) = K n+1 1 0 n+1 1 = (n + 1)! (n + 1)! 1 10, 000 Since 1/7! = 1/5, 040 nd 1/8! = 1/40, 30, it follows tht our estimte of the error ssocited with P 7 (1) expnded round x = 0, but not our estimte of the error ssocited with P 6 (1) expnded round x = 0, is within 1 10,000 of sin 1. We conclude this section by exmining the dose-response function f(x) = 100ex e x +e from Exmple of Section.4. 5 This is rther complicted looking function. It would certinly be esier for us to work with this dose-response function if it ws expressed in terms of qudrtic or cubic polynomil, but would it be resonble to pproximte this function with, sy, third order Tylor polynomil expnded round some pproprite vlue? The question is prtilly nswered in the next exmple. Exmple 6. Tylor pproximtion of dose-response curve. Wht is the upper bound to the size of the error we cn expect on the intervl I = [ 6, 4], if we replce the dose-response function f(x) = 100ex e x +e with its pproximting cubic Tylor polynomil generted 5 round the point = 5 (i.e. the mid point of the intervl of interest)? b. By plotting the function nd its first nd third order Tylor polynomil pproximtions expnded round the point = 5, show by visul inspection tht the third order is superior to the first order Tylor polynomil on the intervl [ 7, 3] but tht the sitution is reversed on the intervls [ 10, 9] nd [ 1, 0]. Solution.. To ddress the question, we need to generte the first four derivtives of the dose-response function in order to find K 4 such tht f (4) (y) K 4 for ll y [ 6, 4]. With some hrd work, or using technology, we hve f (x) = 100 e x 5 (e x + e 5 ) f (x) = 100 ex 5 (e x e 5 ) (e x + e 5 ) 3 f (x) = 100 ex 5 (e x 4e x 5 + e 10 ) (e x + e 5 ) 4 f (4) (x) = 100 ex 5 (e 3x 11e x 5 + 11e x+10 e 15 ) (e x + e 5 ) 5 To estimte K 4, we plot f (4) (x) on the intervl [ 10, 0] s shown in Figure 3. As f (4) (x) 13 on [ 6, 4] nd x + 5 1 for ll x in [ 6, 4], we cn select K 4 = 13 nd get the error estimte P 3 (x) f(x) K 4(x + 5) 4 4! K 41 4 4! = 13 4! 0.54 b. We use the evlutions of the derivtives of f(x) = 100ex e x +e t x = 5, generted in prt. to obtin the 5 first nd third order Tylor polynomil pproximtions of f(x) round the point = 5. In the cse of the first order polynomil, pplying our formul we obtin P 1 (x) = f( 5) + f ( 5)(x + 5) = 50 + 5(x + 5) = 5(x + 7)
7 Figure 3: Plots of the fourth derivtive of the dose-response function f(x) = upper nd lower broken red lines re plotted t ±13. 100ex e x +e 5 on the intervl [ 10, 0]. The In the cse of the third order Tylor polynomil, pplying our formul we obtin P 3 (x) = f( 5) + f ( 5)(x + 5) + f ( 5) Using the vlues clculted in prt., fter some work this reduces to (x + 5) + f ( 5) (x + 5) 3 6 P 3 (x) 85.4 131.5x 31.5x.08x 3 The dose-response curve f(x), nd the Tylor pproximtions P 1 (x) nd P 3 (x) re plotted in Figure 4 over intervls 7 x 3 (left pnel) nd 10 x 10 (right pnel). They show tht the third order Tylor polynomil provides better fit on the restricted intervl [ 7, 3] (left pnel of Figure 4), but tht the first order Tylor polynomil provides better fit t the ends of the intervl [ 10, 0] Figure 4: Plot of the dose-response function (solid blck) nd fits using the first (broken blue) nd third (broken red) order Tylor polynomils expnded round the point x = 5 on the intervls [ 7, 3] (left pnel) nd [ 10, 0] (right pnel). An importnt lesson of this lst exmple is tht Tylor polynomils provide improved pproximtions s the order increses, but only over n intervl close to the point round which the polynomils re generted. As we move wy from, the pproximtions my not fit well unless n is sufficiently lrge.
8 Problem Set 0.1 LEVEL 1 DRILL PROBLEMS 1. Find the fourth order Tylor polynomil of f(x) = cos x bout the point x = 0.. Use Tylor polynomils of degrees n = 1 nd expnded round the point = 1 to pproximte the exponentil function f(x) = e x t the points x = 1.1 nd x = 1.5. 3. In Problem 1 of Problem Set 3.5, we found tht the liner pproximtion of f(x) = cos x t = π is P 1 = x+ π. Find the Tylor polynomil P 3 expnded round = π. b. Find the Tylor polynomil P 5 expnded round = π. 4. In Problem of Problem Set 3.5, we found tht the liner pproximtion of f(x) = e x t = 0 is P 1 = 1 + x. Find qudrtic pproximtion P expnded round = 0. b. Find the Tylor polynomil P 3 expnded round = 0. 5. Compute P 4 expnded round = 0 for the given functions.. f(x) = sin x b. f(x) = sin x 6. Compute the Tylor polynomil of degree 3 expnded bout = for the given functions.. f(x) = ln x b. f(x) = 1 1 x 7. Use Tylor polynomils of degrees n = 1,, nd 3, expnded round the point = 9, to pproximte the function f(x) = x t point x = 10. 8. Use Tylor polynomils of degrees n = 1,, 3, 4, nd 5, expnded bout the point = 0, to pproximte the function f(x) = tn x t the point x = 0.. 9. Estimte the error in the pproximtion of f(x) = e x by P 0 (x) on the intervl [0, 1]. 10. Let f(x) = 5 3x + x + 3x 3 x 4. Find P 1 (x) round the point = 0. b. Estimte f(1) with P 1 (1). c. Use R n+1 (x) Kn+1 x n+1 (n+1)! to find n upper bound for the error in the estimte in prt b. LEVEL APPLIED AND THEORY PROBLEMS 11. Given f(x) = e x, show for Tylor polynomil pproximtions expnded round the point = 0 tht where p is some constnt such tht 0 < p < x. R n (x) ex x n+1 (n + 1)! 1. Given f(x) = ln(x + 1), show for Tylor polynomil pproximtions expnded round the point = 0 tht R n (x) x n+1 n + 1
9 13. If P 4 (x) = 0 + 1 x+ x + 3 x 3 + 4 x 4 is qudrtic pproximtion to the function f stisfying f(0) = P 3 (0), f (0) = P 3(0), f (0) = P 3 (0) nd f (0) = P 3 (0), then show tht 0 = f(0), 1 = f (0), = f (0), 3 = f (0), 4 = f (0). 6 4 14. If P n (x) = 0 + 1 x + x + 3 x 3 + + n x n is n nth order polynomil pproximtion to the function stisfying f (r) = P n (r) (0) for r = 0, 1,, n, then show tht n = f (n) (0) 15. In Section 3.6, Exmple 10, we modeled Professor Getz s hedche by the formul T (x) = ln x where the clernce rte is x per hour. We computed the first- nd second-order pproximtions t x = 0.8. Find the third degree Tylor pproximtion round the point = 0. 16. In Section 3.5, Exmple 5, we sw tht Roy nd collegues estimted how developmentl rtes of beetle Stethorus punctillum vried with temperture. They modeled the rte t which the fourth stge of development is completed using the function D(T ) = 0.03T (T 10.7) 38 T where D is mesured in percent development completed per dy nd T is mesured in degrees Celsius. Find the second-degree Tylor polynomil P (T ) ner the vlue T = 30. How does this compre to D(30)? 17. In Section 1.3, Exmple 6, we showed tht the curve hours l = 0.14M /3 provides good fit to the reltionship between the weight l tht gold medllist Olympic weightlifter cn lift nd the mss M of the weightlifter in question, over the mss rnge [40, 10]. Find the Tylor polynomils of first, second nd third order expnded round the point = 80 nd plot the originl curve nd these first three Tylor polynomils on the intervl 40 M 10. 18. In Problem 4.6 of Problem Set.6, we discussed in the context of Sockeye slmon stock-recruitment dt (see Fig..47) tht the Ricker function y = 3.7xe 0.01x could be used to model the reltionship between recruits y nd spwners x. From plotting this Ricker function over the intervl 0 < x < 00, together with the three second order Tylor polynomils obtined by expnding this Ricker function round the three points x = 60, 80, 100, comment on which of these pproximtions you would use on the intervl [0, 100] nd on the intervl [100, 00]. 19. Repet the previous problem, but now using third order, rther thn second order Tylor expnsions of the Ricker function y = 3.7xe 0.01x round the points = 60, 80, nd 100. 0. In Exmple 6, Section 3., we presented dt obtined by the Cndin scientist, Reto Zch, demonstrting tht the reltionship D = 1 + 0.4 h 0.84 provides n excellent fit to the number of drops D required to brek open whelk shell, when dropped by crow from height h bove the ground. By plotting this function over the intervl h 16, long with the second nd third order polynomils obtined by expnding this function round the point x = 4, compre the reltive merits of the two fits.
10 1. Repet the previous problem, but now with second nd third order Tylor polynomils expnded round the point x = 6.. In Exmple 14 of Section 3.6, we generted the Tylor polynomil s first order fit to the dose-response function y = 5(x + 7) y = 100ex e x + e 5 If we evlute this function t the points x = 9, 8,,, 1 we obtin, rounded to 1 deciml plce, the nine vlues 1.8, 4.7, 11.9, 6.9, 50.0, 73.1, 88.1, 95.3, nd 98. respectively. Using technology, find the best regression line through these points nd compre the sum-of squres mesures of the fit of this line to these dt with the sum-of-squres mesure of the fit provided by the Tylor pproximtion y = 5(x + 7). Since the regression line minimizes the sum-of-squres mesure of the fit, we expect the regression line to provide better fit to these dt: but how much lrger is the ltter sum-of-squres vlue thn the sum-of-squres ssocited with the regression line tht you obtined? 3. Use integrtion by prts to show tht 1 (x t) n f (n) (t) dt = f (n) (t) (x t)n + 1 (x t) n f (n+1) (t) dt 4. Iterte the procedure shown in Exmple 4 to show tht f (n) (x) K n+1 for ll x in [, b] then f(x) P n () K n+1 x 1 n+1 (n + 1)!