180 likes | 403 Views
ENGG2012B Lecture 20 Taylor’s series. Kenneth Shum. Recall from calculus. Infinite equence of numbers 0.3, 0.33, 0.333, 0.3333, 0.33333, 0.333333, …. Infinite series 1 + 0.5 + 0.25 + 0.125 + 0.0625 + 0.03125 + … Power series 1+x+2x 2 +3x 3 +4x 4 +….
E N D
ENGG2012BLecture 20Taylor’s series Kenneth Shum ENGG2012B
Recall from calculus • Infinite equence of numbers 0.3, 0.33, 0.333, 0.3333, 0.33333, 0.333333, …. • Infinite series 1 + 0.5 + 0.25 + 0.125 + 0.0625 + 0.03125 + … • Power series 1+x+2x2+3x3+4x4+… ENGG2012B
Last week: Calculation of expected value by power series • Suppose that the pmf of random variable X is f(i),for i=0,1,2,3,… • Define a power series • The coefficients are the values of function f.If we differentiate g(z) and evaluate at z=1, we get the mean. ENGG2012B
Power series for approximation • Demonstration using Sage • Sage is a free mathematical software. http://wiki.sagemath.org/interact/ ENGG2012B
Charles Kao’s paper on fibre optics • “Dielectric-fibre surface waveguides for optical frequencies”, by K. C. Kao and G. A. Hockman, Proc. IEE, vol. 133, no. 7, pp.1151–1158, 1966. http://home.deib.polimi.it/martinel/comunicazioni/kaonobelpaper.pdf … glasses with a bulk loss of about 20 dB/km at around 0.6 micrometer can be obtained … ENGG2012B
Power series for defining new function • Bessel function http://en.wikipedia.org/wiki/Bessel_function • Bessel functions of the first kind J(x) are defined as a solution to the non-linear differential equation where is a parameter. • We can calculate it by power series where (x) is the gamma function. ENGG2012B
Power series for the calculating special functions • Compare with the sine function. • Sine function sin(x) can be defined as a solution to the second-order differential equation where is a parameter. • We can calculate it by power series ENGG2012B
The gamma function • The gamma function can be regarded as an interpolation of the factorial function • For positive integer n, (n) = (n-1)! • It satisfies a recursive formula (x+1) = x (x) for positive real number x. We can write it as (x) = (x+1)/x • We can calculate the gamma function using the built-in calculator in iphone • For all positive real number x (x) = (x)! / x Factorial function in thelandscape mode ofiphone’s calculator ENGG2012B
Examples • The 0-th order Bessel function of the first kind • The first order Bessel function of the first kind ENGG2012B
Taylor series http://en.wikipedia.org/wiki/Power_series • Given a function f(x), and a point x0. • x0 is called the centre. • Try to approximate a function f(x) near x0, by a0 + a1(x – x0) + a2(x – x0)2 + a3(x – x0)3 + a4(x – x0)4 + … • When x0 = 0, it is called Maclaurin series. a0 + a1x + a2 x2 + a3 x3 + a4x4 + a5x5 + a6x6 + … ENGG2012B
Taylor series and Maclaurin series Brook Taylor English mathematician 1685—1731 Colin Maclaurin Scottish mathematician 1698—1746 ENGG2012B
Obtaining the coefficients by differentiating many times • Equate f(x) with the required Taylor series f(x) = a0 + a1(x – x0) + a2(x – x0)2 + a3(x – x0)3 + … • Set x = x0 in f(x) a0= f(x0) • Differentiate f and set x = x0, f’(x) = a1+2a2(x – x0)+3a3(x – x0)2+… a1= f’(x0) • Differentiate again and set x = x0, f’’(x) = 2a2+6a3(x – x0)+12a4(x – x0)2+… • a2= f’’(x0)/2 In general, we have ak= f(k)(x0) / k!, for k=0,1,2,… ENGG2012B
Maclaurin series of sine • Equate sin(x) = a0 + a1x + a2x2 + a3x3 + a4x4 + … • Set x = 0 a0 = sin(0) = 0. • Differentiate f and set x = 0, cos(x) = a1 + 2a2x + 3a3x2 + 4a4x3 + …a1=cos(0)=1. • Differentiate f again and set x = 0, -sin(x) = 2a2 + 6a3x + 12a4x2 + …a2=sin(0)/2=0. • Differentiate f again and set x = 0, -cos(x) = 6a3 + 24a4x + 60a5x2 + …a3=-cos(0)/6=-1/6. • Differentiate f again and set x = 0, sin(x) = 24a4 + 120a5x + 360a6x2 + …a4=sin(0)/24=0. By mathematical induction, we can obtain all coefficients. ENGG2012B
Maclaurin series of cosine • Equate cos(x) = a0 + a1x + a2x2 + a3x3 + a4x4 + … • Set x = 0 a0 = cos(0) = 1. • Differentiate f and set x = 0, -sin(x) = a1 + 2a2x + 3a3x2 + 4a4x3+ …a1=-sin(0)=0. • Differentiate f again and set x = 0, -cos(x) = 2a2 + 6a3x + 12a4x2 + …a2=-cos(0)/2=-1/2. • Differentiate f again and set x = 0, sin(x) = 6a3 + 24a4x + 60a5x2 + …a3=sin(0)/6=0. • Differentiate f again and set x = 0, cos(x) = 24a4 + 120a5x + 360a6x2 + …a4=cos(0)/24=1/24. By mathematical induction, we can obtain all coefficients. ENGG2012B
Maclaurin series of exponential function • Equate exp(x) = a0 + a1x + a2x2 + a3x3 + a4x4 + … • Set x = 0 a0 = exp(0) = 1. • Differentiate f and set x = 0, exp(x) = a1 + 2a2x + 3a3x2 + 4a4x3 + …a1=exp(0)=1. • Differentiate f again and set x = 0, exp(x) = 2a2 + 6a3x + 12a4x2 + …a2=exp(0)/2=1/2. • Differentiate f again and set x = 0, exp(x) = 6a3 + 24a4x + 60a5x2 + …a3=exp(0)/6=1/6. • Differentiate f again and set x = 0, exp(x) = 24a4 + 120a5x + 360a6x2 + …a4=exp(0)/24=1/24. By mathematical induction, we can obtain all coefficients. ENGG2012B
Important note • Let f(x) be a smooth function (so that we can differentiate it arbitrarily many times). • Let p(x) be the Taylor series expansion of f(x) with centre x0. • It is not guaranteed that in general, the Taylor series converges everywhere. • Suppose that the power series expansion converges. It is not guaranteed that it converges to the function f. ENGG2012B
Numerical examples • Taylor series of sin(x) centred at x=1. degree 1 degree 3 degree 4 degree 2 ENGG2012B
A pathological case • Consider the function f(x) is infinitely differentiable f(n)(0) = 0 for all n. Hence, the power seriesexpansion with centre at 0is the constant zero function p(x) = 0. p(x) = f(x) only at x=0. ENGG2012B