Maclaurin Series Learning Outcomes After reading this theory sheet, you should recognise the difference between a function and its polynomial epansion (if it eists!) understand what is meant by a series approimation be able to find series epansions (Maclaurin Series) for algebraic functions be able to find series epansions for certain transcendental functions be able to use Maclaurin Series to find approimate values of functions From Functions to Polynomial Series Epansions A Polynomial Series is a mathematical epression consisting of added terms, terms which consist of a constant multiplier and one or more variables raised to integral powers. For eample, 3 - + 7 and 5y + 8 3 z are closed polynomials (i.e. polynomials containing a finite number of terms). Functions of the type ( + ) n and their Polynomial Representation Under certain conditions mathematical functions can be equated to polynomial series - a simple eample being the quadratic function f() = ( +), in which the brackets can be epanded giving f() = + +. Here + + is a polynomial series. When considering polynomial epansions of this type, the order is usually reversed, i.e. ( + ) = + + Similarly 3 3 ( + ) = + 3+ 3 + ( + ) = + + 6 + 3 + 5 3 ( + ) = + 5+ + + 5 + 5, etc These epansions are special cases of the more general Binomial Theorem. Namely, 3 n ( + ) = + n+ n( n ) + n( n )( n ) + n( n )( n )( n 3) +! 3!! where the + indicates an open-ended polynomial (i.e. one which continues forever) and! ( factorial) means ; 3! (3 factorial) = 3 ; etc. For a positive integer value of n, application of the Binomial Theorem results in closed polynomials. For eample, with n =, the above Theorem gives, as epected, ( + ) = + + (Try it!) For a negative integer value of n, or a fraction value of n this will result in an open polynomial. For eample, with n = -, the above Binomial Theorem results in 3 ( + ) = + ( ) + ( )( ) + ( )( )( 3) + ( )( )( 3)( ) +! 3!! 3 = + + + (Try it! Also, note the pattern of successive terms) P.Edwards, Bournemouth University, UK Page of 8
Let s consider these eamples in more detail. The two functions, f() = ( + ) and f() = ( + ) - are each being equated to a polynomial series. Plotting f() = ( + ), a quadratic function, results in a parabolic graph; fundamentally, y = shifted by unit to the left, i.e. with its verte at (-, ). y f = ( + ) = + +, eactly the Now, since f = + + same parabola will result for Note that the function could be approimated by incorporating successive terms of the polynomial epansion, so that ( + ) (-, ) ( + ) + ( is approimately equal to ) Plotting either of these approimations is obviously not going to give anything like a parabola since the first is a horizontal line through y = and the second is a straight line gradient and y-intercept. Only the full three-term epansion will produce the correct parabolic curve. Plotting the reciprocal function f() = ( + ) - = / ( + ), results in the graph of a rectangular hyperbola; fundamentally, y =/ shifted by unit to the left, i.e. with = - a vertical asymptote and y = a horizontal asymptote. Bringing in successive terms for this function results in ( + ) + ( + ) + etc The first two of these are straight line approimations, so do not even curve in the way that the function does. At least the quadratic approimation produces a curve. Note that all three approimations above (and in fact all higher order approimations) have a y-intercept of y = as does the function itself. Use the accompanying applet on this eample to see the effects described above. Bearing in mind that the polynomial epansion of this function is an infinite series, it would take an infinite number of terms to produce a true polynomial approimation of this function. Erm, well yes, you would think so. Unfortunately, the polynomial epansion of f() = ( + ) - only matches the true function curve in the range <+ no matter how many terms are included. Outside that range of values the polynomial approimation either does not eist or is etremely inappropriate. Again, these effects can be seen using the accompanying applet. P.Edwards, Bournemouth University, UK Page of 8
Already then, it can be seen that some functions can be approimated successfully for all values of some give a good approimation only over a restricted range and some do not have a polynomial representation at all (as will be seen later). Using the Binomial Epansion gives polynomial representations of functions of the type ( + ) n. But is it possible to represent other types of function (sine, log, eponential, for eample - so-called transcendental functions) as polynomial series. The answer is yes but not always! Transcendental Functions and their Polynomial Representation It takes a great leap of faith to accept that it is going to be possible to represent a transcendental function such as sin in terms of an algebraic polynomial epansion but this is eactly what Maclaurin Series analysis allows us to do. So, is it possible to epand any function f() as a power series? Yes, possibly, but note all the assumptions (below) that have to be made on the way! Assume that a function, f(), can be epanded as f = a + a + a + a + a + a + a + 3 5 6 3 5 6 Here the ascending powers of show the function epanded as a polynomial series. This series has, at present, undetermined coefficients (constants that multiply successive terms in the series), a, a, a, a3, a, a5, a 6 Now, putting = in the above series, assuming the function eists at = (watch out, functions like f() = / don t!), gives f a a = f = or Net, assuming that the function and its polynomial representation are differentiable, then f = a + a + 3a + a + 5a + 6a + 3 5 3 5 6 Putting = in this series, assuming the differential of the function eists at =, gives f a a = f = or Net, assuming that the function and its polynomial representation are now twice differentiable, then f = a + 3 a + 3a + 5 a + 6 5a + 3 3 5 6 Putting = in this series, assuming the second differential of the function eists at =, gives f f = a or a =! Similarly, a 3 f =, 3! ( iv) ( v) f f a =, a 5 =,! 5! Note the pattern involved here. So, with the unknown coefficients found in terms of the value of the function and its derivatives at =, the general Maclaurin Theorem can be written as: P.Edwards, Bournemouth University, UK Page 3 of 8
The polynomial series representation (i.e. Maclaurin Series) of any infinitely differentiable function, f(), whose value, and the values of all of its derivatives, eist at = is given by the infinite series ( iv ) ( v ) ( vi f ) f 3 f f 5 f 6 f = f + f + + + + + +! 3!! 5! 6! note the strict conditions about differentiability and eistence at =. Maclaurin Series of sin f Let = sin so so f = cos so and f = sin so so f = cos so and ( iv) f ( ) = sin so ( iv) f = sin= f = cos= f = sin= f = cos= f = sin= (NOTE: in RADIANS) Note that the fourth derivative takes us back to the start point, so these values repeat in a cycle of four as,,, -,,,, -,,,, -,,,, -, etc Note that the function is infinitely differentiable and that it, and all its derivatives, eist at =. Substitution of these values back into the Maclaurin Series gives f = sin = +. +. +. +. +. + + 3 5 6 or 3 5 7 sin = + + 3! 5! 7! When you think about it, this result is amazing! A transcendental, trigonometrical function being represented by an algebraic, polynomial function! Almost more amazing is how the series comes out in a regular form in which there is a pattern. There are no prizes for guessing that the net term would have been 9 / 9! and the net /! Maclaurin Series of e Let f = e so f e = = so f = e so f e = = and f = e so f e = =, etc of course, the function and all its successive derivatives are the same, so these values repeat indefinitely as,,,,,,,, etc Note again that the function was infinitely differentiable and that it, and all its derivatives, eist at =. Substitution of these values back into the Maclaurin Series gives 3 5 6 f = e = +. +. +. + + + +! 3!! 5! 6! P.Edwards, Bournemouth University, UK Page of 8
or 3 5 e = + + + + + +! 3!! 5! Another truly amazing result! The eponential function can also be represented by a polynomial epansion with, again, a regular pattern. Again, there are no prizes for guessing subsequent terms! Maclaurin Series of ln Let f ( ) = ln so so f = so f = ln=? f = =? f = =?, etc and f = so Neither the function nor any of its derivatives eist at =, so there is no polynomial Maclaurin epansion of the natural logarithm function ln. Not wishing to be put off by this, is it possible to produce a Maclaurin series for any natural logarithm function at all? The answer is yes. All that has to be done is to shift the function/curve left by unit and an epansion for logarithm can be found since the new function and all its derivative now all eist at =. Maclaurin Series of ln ( + ) ln Let f ( ) = ( + ) so = so f ( + ) f = ln + = ln= f = = + so and f = so ( + ) = and f ( iv) and f ( + ) 3 3 = so + ( ) f = =, so ( + ) f = =, ( iv ) ( + ) 3 3 f = = 3, etc ( + ) 3 Substituting these values back into the general Maclaurin Series gives 3 5 ln ( + ) = + + 3 5 note that there are no factorial values in the denominators. IMPORTANT NOTE: Although the series for ln ( + ) eists (owing to the function and its derivatives eisting and the function and its derivatives being defined at =, the function itself doesn t eist for. In which case the function epansion does not eist for either. In fact, the series approimation is only valid within the narrow range < + (as can be seen when using the accompanying Maclaurin Series applet). P.Edwards, Bournemouth University, UK Page 5 of 8
Maclaurin Series of cos The series for cos, applying the same procedure is 6 cos = + +!! 6! This series, as with the sine series, is valid for all values of (unlike the ln ( +) series), as is ehibited when using the accompanying Maclaurin Series applet. Note, though, that there is a quick way of deriving the series for cos if the series for sin is already known. Since both sin and cos are both infinitely differentiable and their function and differential values all eist at =, the Maclaurin Series for cos could have been found by differentiating both sides of the series epansion for sin term by term. (Try it) Note that, by applying the same procedure, differentiating the series for ln ( + ) term by term results in the series for / ( + ). Maclaurin Series of inverse trigonometrical functions Series for inverse trigonometrical functions can be complicated to find directly since successive differentials become unmanageable quite quickly. The idea of differentiability of functions and their series is useful in finding series of inverse trigonometrical functions. f = sin. Consider The differential of this function is f = = ( ) = + ( ) The polynomial series epansion for the last epression here can be found using the Binomial Theorem. ( ) 3 3 f = + = + + + = + + 8 +! Now reverse the differentiation process to obtain ( ) 3 sin = + = = + + 8 + f d d d. so sin = + + + 3 3 5 6 A comprehensive list of functions and their Maclaurin Series (including ranges of validity) can be found at http://mathworld.wolfram.com/maclaurinseries.html. P.Edwards, Bournemouth University, UK Page 6 of 8
Using Maclaurin Series to Approimate Functions A commonly used approimation for sin, for small values of, is sin. (Remember, HAS to be in RADIANS!) Consider the following table. Angle, ( o ) Angle, (rads) Sin % error.7539.756.5.396585.389996. 5.87666.87557.3.75395.736877.5.396585.33.6 9.5779637. 57.7 8 3.596536 (!) Obviously as soon as the function value becomes zero (the denominator in the % error formula), the % error necessarily becomes infinite. This will happen every time is a multiple of 8 o. Even so, notice that the approimation sin is good up to about o (< % error), but the further from zero the more inaccurate the approimate value becomes (e.g. there is a 57% error in the 9 o approimation). You should have noticed that the approimation sin uses just the first term approimation of its Maclaurin Series. What happens to the accuracy if more terms are included? Consider the 9 o value again using the first 5 terms of the series. 3 5 7 9 sin = + + 3! 5! 7! 9! with = 9 o π =.5779637 radians, the series approimation gives so sin sin π π π π 3 5 7 9 π π = + + 3! 5! 7! 9! 3 5 7 (.5779637) (.5779637) (.5779637) (.5779637) π =.5779637 + + 3! 5! 7! 9! 9 giving sin π =.5779637.659697 +.796966.6875 +.6 sin π.353 (this time, a.353% error) rather different to the 57% error obtained before! Although this one eample does not form a conclusive proof, it can be said that, in general, where a Maclaurin Series approimation is valid, the approimations are more accurate the closer the value of is to zero, and the greater number of terms used from the Maclaurin Series. So how many terms of a Maclaurin Series are needed? Well, as many as it takes to achieve the accuracy required. P.Edwards, Bournemouth University, UK Page 7 of 8
You will have noticed in the last eample that successive terms of the Maclaurin Series become smaller the series converges. This will always be true for any within the range of validity. So, to find the value of a function using its Maclaurin Series to a given accuracy, one only needs to use the number of terms that give the appropriate accuracy required. Consider the following eample. Eample Use the Maclaurin Series for e to determine the value of e.5 to 3 d.p. Now so i.e. 3 5 e = + + + + + +! 3!! 5! 3 5.5.5.5.5.5 e = +.5+ + + + +! 3!! 5!.5 e = +.5 +.5 +.83+.66 +.66 + The last term here does not affect the third decimal place. In fact, the addition of all subsequent terms in the infinite series will not affect the third decimal place, so the value of e.5 to 3 d.p. can be found from adding just the first 5 terms ONLY. This gives e.5 =.683799, or, e.5 =.68 (3 d.p.) Compare this with the value obtained directly from a calculator, e.5 =.6877 to significant figures. Try these!. All other things being equal, there are two main reasons why you would epect the Maclaurin Series for sin to converge faster than the Maclaurin series for ln. What are these reasons?. Use as many terms of the relevant Maclaurin Series as is necessary to determine the values of sin. and ln. to 3 decimal places. 3. Use the accompanying Maclaurin Series applet to see how the series epansion for ln( + ) is inappropriate for < - and > +. P.Edwards, Bournemouth University, UK Page 8 of 8