Appendix a Short Course in Taylor Series
Total Page:16
File Type:pdf, Size:1020Kb
Appendix A Short Course in Taylor Series The Taylor series is mainly used for approximating functions when one can identify a small parameter. Expansion techniques are useful for many applications in physics, sometimes in unexpected ways. A.1 Taylor Series Expansions and Approximations In mathematics, the Taylor series is a representation of a function as an infinite sum of terms calculated from the values of its derivatives at a single point. It is named after the English mathematician Brook Taylor. If the series is centered at zero, the series is also called a Maclaurin series, named after the Scottish mathematician Colin Maclaurin. It is common practice to use a finite number of terms of the series to approximate a function. The Taylor series may be regarded as the limit of the Taylor polynomials. A.2 Definition A Taylor series is a series expansion of a function about a point. A one-dimensional Taylor series is an expansion of a real function f(x) about a point x ¼ a is given by; f 00ðÞa f 3ðÞa fxðÞ¼faðÞþf 0ðÞa ðÞþx À a ðÞx À a 2 þ ðÞx À a 3 þÁÁÁ 2! 3! f ðÞn ðÞa þ ðÞx À a n þÁÁÁ ðA:1Þ n! © Springer International Publishing Switzerland 2016 415 B. Zohuri, Directed Energy Weapons, DOI 10.1007/978-3-319-31289-7 416 Appendix A: Short Course in Taylor Series If a ¼ 0, the expansion is known as a Maclaurin Series. Equation A.1 can be written in the more compact sigma notation as follows: X1 f ðÞn ðÞa ðÞx À a n ðA:2Þ n! n¼0 where n ! is mathematical notation for factorial n and f(n)(a) denotes the n th derivation of function f evaluated at the point a. Not that the zeroth derivation of f is defined to be itself and bothðÞx À a 0 and 0 ! by their mathematical definitions are set equal to 1. Taylor series of some common functions expanding around point x ¼ a include; 1 1 x À a ðÞx À a 2 ðÞx À a 3 ¼ þ þ þ þÁÁÁ ðA:3aÞ 1 À x 1 À a ðÞ1 À a 2 ðÞ1 À a 2 ðÞ1 À a 3 1 1 ex ¼ ea 1 þ ðÞþx À a ðÞx À a 2 þ ðÞx À a 3 þÁÁÁ ðA:3bÞ 2 6 x À a ðÞx À a 2 ðÞx À a 3 1nx ¼ 1na þ À þ þÁÁÁ ðA:3cÞ a 2a2 3a3 1 1 cos x ¼ cos a À sin axðÞÀÀ a cos axðÞÀ a 2 þ sin axðÞÀ a 3 þÁÁÁ ðA:3dÞ 2 6 1 1 sin x ¼ sin a À cos axðÞÀÀ a sin axðÞÀ a 2 þ cos axðÞÀ a 3 þÁÁÁ ðA:3eÞ 2 6 2 tan x ¼ tan a À sec 2axðÞÀÀ a sec 2a tan axðÞÀ a 2 þ sec 2a sec 2a À ðÞx À a 3 þÁÁÁ 3 ðA:3fÞ Derivation of any f these function can be found in any calculus books. Taylor series can also be defined for functions of a complex variable. By the Cauchy integral formula and is written in form of; Appendix A: Short Course in Taylor Series 417 ð 1 fzðÞ0 dz0 fzðÞ¼ π 0 2 i C z À z ð 1 fzðÞ0 dz0 ¼ π 0 : 2 i C ðÞz À z0 À ðÞz À z0 ðA 4Þ ð 1 fzðÞ0 dz0 ¼ 2πi z À z C 0 1 0 ðÞz À z0 À 0 z À z0 In the interior of C, jjz À z 0 < 1 0 jjz À z0 So, using 1 X1 ¼ tn 1 À t n¼0 It follows that; ð X1 n 1 ðÞz À z fzðÞ0 dz0 fzðÞ¼ 0 2π 0 nþ1 i C n¼0 ðÞz À z0 ð ðA:5Þ X1 0 0 1 n fzðÞdz ¼ ðÞz À z0 2πi 0 nþ1 n¼0 C ðÞz À z0 Using the Cauchy integral formula for derivatives, X1 f ðÞn ðÞz fzðÞ¼ ðÞz À z n 0 ðA:6Þ 0 n! n¼0 A.3 Maclaurin Series Expansions and Approximations In the particular case where a ¼ 0, the series is also called a Maclaurin series: f 00ðÞ0 f 000ðÞ0 f ðÞþ0 f 0ðÞ0 x þ x2 þ x2 þÁÁÁ ðA:7Þ 2! 3! 418 Appendix A: Short Course in Taylor Series A.4 Derivation The Maclaurin/Taylor series can be derived in the following manner. If a function is analytic, it may be defined by a power series: X1 n 2 3 fxðÞ¼ anx ¼ a0 þ a1x þ a2x þ a3x þÁÁÁ ðA:8Þ n¼0 Evaluating at x ¼ 0, we have: f ðÞ¼0 a0 ðA:9Þ Differentiating the function, 0 2 3 f ðÞ¼x a1 þ 2a2x þ 3a3x þ 4a4x þÁÁÁ ðA:10Þ Evaluating at x ¼ 0, 0 f ðÞ¼0 a1 Differentiating the function again, 00 2 f ðÞ¼x 2a2 þ 6a3x þ 12a4x þÁÁÁ Evaluating at x ¼ 0, f 00ðÞx ¼ a 2! 2 Generalizing, f nðÞ0 a n n! where fn(0) is the nth derivative of f(0). Substituting the respective values of an in the power expansion, f 00ðÞ0 f 000ðÞ0 f ðÞþ0 f 0ðÞ0 x þ x2 þ x2 þÁÁÁ ðA:11Þ 2! 3! which is a particular case of the Taylor series (also known as Maclaurin series). Generalizing further, by writing f in a more general form, allowing for a shift of a, we have Appendix A: Short Course in Taylor Series 419 2 3 fxðÞ¼b0 þ b1ðÞþx À a b2ðÞx À a þ b3ðÞx À a þÁÁÁ ðA:12Þ Generalizing similar as above, for evaluating at x ¼ a, we get f nðÞa b ¼ ðA:13Þ n n! Substituting, we get f 00ðÞa f 000ðÞa fxðÞ¼faðÞþf 0ðÞa ðÞþx À a ðÞx À a 2 þ ðÞx À a 3 þÁÁÁ ðA:14Þ 2! 3! which is the Taylor series. Examples The Maclaurin series for any polynomial is the polynomial itself. The Maclaurin series forðÞ 1 À x À1 is the geometric series 1 þ x þ x2 þ x3 þÁÁÁ ðA:15Þ so the Taylor series for xÀ1 at a ¼ 1is 1 À ðÞþx À 1 ðÞx À 1 2 À ðÞx À 1 2 þÁÁÁ ðA:16Þ By integrating the above Maclaurin series we find the Maclaurin series for 1nðÞ 1 À x , where ln denotes the natural logarithm: x2 x3 x4 x þ þ þ þÁÁÁ ðA:17Þ 2 3 4 and the corresponding Taylor series for 1n x at a ¼ 1is ðÞx À 1 2 ðÞx À 1 3 ðÞx À 1 4 ðÞÀx À 1 þ À þÁÁÁ ðA:18Þ 2 3 4 The Taylor series for the exponential function ex at a ¼ 0is x1 x2 x3 x4 x5 x2 x3 x4 x5 1 þ þ þ þ þ þÁÁÁ¼1 þ x þ þ þ þ þÁÁÁ ðA:19Þ 1! 2! 3! 4! 5! 2 6 24 120 The above expansion holds because the derivative of ex with respect to x is also ex and e0 equals 1. This leaves the terms ðÞx À 0 n in the numerator and n! in the denominator for each term in the infinite sum. 420 Appendix A: Short Course in Taylor Series A.5 Convergence The sine function is closely approximated by its Taylor polynomial of degree 7 for a full period centered at the origin. The Taylor polynomials for logðÞ 1 þ x only provide accurate approximations in the range À1 < x 1. Note that, for x > 1, the Taylor polynomials of higher degree are worse approximations. In general, Taylor series need not be convergent. More precisely, the set of functions with a convergent Taylor series is a meager set in the Frechet space of smooth functions. In spite of this, for many functions that arise in practice, the Taylor series does converge. The limit of a convergent Taylor series of a function f need not in general be equal to the function value f(x), but in practice often it is. For example, the function 8 2 < eÀ1=x if x 6¼ 0 : fxðÞ¼: ðA 20Þ 0ifx ¼ 0 is infinitely differentiable at x ¼ 0, and has all derivatives zero there. Consequently, the Taylor series of f(x) is zero. However, f(x) is not equal to the zero function, and so it is not equal to its Taylor series. If f(x) is equal to its Taylor series in a neighborhood of a, it is said to be analytic in this neighborhood. If f(x) is equal to its Taylor series everywhere it is called entire. The exponential function ex and the trigonometric functions sine and cosine are examples of entire functions. Examples of functions that are not entire include the logarithm, the trigonometric function tangent, and its inverse arctan. For these functions the Taylor series do not converge if x is far from a. Taylor series can be used to calculate the value of an entire function in every point, if the value of the function, and of all of its derivatives, are known at a single point. Uses of the Taylor series for entire functions include: 1. The partial sums (the Taylor Polynomials) of the series can be used as approx- imations of the entire function. These approximations are good if sufficiently many terms are included. 2. The series representation simplifies many mathematical proofs. Pictured on the right is an accurate approximation of sin(x) around the point a ¼ 0. The pink curve is a polynomial of degree seven: x3 x5 x7 sin ðÞx x À þ þ ðA:21Þ 3! 5! 7! The error in this approximation is no more than jxj9/9 !.