1 - Taylor Series and te Mean Value Teorem o Derivatives Te numerical solution o engineering and scientiic problems described by matematical models oten requires solving dierential equations. Dierential equations arise because tey describe rates o cange and tecnical people are interested in cange. Oten te matematical models are so complicated tat analytical solutions are not possible at least by te tools commonly instilled in most engineers and scientists so tey must be solved numerically. Tis requires te approximation o derivatives. It is important to ave some idea as to te accuracy o tose approximations i te solutions obtained using tose approximations are to be employed in designing equipment tat may ave terrible consequences i it ails. Te Taylor Series can be rearranged to yield approximations o derivatives rom adjacent values o a unction. Te Mean Value Teorem o Derivatives allows one to make judgments about te accuracy o suc approximations and ow teir accuracy may improve by decreasing te distance between adjacent values o te unction used or te approximations. Te Taylor Series can also be used to approximate te value o a unction at a nearby base value. Te Mean Value Teorem o Derivatives is related to te Taylor Series in tat te Mean Value Teorem concludes tat any Taylor Series approximation may be made perect by adding te next term let out o te approximation i it is evaluated at some point unortunately unknown between te base value o te unction and te value to wic it is being extrapolated. However, it is tis eature tat provides or an approximation o te error in derivatives. Ricardson Extrapolation is te last topic covered in tis capter. It is a metod o eiciently extrapolating te value o a unction by getting a very accurate estimate o te irst derivative. Te key word ere is eiciently. Te goal o te science o numerical metods is to maximize accuracy and minimize computational eort. Tis is because computational eort translates to computer time and time is money. Tere are several example MatCad iles available. Te irst one extrapolates te ln(1.1) to ln(1.). Te second one inds te unknown value described by Mean Value Teorem tat would make an estimate using te Taylor Series Approximation exact. O course, tis is only possible i one knows te exact value, wic is te case in te example because te unction is given. Lastly, some Microsot Word iles contain inserted MatCad objects (i.e. pasted in). I te computer you are using as MatCad available to it, double clicking on tese objects will activate te object witin Microsot Word. I tis is done, te MatCad Object can ten be modiied as you like and it will recalculate to your speciications. All SDSM&T lab computers ave MatCad installed. Since your ome computer probably does not ave MatCad, tese objects cannot be activated by doubling clicking on tem. In some cases bit maps o MatCad and oter application s output are available on te website. MatCad rom MatSot Inc. is available at greatly discounted rates or students. Please see your instructor i you are interested in tis option. 1.1 - Taylor Series Approximation Te Taylor series is used or approximation o a unction. I te value o te unction is known at c, ten te value o te unction may be determined at x. x c) x c) ( c) x c)... (1.1)!! MATH 7 004 Stanley. M. Howard
1 - Taylor Series and Te Mean Value Teorem o Derivatives 1 - In general, k x c) (1.) k k 0 k! Example 1a Given ln(1.1), ind ln(1.) using Taylor Series Approximation. Note tat d ln( x) 1 d ln( x) 1,, etc. dx x dx x 4 1 1 ( x c) 1 ( x c) 1 ( x c) ln( c) ( x c)... (1.) 4 c c! c! c 4! 1 1 (1. 1.1) (1. 1.1) ln(1.) ln(1.1) (1. 1.1)... (1.4) 1.1 1.1 1.1 6 See te MatCad example or computational results. I terms are let out o Taylor s Series ten te result is an approximation and must be written as suc. x c) ( c) x c) (1.5)! 1. - Mean Value Teorem Te Mean Value Teorem allows tis expression to be written exactly by te addition o te next term evaluated at as ollows. ( c) x c) ( c)( x c)! ( )( x c)! (1.6) were c < < x. Te Mean Value Teorem states tat tere will always be (providing te unction is continuous) a value o tat lies between c and x tat will make te approximation exact. Sout Dakota Scool o Mines and Tecnology 004 Stanley. M. Howard
1- Tis is easily seen wen only one term is used in te approximation suc tat ( c) (1.7) Tere is a slope o te unction tat i used will make te approximation exact and tat slope is a slope o te unction between x and c as sown in Figure 1. In te omework problems you are asked to determine te value o or a particular unction ( c) ( )( x c) (1.8) At te slope equals te slope troug te points P1 and P. (x) P (c) P1 c x x Figure 1. Te Mean Value Teorem o Derivatives 1. - Taylor Series Using Te Taylor Series is normally written as In general, x c) x c) ( c) x c)... (1.9)!! k x c) (1.10) k k 0 k! It is convenient to deine te distance rom c to x as. = x c. I we ten discontinue te use o c in avor o x, Eq. (1.9) becomes MATH 7 004 Stanley. M. Howard
1 - Taylor Series and Te Mean Value Teorem o Derivatives 1-4 Example 1b. - Mean Value Teorem o Derivatives Problem Find te value o tat makes te Taylor Series approximation in Eq. (1.11) exact or te unction (x) = x 4 x 90 were x = and c =1.5. Solution Te Mean Value Teorem allows te ollowing expression to be written were te last derivative term is evaluated at. ( c) x c) ( c)( x c)! ( )( x c)! (1.11) were c < < x. In tis example, tree terms are used or te approximation o (x) and te ourt term using te tird derivative at makes te approximation (x) exact. Substituting into Eq. (1.1) gives (x 4 *x 90) = ( c 4 *c 90) + (4*c )(x c) + 1*c *(x-c) /! + 4* *(x c) /! (1.1) MatCad Computation o x c 1.5 x 4 x 90 c 4 c 90 4c ( x c) 1 c ( x c) 4 ( x c) 1.65 Note: c < x Sout Dakota Scool o Mines and Tecnology 004 Stanley. M. Howard
1-5 ( x )... (1.1)!! were x replaces c and x + replaces x as sown in Figure. (x) c x x x+ Old New Figure. Comparison o previous notation and te new notation Ten in general, k k ( x ) (14) k k 0! 1.4 - Derivative Approximations rom Taylor Series Taylor Series may be written as ( x )... (1.14)!! An approximation or te irst derivative may be obtained by rearranging Eq. (1.14) to give ( x ) ( ) (1.15)! Te last term, wic arises rom te Mean Value Teorem, is a measure o te error in te estimate o te derivative. Tat is, ( ( x ) x) O( ) (1.16) MATH 7 004 Stanley. M. Howard
1 - Taylor Series and Te Mean Value Teorem o Derivatives 1-6 Te unction O is related to to te irst power as given in Eq. (16). Altoug te actual value o te error is unknown, it is known tat te error is related to te irst power o. Tereore, i were reduced by a actor o, say 10, te error in te derivative would be reduced by approximately a actor o 10. It sould go witout saying tat i te error were known, te derivative could simply be corrected using te known error. Since errors are important, any means o improving te estimation o te derivative is important. Te next section presents just suc an improvement in estimating te irst derivative. Te estimation o te irst derivative given in Eq. (1.16) is centered about x = x + /. Tat is, te two values o te unction are located at x and x +. Improved accuracy in te derivative migt be expected were te derivative centered about x. Tis can be acieved by using approximations o te unction at x and x + as ollows: ( x )... (1.17)!! ( x )... (1.18)!! Note tat te sign o every oter term is negative in Eq. (1.18)as required since te negative sign raised to an odd power gives a negative result. Subtracting Eq. (1.18) rom Eq. (1.17) gives a muc improved approximation o te irst derivative. ( x ) ( x ) O( ) (1.19) were O( ) = (x)! (1.0) indicates tat te error in te approximation o tis derivative varies wit te square o te step size. Tereore, i were reduced by a actor o 10 te error in te derivative would be reduced by a actor o 100. Te iger te power o in O( n ) te more rapidly te estimation improves wit decreasing step size. An approximation o te second derivative may be obtained by adding Eq. (18) rom Eq. (19) to give ( x ) ( x ) ( x) O( ) (1.1) Table 1 sows a summary o various approximations o derivatives and teir corresponding Order o Error. Te table may be extended to iger-order derivatives and iger order approximations. Sout Dakota Scool o Mines and Tecnology 004 Stanley. M. Howard
1-7 1.5 - Ricardson Extrapolation Taylor Series may be written as 4 5 ( x )... (1.)!! 4! 5! 4 5 ( x )... (1.)!! 4! 5! An approximation or te irst derivative may be obtained by subtracting Eq. (1.) rom (1.) to give 4 x x x x ( ) ( ) ( ) ( )... (1.4)! 5! Table 1. Derivative Approximations Derivative Type Approximation Order o Error 1 st Backward O() (x) (x) x Backward O( ) (x ) 4(x) (x) x Central O( ) (x ) (x) x Forward O() (x ) (x) x Forward O( ) (x) 4(x) (x) x nd Backward O() (x ) (x) (x) x Backward O( ) (x) 4(x) 5(x) (x) x Central O( ) (x) (x) (x) x Forward O() (x) (x) (x) x Forward O( ) (x) 5(x) 4(x) (x) x MATH 7 004 Stanley. M. Howard
1 - Taylor Series and Te Mean Value Teorem o Derivatives 1-8 Now deine or derivation convenience () ( x ) ( x ) ( ) (1.5) so tat Eq. (1.4) rearranged becomes 4 ( )... (1.6)! 5! Ricardson eliminated te second order term by evaluating te unction at ( ) 4...! 5! and eliminating te term by combining Eqs. (1.6) and (1.7) as ollows (1.7) 4 ( )..! 5! 4 4.! 5! (1.8) Wic establises tat te order o error is related to 4. 4 1 ( )... 4*5! (1.9) Ricardson s Extrapolation Equation or te irst derivative is ten 1 4 ( ) O( ) (1.0) and approximated as 1 ( ) (1.1) were ( x ) ( x ) ( ). (1.) and Sout Dakota Scool o Mines and Tecnology 004 Stanley. M. Howard
1-9 x x (1.) Te power o tis result sould be clear since te order o error is now reduced rom to 4 by simply adding an additional evaluation o te unction at (x+/) and at (x-/). Tis is an aritmetic increase in te number o calculations or a geometric increase in te accuracy. Tat is to say, te accuracy beneit outweigs te computational cost. Example 1c - Ricardson Extrapolation by MatCad Estimate te derivative o Sin (x) at x=1. 0.1 x 1 x ( ) sin( x) ( ) x ( ) ( x ) Ricardson Extrapolation ( ) 0.59405 ( ) 0.5400771 Tese are te slopes ound by te conventional central dierence equation. Notice ow cutting te step size in al improves te result. (x) = slope slope( x) 0.1 Analytical Solution (x)=-cos(x) cos ( 1) 0.54001 1 0.1 ( 0.1) slope( x) 0.540019 Tis slope obtained by Ricardson Extrapolation is muc more accurate since error is a unction O( 4 ) rater tan O( ). MATH 7 004 Stanley. M. Howard
1 - Taylor Series and Te Mean Value Teorem o Derivatives 1-10 Eq. ((1.1) may be written as 1 4 ( ) (1.4) wic will be interesting to compare wit later topics suc as Simpson s 1/ Rule and 4 t Order Runge- Kutta. Tey eac involve te average o two exterior values, ( x ), ( x ) rom ( ), and our center values, 4. Sout Dakota Scool o Mines and Tecnology 004 Stanley. M. Howard