Approximating Functions Power Series - Maclaurin Consider the geometric series (a=1, r=x) In general a function may be expanded in a power series defined as; 1 − xn 1 + x + x 2 + x 3 + x 4 + K + x n −1 = 1− x f ( x) = c0 + c1 x + c2 x 2 + c3 x 3 + K + cn x n + K But, written the other way round, this is a polynomial expansion of a function; Here, all of the polynomial terms are centred on x=0, it is and expansion about the point x=0 or a Maclaurin Series. 1− xn = 1 + x + x 2 + x 3 + x 4 + K + x n −1 1− x For example : cos(x) cos( x) = 1 − Note: x measured in radians 1− cos( x) = 1 − 1 2 1 4 1 6 x + x − x +K 2 24 720 1 2 1 4 x + x 2 24 1 2 1 4 1 6 x + x − x +K 2 24 720 cos(x) • We’ll see why this is the expansion later • More terms → the power series becomes more accurate for a wider range of values of x 1− Why bother ? • Approximating an analytic function by its series expansion often helps us to visualise and understand its behaviour – eg: <E>(T) in the problem class. 1− 1 2 1 4 1 6 x + x − x 2 24 720 Finding the coefficients: Maclaurin c0 f ( x) = c0 + c1 x + c2 x 2 + c3 x 3 + K f (0) = c0 + c1 × 0 + c2 × 0 + c3 × 0 + K = c0 c1 • Series can be used to represent experimental data when you don’t know the analytic form (eg: curve fitting, drawing a straight line…). 1 2 x 2 df = c1 + 2c2 x + 3c3 x 2 + 4c4 x 3 + K dx df = c1 dx x =0 1 c2 The coefficients are the derivatives d2 f = 2c2 + 2 × 3c3 + 3 × 4c4 x 2 + K dx 2 d2 f dx 2 c0 = f (0) c1 = = 2!c2 x =0 c2 = c3 d3 f = 2 × 3c3 + 2 × 3 × 4c4 x + K dx 3 d3 f dx 3 = 3!c3 df dx c3 = x =0 1 dn f n! dx n x =0 K x=0 1 d2 f 2! dx 2 1 d2 f 3! dx 2 cn = x =0 That’s it - you can now expand any function ! x =0 The Maclaurin Series - Summary Maclaurin for cos(x) cos(0) = 1 f ( x) = f (0) + df dx 3 2 x+ x =0 1d f 2! dx 2 x2 + x=0 1d f 3! dx 3 x3 + K x=0 Knowledge of all of the derivatives at one point completely determines any well behaved function (eventually) cos( x) = 1 − 1 2 1 4 1 6 x + x − x +K 2 24 720 d cos( x ) = − sin(0) = 0 dx x =0 : All odd derivs 0 d2 cos( x) = − cos(0) = −1 dx 2 x =0 : Even derivs alternate -1, +1, -1, +1 etc.. K cos( x) = 1 − 1 2 1 4 1 6 x + x − x +K 2! 4! 6! Power Series - Taylor It may be convenient to expand about some other point, eg: x=a, then the power series is; f ( x ) = c0 + c1 ( x − a) + c2 ( x − a) 2 + c3 ( x − a ) 3 + K It works well for small x – how many terms would we need to approximate a whole cycle of cos(x) ? Expansion about the point x=a is a Taylor Series. 2 1 1 4 1 6 cos( x) = 1 − x 2 + x + x +K 2 24 720 Taylor Series The analysis is very similar to the Maclaurin series leading to; f ( x) = f ( a ) + 1 d3 f + 3! dx 3 df dx ( x − a) + x =a 1 d2 f 2! dx 2 ( x − a)2 + x =a 3 ( x − a) + K x =a OK but if we want to approximate cos(x) at x=π we will need a lot of terms – better to expand about x= π using a Taylor expansion. cos(x) : Taylor Series cos( x) = −1 + 1 1 1 ( x − π ) 2 − ( x − π )4 + ( x − π )6 − K 2! 4! 6! cos(π ) = −1 d cos( x ) = − sin(π ) = 0 dx x =π : All odd derivs 0 d2 cos( x) = − cos(π ) = +1 dx 2 x =π : Even derivs alternate +1, -1, +1, -1 etc.. K So … cos( x ) = −1 + 1 1 1 ( x − π )2 − ( x − π )4 + ( x − π )6 − K 2! 4! 6! Summary • Knowledge of the derivatives of a function can be used to make a polynomial expansion which, if you use enough terms, reproduces the function exactly Now an excellent approximation at x=π with a few terms. Potential Energy of a Diatomic Molecule In H2 the potential energy of interaction of the atoms looks like this • A Maclaurin series achieves this by expansion about x=0 • Faster convergence can be achieved away from x=0 by using a Taylor series which expands about any point, eg: x=a. 3 The Morse Potential To a good approximation the potential energy is give by the Morse form which is; { E (r ) = De 1 − e −α (r − a ) Problem Class 2 Compute an Harmonic approximation to the Morse potential for H2 and thus compute the vibrations of the molecule. } 2 with, De=4.79eV, a = 0.074 nm and α=19.3 nm-1. 4