Taylor Series
From Math Images
m 

Line 15:  Line 15:  
:<math>\sin(x) \approx P_n(x) = x  {x^3 \over 3!} + {x^5 \over 5!}  {x^7 \over 7!} + \cdots \pm {x^n \over n!}</math> (for odd ''n'')  :<math>\sin(x) \approx P_n(x) = x  {x^3 \over 3!} + {x^5 \over 5!}  {x^7 \over 7!} + \cdots \pm {x^n \over n!}</math> (for odd ''n'')  
  ''n'' varies from 0 to 36. As ''n'' becomes larger and there are more terms in the Taylor polynomial, the Taylor polynomial comes to "look" more like the original function. In other words, it becomes a progressively better approximation of the function; it becomes more <balloon title="Accuracy in the technical sense is the closeness of a measurement or estimation to the actual value, so one can use a Taylor polynomial to get as close as desired to a function's actual value.  +  ''n'' varies from 0 to 36. As ''n'' becomes larger and there are more terms in the Taylor polynomial, the Taylor polynomial comes to "look" more like the original function. In other words, it becomes a progressively better approximation of the function; it becomes more <balloon title="Accuracy in the technical sense is the closeness of a measurement or estimation to the actual value, so one can use a Taylor polynomial to get as close as desired to a function's actual value.">accurate</balloon>. 
How does one construct a Taylor series? As mentioned, Taylor series can be used to approximate infinitely differentiable functions. A Taylor polynomial, as will be shown later in the [[#MMEMore Mathematical Explanation]], is actually constructed according to the derivatives of a function at a certain point. The key idea behind Taylor series is this: Derivatives, roughly speaking, correspond to the shape of a curve, so the more derivatives that two functions have in common at one point, the more similar they will look at other nearby points.  How does one construct a Taylor series? As mentioned, Taylor series can be used to approximate infinitely differentiable functions. A Taylor polynomial, as will be shown later in the [[#MMEMore Mathematical Explanation]], is actually constructed according to the derivatives of a function at a certain point. The key idea behind Taylor series is this: Derivatives, roughly speaking, correspond to the shape of a curve, so the more derivatives that two functions have in common at one point, the more similar they will look at other nearby points.  
Line 26:  Line 26:  
ImageDesc=  ImageDesc=  
==Basic Use of Taylor Series==  ==Basic Use of Taylor Series==  
  Readers may, without knowing it, already be familiar with a particular type of Taylor series. Consider  +  Readers may, without knowing it, already be familiar with a particular type of Taylor series. Consider an infinite geometric series with first term 1 and common ratio ''x'': 
:<math>{1 \over {1x}} = 1 + x + x^2 + x^3 + \cdots</math> for <math>1 < x < 1</math>  :<math>{1 \over {1x}} = 1 + x + x^2 + x^3 + \cdots</math> for <math>1 < x < 1</math>  
  The left side of the equation is the formula for the sum of the  +  The left side of the equation is the formula for the sum of the [[Convergenceconvergent]] geometric series on the right. The right side is also an infinite power series, so it is the Taylor series for <math>f (x) = {1 \over {1x}}</math>. Later we will provide examples of some other Taylor series, as well as the process for deriving them from the original functions. 
Using Taylor series, we can approximate infinitely differentiable functions. For example, imagine that we want to approximate the sum of the infinite geometric series with first term 1 and common ratio <math>x = {1 \over 4}</math>. Using our knowledge of infinite geometric series, we know that the sum is <math> {1 \over {1  {1 \over 4}}} = {4 \over 3} = 1.333 \cdots </math>. Let's see how the Taylor approximation does:  Using Taylor series, we can approximate infinitely differentiable functions. For example, imagine that we want to approximate the sum of the infinite geometric series with first term 1 and common ratio <math>x = {1 \over 4}</math>. Using our knowledge of infinite geometric series, we know that the sum is <math> {1 \over {1  {1 \over 4}}} = {4 \over 3} = 1.333 \cdots </math>. Let's see how the Taylor approximation does:  
Line 43:  Line 43:  
  
At this point, you may be wondering what the use of a Taylor series approximation is if, as in the previous example,  At this point, you may be wondering what the use of a Taylor series approximation is if, as in the previous example,  
we don't need an estimate; we already have the ''exact'' answer on the lefthand side. Well, we don't always know the exact answer. For instance, a more complicated Taylor series is that of cos(''x''):  we don't need an estimate; we already have the ''exact'' answer on the lefthand side. Well, we don't always know the exact answer. For instance, a more complicated Taylor series is that of cos(''x''):  
Line 61:  Line 60:  
:<math>\cos (0.610865) \approx 1  {0.610865^2 \over 2!} + {0.610865^4 \over 4!}</math>  :<math>\cos (0.610865) \approx 1  {0.610865^2 \over 2!} + {0.610865^4 \over 4!}</math>  
+  {{AnchorReference=Figure1Link=[[Image:Taylor cos35 zoom.gifrightthumb360pxFigure 1<br>The approximation of cos(35°) zoomed in 2,000 times.]]}}  
Here we have written the 4<sup>th</sup>degree Taylor polynomial, but this should be enough to show us something. The right side of the equation can be reduced to the four simple operations, so we can easily calculate its value:  Here we have written the 4<sup>th</sup>degree Taylor polynomial, but this should be enough to show us something. The right side of the equation can be reduced to the four simple operations, so we can easily calculate its value:  
Line 86:  Line 86:  
::<math>P _n ^{(n)} (a) = f^{(n)} (a)</math>  ::<math>P _n ^{(n)} (a) = f^{(n)} (a)</math>  
  :where <math>P _n ^{(k)} (a)</math> is the k<sup>th</sup>order derivative of <math>P _n (x)</math>.  +  :where <math>P _n ^{(k)} (a)</math> is the k<sup>th</sup>order derivative of <math>P _n (x)</math> at ''a''. 
We define Taylor series as follows:  We define Taylor series as follows:  
Line 102:  Line 102:  
:{{EquationRef2Eq. 1}} <math>T(x) = a_0 + a_1 (xa)+ a_2 (xa)^2 + a_3 (xa)^3 + \cdots </math>,  :{{EquationRef2Eq. 1}} <math>T(x) = a_0 + a_1 (xa)+ a_2 (xa)^2 + a_3 (xa)^3 + \cdots </math>,  
  in which a<sub>0</sub>, a<sub>1</sub>, a<sub>2</sub>, ... are unknown coefficients. Our goal is to find a more useful expression for these coefficients. By definition of a Taylor polynomial, we know that the function <math>f(x)</math> and Taylor series <math>T(x)</math> must have the same derivatives of all degrees evaluated at ''a'':  +  in which a<sub>0</sub>, a<sub>1</sub>, a<sub>2</sub>, ... are unknown coefficients. Our goal is to find a more useful expression for these coefficients. 
+  
+  By definition of a Taylor polynomial, we know that the function <math>f(x)</math> and Taylor series <math>T(x)</math> must have the same derivatives of all degrees evaluated at ''a'':  
:<math>T(a) = f(a)</math>, <math>T'(a) = f'(a)</math>, <math>T''(a) = f''(a)</math>, <math>T ^{(3)} (a) = f ^{(3)} (a) \cdots</math>  :<math>T(a) = f(a)</math>, <math>T'(a) = f'(a)</math>, <math>T''(a) = f''(a)</math>, <math>T ^{(3)} (a) = f ^{(3)} (a) \cdots</math>  
Line 120:  Line 122:  
The pattern should now be recognizable, and it may be apparent how to solve for ''a<sub>k</sub>''. When we evaluate any of the above derivatives at ''x'' = ''a'', ''only the constant term will remain'' because all terms with (''x''  ''a'') go to 0. Note then what happens after ''k'' derivatives. We get:  The pattern should now be recognizable, and it may be apparent how to solve for ''a<sub>k</sub>''. When we evaluate any of the above derivatives at ''x'' = ''a'', ''only the constant term will remain'' because all terms with (''x''  ''a'') go to 0. Note then what happens after ''k'' derivatives. We get:  
  :<math>T ^{(k)} (a) = k! \cdot a_k  +  :<math>T ^{(k)} (a) = k! \cdot a_k</math>. 
Since in addition <math>T ^{(k)} (a) = f^{(k)}(a)</math> by definition, we conclude  Since in addition <math>T ^{(k)} (a) = f^{(k)}(a)</math> by definition, we conclude  
Line 131:  Line 133:  
This formula even holds for ''k''=0, since  This formula even holds for ''k''=0, since  
  0! = 1. Thus it holds for all nonnegative integers ''k''. So, using derivatives, we have obtained an expression for all unknown coefficients of the given function ''f''. Substitute this back into {{EquationNoteEq. 1}} to get an explicit expression of Taylor series:  +  0! = 1. Thus it holds for all nonnegative integers ''k''. So, using derivatives, we have obtained an expression for all unknown coefficients of ''T''<sup>(''k'')</sup> (''x'') in terms of the given function ''f''. Substitute this back into {{EquationNoteEq. 1}} to get an explicit expression of Taylor series: 
:{{EquationRef2Eq. 2}}<math> T(x) = f(a)+\frac {f'(a)}{1!} (xa)+ \frac{f''(a)}{2!} (xa)^2+\frac{f^{(3)}(a)}{3!}(xa)^3+ \cdots</math>  :{{EquationRef2Eq. 2}}<math> T(x) = f(a)+\frac {f'(a)}{1!} (xa)+ \frac{f''(a)}{2!} (xa)^2+\frac{f^{(3)}(a)}{3!}(xa)^3+ \cdots</math>  
Line 153:  Line 155:  
:{{EquationRef2Eq. 3}}<math> T(x) = f(0)+\frac {f'(0)}{1!} x + \frac{f''(0)}{2!} x^2 + \frac{f^{(3)}(0)}{3!}x^3 + \cdots</math>  :{{EquationRef2Eq. 3}}<math> T(x) = f(0)+\frac {f'(0)}{1!} x + \frac{f''(0)}{2!} x^2 + \frac{f^{(3)}(0)}{3!}x^3 + \cdots</math>  
  {{EquationNoteEq. 3}} is called the '''Maclaurin series''' and is named after Scottish mathematician Colin Maclaurin, who made extensive use of these series in the 18th century.  +  {{EquationNoteEq. 3}} is called the '''Maclaurin series''' and is named after Scottish mathematician Colin Maclaurin, who made extensive use of these series in the 18th century.<ref name=ColinMaclaurin>[http://en.wikipedia.org/wiki/Colin_Maclaurin Colin Maclaurin]. Wikipedia.</ref> 
==Finding the Taylor Series for a Specific Function==  ==Finding the Taylor Series for a Specific Function==  
Line 164:  Line 166:  
Its derivatives are:  Its derivatives are:  
  :<math> f'(x)=1/x </math>,  +  :<math> f'(x)=1/x </math>, 
+  :<math> f''(x)=1/x^2 </math>,  
+  :<math> f ^{(3)}(x)=2/x^3</math>,  
+  ::<math>\vdots</math>  
+  :<math>, f ^{(k)}(x) = {{(1)^{k1} \cdot (k1)!} \over x^k}</math>  
  Since this function and its derivatives are undefined at ''x'' = 0, we cannot construct a Maclaurin series ({{EquationNoteEq. 3}}) for it. Note that, when choosing ''a'', one should select a value  +  Since this function and its derivatives are undefined at ''x'' = 0, we cannot construct a Maclaurin series ({{EquationNoteEq. 3}}) for it. Note that, when choosing ''a'', one should select a value at which the derivatives ''f'' <sup>(''k'')</sup>(''a'') exist ''and'' at which they can be evaluated. For instance, centering our Taylor series at ''a'' = 2 would not be helpful because ''f'' <sup>(0)</sup>(2) = ln (2) is unknown and, in fact, cannot even be approximated until we have obtained our Taylor series. While it would be possible to write out the Taylor series, it would not be usable. 
For the natural log, it makes sense to let ''a'' = 1 and compute the derivatives at this point:  For the natural log, it makes sense to let ''a'' = 1 and compute the derivatives at this point:  
  :<math> f(1) = \ln 1 = 0</math>, <math> f'(1) = {1 \over 1} = 1</math>, <math> f''(1) = { 1 \over 1^2} = 1</math>, <math> f ^{(3)} (1) = {2 \over 1^3} = 2,  +  :<math> f(1) = \ln 1 = 0</math>, 
+  :<math> f'(1) = {1 \over 1} = 1</math>,  
+  :<math> f''(1) = { 1 \over 1^2} = 1</math>,  
+  :<math> f ^{(3)} (1) = {2 \over 1^3} = 2</math>,  
+  ::<math>\vdots</math>  
+  :<math> f ^{(k)} (1) = {(1)^{k1} \cdot (k1)!}</math>  
{{AnchorReference=Figure3Link=[[Image:Taylorlog.gifrightthumb350pxFigure 3<br>Taylor series for natural log]]}}  {{AnchorReference=Figure3Link=[[Image:Taylorlog.gifrightthumb350pxFigure 3<br>Taylor series for natural log]]}}  
Line 177:  Line 188:  
:<math> \ln (x) = (x1)  {(x1)^2 \over 2} + {(x1)^3 \over 3} + \cdots </math>  :<math> \ln (x) = (x1)  {(x1)^2 \over 2} + {(x1)^3 \over 3} + \cdots </math>  
  We can avoid the cumbersome (''x''  1)<sup>k</sup> notation by introducing a new function ''g''(''x'') = ln (1 + ''x''). Now we can expand our polynomial around ''x'' = 0:  +  We can avoid the cumbersome (''x''  1)<sup>k</sup> notation by introducing a new function, ''g''(''x'') = ln (1 + ''x''). Now we can expand our polynomial around ''x'' = 0: 
:<math> \ln (1 + x) = x  {x^2 \over 2} + {x^3 \over 3}  {x^4 \over 4} + \cdots </math>  :<math> \ln (1 + x) = x  {x^2 \over 2} + {x^3 \over 3}  {x^4 \over 4} + \cdots </math>  
  The animation to the right shows this Taylor polynomial with degree ''n'' varying from 0 to 25. As we can see, at lower values, the polynomial quickly comes to generate a close approximation of the original function. However, the right side exhibits some strange behavior: the polynomial  +  The animation to the right shows this Taylor polynomial with degree ''n'' varying from 0 to 25. As we can see, at lower values, the polynomial quickly comes to generate a close approximation of the original function. However, the right side exhibits some strange behavior: the polynomial [[Convergencediverges]] as ''n'' grows larger. This tells us that ''a Taylor series is not always a reliable approximation of the original function''. The fact that they have same derivatives at one point doesn't always guarantee that the Taylor series will represent a suitable approximation at all values of ''x'', even for arbitrarily large ''n''. Other factors need to be considered. 
  Alas, power series, like the Taylor series for ln(1 + ''x''), do not necessarily  +  Alas, power series, like the Taylor series for ln(1 + ''x''), do not necessarily converge for all values of ''x''. The Taylor series for natural log is divergent when <math>x > 1</math>, while a valid polynomial approximation needs to be convergent. Consider an arbitrary term in this series, <math>\pm x^n \over n</math>. As ''n'' increases, the denominator grows linearly, and the numerator [[Exponential Growthgrows exponentially]]. For arbitrarily large ''n'', exponential growth will override linear growth, so the convergence or divergence of the series is determined by ''x''<sup>''n''</sup>. If ''x'' > 1, then the Taylor series will diverge, hence the abnormal behavior of the right side of [[#Figure3Figure 3]]. In this "divergent zone," although we can still write out and evaluate the polynomial for whatever'' n'' we like, we cannot expect it to approximate the original function. 
Does this make it impossible to approximate ln(1 +''x'') for ''x'' greater than 1? It would seem that this would make our Taylor series useless in many cases. For example, imagine that we want to approximate ln(4):  Does this make it impossible to approximate ln(1 +''x'') for ''x'' greater than 1? It would seem that this would make our Taylor series useless in many cases. For example, imagine that we want to approximate ln(4):  
Line 195:  Line 206:  
:<math> \approx 1 + (0.47152  {0.47152^2 \over 2} + {0.47152^3 \over 3}  {0.47152^4 \over 4} + \cdots)</math>  :<math> \approx 1 + (0.47152  {0.47152^2 \over 2} + {0.47152^3 \over 3}  {0.47152^4 \over 4} + \cdots)</math>  
  Since the Taylor series we found only converged for ''x'' < 1, we had to find some way to reduce the argument, 4, so that ''x'' was less than 1; we also needed to do this in such a way that the value of the whole expression remained unchanged. By using the identity ln(''a'' ·''b'' ) = ln (''a'' ) + ln (''b'' ), we were able to rewrite the logarithm so that our Taylor series did not diverge. Larger powers of ''e'' ([[Euler's NumberEuler's number]]) may be used for larger values of ''x''.  +  Since the Taylor series we found only converged for ''x'' < 1, we had to find some way to reduce the argument, 4, so that ''x'' was less than 1; we also needed to do this in such a way that the value of the whole expression remained unchanged. By using the identity ln(''a'' ·''b'' ) = ln(''a'' ) + ln(''b'' ), we were able to rewrite the logarithm so that our Taylor series did not diverge. Larger powers of ''e'' ([[Euler's NumberEuler's number]]) may be used for larger values of ''x''. 
Line 203:  Line 214:  
*With this information, we could substitute into {{EquationNoteEq. 2}} to obtain our Taylor series.  *With this information, we could substitute into {{EquationNoteEq. 2}} to obtain our Taylor series.  
**In this example, we modified this Taylor series by recentering it around 0. This is generally not necessary; many Taylor series can be centered around ''x'' = 0 to begin with.  **In this example, we modified this Taylor series by recentering it around 0. This is generally not necessary; many Taylor series can be centered around ''x'' = 0 to begin with.  
  *In using our Taylor series, we had to be attentive to its "divergent zone." This, also, is not always necessary, since other Taylor series, like those introduced in the next section,  +  *In using our Taylor series, we had to be attentive to its "divergent zone." This, also, is not always necessary, since other Taylor series, like those introduced in the next section, converge for all values of ''x''. 
==Other Taylor Series==  ==Other Taylor Series==  
Line 215:  Line 226:  
In comparison with the above example of ln(''x''), these Taylor series are perhaps more straightforward to derive, even though they look slightly more complicated. Because the derivatives of sine, cosine and ''e<sup>x</sup>'' are all defined and easily evaluable at ''x'' = 0, we can center  In comparison with the above example of ln(''x''), these Taylor series are perhaps more straightforward to derive, even though they look slightly more complicated. Because the derivatives of sine, cosine and ''e<sup>x</sup>'' are all defined and easily evaluable at ''x'' = 0, we can center  
  their respective Taylor series at 0 from the outset. As noted above, these series  +  their respective Taylor series at 0 from the outset. As noted above, these series converge for all ''x'' (although a given Taylor polynomial for some finite ''n'' may not be ''accurate'', particularly for values of ''x'' that are not close to the base point; see [[#Error Bound of a Taylor Serieserror bound]]). 
  Note that the powers of each successive term in the Taylor series for sine and cosine increase by 2, and each term alternates between positive and negative; this makes sense when we consider the nature of successive derivatives of sin (''x'') and cos(''x'') at ''x'' = 0. Their derivatives cycle through 1, 0, 1, and 0, so we obtain a pattern like that observed above, where every other term is  +  Note that the powers of each successive term in the Taylor series for sine and cosine increase by 2, and each term alternates between positive and negative; this makes sense when we consider the nature of successive derivatives of sin (''x'') and cos(''x'') at ''x'' = 0. Their derivatives cycle through 1, 0, 1, and 0, so we obtain a pattern like that observed above, where every other term is zero and the remaining terms alternate in signs. 
The Taylor series for ''e''<sup>''x''</sup> follows from the fact that the derivative of ''e''<sup>''x''</sup> is itself. ''e''<sup>''x''</sup> will be derived in [[#Approximating eApproximating ''e'']]. Let the derivation of Taylor series for sine and cosine using {{EquationNoteEq. 2}} be left to the reader.  The Taylor series for ''e''<sup>''x''</sup> follows from the fact that the derivative of ''e''<sup>''x''</sup> is itself. ''e''<sup>''x''</sup> will be derived in [[#Approximating eApproximating ''e'']]. Let the derivation of Taylor series for sine and cosine using {{EquationNoteEq. 2}} be left to the reader.  
  These days, Taylor series are not  +  These days, Taylor series are not often used directly to approximate the trigonometric functions, since it is easy enough to approximate the trigonometric functions using a calculator. They are, however, used in various indirect ways. For instance, we can compute the Taylor series of the function composition sin (2''x''<sup>2</sup>) by substituting 2''x''<sup>2</sup> for ''x'' into the Taylor series for sin(''x''): 
:<math>\sin (2x^2) = 2x^2  {(2x^2)^3 \over 3!} + {(2x^2)^5 \over 5!}  {(2x^2)^7 \over 7!} + \cdots = 2x^2  {8x^6 \over 3!} + {32x^{10} \over 5!}  {128x^{14} \over 7!} + \cdots</math>  :<math>\sin (2x^2) = 2x^2  {(2x^2)^3 \over 3!} + {(2x^2)^5 \over 5!}  {(2x^2)^7 \over 7!} + \cdots = 2x^2  {8x^6 \over 3!} + {32x^{10} \over 5!}  {128x^{14} \over 7!} + \cdots</math>  
  More complicated composition is also possible; for instance, to find the Taylor series for <math>e^{\sin x}</math> one may substitute the whole Taylor series of sin(''x'') for ''x'' in the Taylor series for ''e<sup>x</sup>.'' In physics, it is often useful to make approximations using the first few terms of a Taylor series. The [[Rope around the EarthRope around the Earth]] problem is one instance where  +  More complicated composition is also possible; for instance, to find the Taylor series for <math>e^{\sin x}</math> one may substitute the whole Taylor series of sin(''x'') for ''x'' in the Taylor series for ''e<sup>x</sup>.'' In physics, it is often useful to make approximations using the first few terms of compositions of a Taylor series. The [[Rope around the EarthRope around the Earth]] problem is one instance where this technique is necessary. 
  It is also possible to compose ''other'' objects into Taylor series  +  It is also possible to compose ''other'' objects into Taylor series . For instance, if we have a square [[Matrixmatrix]] ''A'', the operation ''e<sup>A</sup>'' is not defined by the normal rules of exponents. What does it mean, anyway, to put something to the power of a matrix? However, we can compose the matrix ''A'' into the Taylor series for ''e'': 
:<math>e^A = I + A + {1 \over 2!}A^2 + {1 \over 3!}A^3 + {1 \over 4!}A^4 + {1 \over 5!}A^5 + \cdots</math>, where ''I'' is the identity matrix of the same size as ''A''.  :<math>e^A = I + A + {1 \over 2!}A^2 + {1 \over 3!}A^3 + {1 \over 4!}A^4 + {1 \over 5!}A^5 + \cdots</math>, where ''I'' is the identity matrix of the same size as ''A''.  
  This composition is necessary for solving some [[Systems of Linear Differential Equationssystems of linear differential equations]]. Hopefully these brief examples  +  This composition is necessary for solving some [[Systems of Linear Differential Equationssystems of linear differential equations]]. Hopefully these brief examples give you an idea of how powerful Taylor series can be when applied to other branches of mathematics! 
Line 273:  Line 284:  
We should not expect to be able to calculate the exact error. If that were possible, then we would be able to find an exact "approximation" by adding the "error" to our Taylor polynomial. Similarly, we cannot directly compare the approximate value to the actual value because we don't know the actual value! What we can do is ''bound'' the error; we can find how accurate our approximation is ''at worst''.  We should not expect to be able to calculate the exact error. If that were possible, then we would be able to find an exact "approximation" by adding the "error" to our Taylor polynomial. Similarly, we cannot directly compare the approximate value to the actual value because we don't know the actual value! What we can do is ''bound'' the error; we can find how accurate our approximation is ''at worst''.  
  Consider a function <math>f (x)</math> for which we have a Taylor polynomial <math>P_n (x)</math> centered at ''a''. We would like to find a formula to bound our approximation. We define the '''remainder''' <math>R_n (x)</math>  +  Consider a function <math>f (x)</math> for which we have a Taylor polynomial <math>P_n (x)</math> centered at ''a''. We would like to find a formula to bound our approximation. We define the '''remainder''' <math>R_n (x)</math> as: 
:<math>R_n (x) = f (x)  P_n (x)</math>, or  :<math>R_n (x) = f (x)  P_n (x)</math>, or  
Line 284:  Line 295:  
It is not obvious how {{EquationNoteEq. 4}} is derived from our definition of remainder; the proof is rather complex and unintuitive. You can choose to skip the derivation and go on to learn how to use the above equation to bound the error of a Taylorpolynomial approximation.  It is not obvious how {{EquationNoteEq. 4}} is derived from our definition of remainder; the proof is rather complex and unintuitive. You can choose to skip the derivation and go on to learn how to use the above equation to bound the error of a Taylorpolynomial approximation.  
{{SwitchPreviewHideMessage=Click here to hide the derivation of Eq. 4ShowMessage=Click here to show the derivation of Eq. 4.  {{SwitchPreviewHideMessage=Click here to hide the derivation of Eq. 4ShowMessage=Click here to show the derivation of Eq. 4.  
  PreviewText=FullText=  +  PreviewText=FullText=:Recall that we constructed our Taylor polynomial ''P<sub>n</sub>''(''x'') such that ''f''(''x'') and ''P<sub>n</sub>''(''x'') have the same first ''n'' derivatives at ''a''. We also defined 
  +  
  +  
  +  
  :Recall that we constructed our Taylor polynomial ''P<sub>n</sub>''(''x'') such that ''f''(''x'') and ''P<sub>n</sub>''(''x'') have the same first ''n'' derivatives at ''a''. We also defined  +  
::<math>R_n(x) = f(x)  P_n(x)</math>.  ::<math>R_n(x) = f(x)  P_n(x)</math>.  
Line 335:  Line 342:  
:Examine the integral:  :Examine the integral:  
  ::<math>\int_a^x (MxMa)dx = \left[ {Mx^2 \over 2}  Max \right]_a^x = {Mx^2 \over 2}  Max  {Ma^2 \over 2} + Ma^2 = {Mx^2 \over 2}  Max + {Ma^2 \over 2} = {M \over 2}(x^2  2ax + a^2) = {M \over 2}(x  a)^2</math>  +  ::<math>\begin{align} 
+  \int_a^x (MxMa)dx &= \left[ {Mx^2 \over 2}  Max \right]_a^x \\  
+  &= {Mx^2 \over 2}  Max  {Ma^2 \over 2} + Ma^2 = {Mx^2 \over 2}  Max + {Ma^2 \over 2} \\  
+  &= {M \over 2}(x^2  2ax + a^2) \\  
+  &= {M \over 2}(x  a)^2  
+  \end{align}</math>  
:So we now have:  :So we now have:  
Line 343:  Line 355:  
:It might be intuitively evident that, integrating this inequality ''n''  1 more times, we will obtain {{EquationNoteEq. 4}}. We will now demonstrate this by induction.  :It might be intuitively evident that, integrating this inequality ''n''  1 more times, we will obtain {{EquationNoteEq. 4}}. We will now demonstrate this by induction.  
  ::Above we established the base case. We now assume that  +  ::Above we established the base case. We now assume that {{EquationNoteEq. 4}} holds for some integer ''k'' < ''n'' and will demonstrate that it therefore holds for ''k'' + 1. 
:::<math>{M \over k!}(xa)^k \leq R^{(n+1k)}_n(x) \leq {M \over k!}(xa)^k</math>  :::<math>{M \over k!}(xa)^k \leq R^{(n+1k)}_n(x) \leq {M \over k!}(xa)^k</math>  
Line 351:  Line 363:  
:::<math>\int_a^x {M \over k!}(xa)^k dx = \left[ {M \over (k+1)!}(xa)^{k+1} \right]_a^x = {M \over (k+1)!}(xa)^{k+1}  {M \over (k+1)!}(aa)^{k+1} = {M \over (k+1)!}(xa)^{k+1}</math>  :::<math>\int_a^x {M \over k!}(xa)^k dx = \left[ {M \over (k+1)!}(xa)^{k+1} \right]_a^x = {M \over (k+1)!}(xa)^{k+1}  {M \over (k+1)!}(aa)^{k+1} = {M \over (k+1)!}(xa)^{k+1}</math>  
  ::  +  ::As established previously, the first ''n'' derivatives of ''R<sub>n</sub>''(''x'') evaluated at ''x'' = ''a'' are 0, so we obtain: 
:::<math>{M \over (k+1)!}(xa)^{k+1} \leq R^{(nk)}_n(x) \leq {M \over (k+1)!}(xa)^{k+1}</math>  :::<math>{M \over (k+1)!}(xa)^{k+1} \leq R^{(nk)}_n(x) \leq {M \over (k+1)!}(xa)^{k+1}</math>  
Line 360:  Line 372:  
::<math> R_n(x) \leq {M \over (n+1)!}(xa)^{n+1}</math>.  ::<math> R_n(x) \leq {M \over (n+1)!}(xa)^{n+1}</math>.  
  +  }}  
  +  
How might one use {{EquationNoteEq. 4}} to check the accuracy of a Taylor polynomial? ''M'' is an upper bound on the (''n''+1)<sup>th</sup> derivative of ''f'' on the interval [''a'', ''x''] (that is, on the interval between where the Taylor polynomial is centered and where it is being evaluated). This seems fairly arbitrary but may make more sense in practice.  How might one use {{EquationNoteEq. 4}} to check the accuracy of a Taylor polynomial? ''M'' is an upper bound on the (''n''+1)<sup>th</sup> derivative of ''f'' on the interval [''a'', ''x''] (that is, on the interval between where the Taylor polynomial is centered and where it is being evaluated). This seems fairly arbitrary but may make more sense in practice.  
Line 389:  Line 400:  
In [[#Figure4Figure 4]], the "flattened" part in the center of the graph is where our approximation is "good". To the naked eye, at least, the error appears to be very close to 0.  In [[#Figure4Figure 4]], the "flattened" part in the center of the graph is where our approximation is "good". To the naked eye, at least, the error appears to be very close to 0.  
  Notice, in [[#Figure5Figure 5]], that the approximation becomes sufficiently close to 0 for the lower ''x'' value much more quickly  +  Notice, in [[#Figure5Figure 5]], that the approximation becomes sufficiently close to 0 for the lower ''x'' value much more quickly than it does for higher ''x'' values. But by including enough terms, we can make our approximation as accurate as we would like at either point. In this figure, it is also noteworthy that, although the error eventually displays a 0 in each decimal place, the error at any value never actually ''reaches'' 0, so long as ''n'' is finite. Finally, note that ''R<sub>n</sub>'' in this graphic is ''actual error'', the difference between the Taylor polynomial and the original function, not the error bound computed by bounding''f'' <sup>(''k'' + 1)</sup>(''c''). 
  As [[#Figure4Figure 4]] shows  +  As [[#Figure4Figure 4]] shows, the error bound is rarely equal to actual error; it is usually greater, often much greater, than the actual error. For instance, 
:<math>P_5(1)  \sin (1) = 0.000196 \cdots</math>  :<math>P_5(1)  \sin (1) = 0.000196 \cdots</math>  
Line 402:  Line 413:  
  Suppose that we would like to make an approximation of <math>f(x) = e^{2x}</math> at ''x'' = 0.25. Say we choose to make a 3<sup>rd</sup>degree Taylor approximation using the Taylor polynomial centered at 0. The Taylor  +  Suppose that we would like to make an approximation of the value of <math>f(x) = e^{2x}</math> at ''x'' = 0.25. Say we choose to make a 3<sup>rd</sup>degree Taylor approximation using the Taylor polynomial centered at 0. The Taylor polynomial is: 
  :<math>  +  :<math>P_3 (x) = 1 + {2(0.25) \over 1!} + {4(0.25)^2 \over 2!} + {8(0.25)^3 \over 3!} = 1.6458333\cdots</math> 
The error is:  The error is:  
  :<math>  +  :<math>R_3 (x) = {M \over 4!} (0.25)^{4}</math> 
  How do we bound  +  How do we bound ''M'' on the interval [0, 0.25]? We know that in general, 
:<math>{d^k \over dx^k}e^{px} = p^k e^{px}</math>  :<math>{d^k \over dx^k}e^{px} = p^k e^{px}</math>  
  Evaluating this initially seems to be problematic. In our example, ''p'' = 2, and ''p''  +  Evaluating this initially seems to be problematic. In our example, ''p'' = 2, and ''p''<sup>''k''</sup> can be calculated easily. But we don't know what ''e''<sup>2''x''</sup> is at most for the interval [0, 0.25]; that is why we are making a Taylor polynomial approximation in the first place! However, we just need to recall that we are looking for an error ''bound'', which does not to be exact. We know: 
  :<math>e^{2 \cdot 0.25} = e^{0.5} = \sqrt{e}  +  :<math>e^{2 \cdot 0.25} = e^{0.5} = \sqrt{e}</math>. 
  +  Moreover,  
  :<math>  +  :<math>e < 4</math>, 
  +  so  
+  
+  :<math>\sqrt{e} < \sqrt{4}</math>.  
+  
+  Thus we are certain that on the interval [0, 0.25], <math>e^{2x} < 2</math>. Each differentiation doubles this bound, so  
  :<math>  +  :<math>M = 2 \cdot 2^{n+1}</math>. 
  +  We can now finish calculating the error:  
  :<math>  +  :<math>R_3 (x) \leq {2 \cdot 2^4 \over 4!} (0.25)^{4} = 0.00521</math> 
  +  
This gives us a good idea of how accurate our approximation is. The actual value of the function is less than 0.00521 away from the thirddegree Taylor approximation:  This gives us a good idea of how accurate our approximation is. The actual value of the function is less than 0.00521 away from the thirddegree Taylor approximation:  
:<math>P_3(0.25)  R_3(0.25) < f(0.25) < P_3(0.25) + R_3(0.25)</math>  :<math>P_3(0.25)  R_3(0.25) < f(0.25) < P_3(0.25) + R_3(0.25)</math>  
  :<math>1.  +  :<math>1.640623 < e^{0.5} < 1.651043</math> 
  Suppose that we desire greater accuracy. Say, specifically, that we would like to know what degree Taylor polynomial would be necessary to have error less than 10<sup>4</sup>. We must solve for ''N'':  +  Suppose that we desire greater accuracy. Say, specifically, that we would like to know what degree Taylor polynomial would be necessary to have error less than 10<sup>4</sup>. We must solve for ''N'' where: 
  :<math>  +  :<math>{2 \cdot 0.5^{N+1} \over (N+1)!} < {1 \over 10^4}</math> 
  +  
  By substituting in various values of ''N'', we find that the lowest integer for which this inequality holds is ''N'' = 5.  +  By substituting in various values of ''N'', we find that the lowest integer for which this inequality holds is ''N'' = 5, so if we want to be sure our approximation has an error of less than 10^<sup>4</sup>, we should use a 5<sup>th</sup> degree Taylor polynomial. 
<!end of hide for R_n section in general>}}  <!end of hide for R_n section in general>}}  
Line 457:  Line 470:  
Have you ever wondered how calculators determine square roots, sines, cosines, and exponentials? For instance, if you were to type <math>\sin{\pi \over 2}</math> or <math>e^2</math> into your calculator, how does it determine which value to spit out? The number must be related to our input in some way, but what exactly is the relationship? Does the calculator just read from an index of known values? Is there a more mathematical and precise way for the calculator to evaluate these functions?  Have you ever wondered how calculators determine square roots, sines, cosines, and exponentials? For instance, if you were to type <math>\sin{\pi \over 2}</math> or <math>e^2</math> into your calculator, how does it determine which value to spit out? The number must be related to our input in some way, but what exactly is the relationship? Does the calculator just read from an index of known values? Is there a more mathematical and precise way for the calculator to evaluate these functions?  
  The answer to this latter question is yes. There are algorithms that give an approximate value of sine, for example, using only the four basic operations (+, , x, /)<ref name = ref1>[http://www.homeschoolmath.net/teaching/sine_calculator.php How does the calculator find values of sine], from homeschoolmath. This is an article about calculator programs for approximating functions.</ref>. Before the age of electronic calculators, mathematicians studied these algorithms in order to approximate these functions manually. The Taylor series, named after English mathematician Brook Taylor, is one such way of making these approximations. Basically, Taylor said that there is a way to expand any [[Differentiabilityinfinitely differentiable]] function into a polynomial series about a certain point. The  +  The answer to this latter question is yes. There are algorithms that give an approximate value of sine, for example, using only the four basic operations (+, , x, /)<ref name = ref1>[http://www.homeschoolmath.net/teaching/sine_calculator.php How does the calculator find values of sine], from homeschoolmath. This is an article about calculator programs for approximating functions.</ref>. Before the age of electronic calculators, mathematicians studied these algorithms in order to approximate these functions manually. The Taylor series, named after English mathematician Brook Taylor, is one such way of making these approximations. Basically, Taylor said that there is a way to expand any [[Differentiabilityinfinitely differentiable]] function into a polynomial series about a certain point. The strength of the Taylor series is its ability to approximate certain functions that cannot otherwise be calculated. 
  The calculator's algorithm uses this method to efficiently find a suitable approximation in the form of a polynomial series. Expanding enough terms for several digits of accuracy is easy for a computing device, even though Taylor series may look daunting and tedious to the naked eye. This algorithm is built in the permanent memory (ROM) of electronic calculators, and is triggered when a function like sine or cosine is called<ref name = ref2>[http://en.wikipedia.org/wiki/Calculator Calculator], from Wikipedia. This article explains the structure of an electronic calculator.</ref>.  +  The calculator's algorithm for many functions uses this method to efficiently find a suitable approximation in the form of a polynomial series. Expanding enough terms for several digits of accuracy is easy for a computing device, even though Taylor series may look daunting and tedious to the naked eye. This algorithm is built in the permanent memory (ROM) of electronic calculators, and is triggered when a function like sine or cosine is called<ref name = ref2>[http://en.wikipedia.org/wiki/Calculator Calculator], from Wikipedia. This article explains the structure of an electronic calculator.</ref>. 
Line 521:  Line 534:  
:<math>\pi = \sqrt{12}(1  {1 \over {3 \cdot 3}} + {1 \over {5 \cdot 3^2}}  {1 \over {7 \cdot 3^3}} + \cdots)</math>  :<math>\pi = \sqrt{12}(1  {1 \over {3 \cdot 3}} + {1 \over {5 \cdot 3^2}}  {1 \over {7 \cdot 3^3}} + \cdots)</math>  
  This series is much more efficient than the Leibniz series, since there are powers of 3 in the denominators. The first 10 terms of it give us 5 accurate digits, and the first 100 terms give us 50. Leibniz himself used the first 22 terms to compute an approximation of  +  This series is much more efficient than the Leibniz series, since there are powers of 3 in the denominators. The first 10 terms of it give us 5 accurate digits, and the first 100 terms give us 50. Leibniz himself used the first 22 terms to compute an approximation of π, which is correct to 11 decimal places: 3.14159265358. 
However, mathematicians were still not satisfied with this efficiency. They kept substituting smaller ''x'' values into {{EquationNoteEq. 5a}} to get more convergent series. Among the mathematicians who did this was Leonhard Euler, one of the greatest mathematicians in the 18<sup>th</sup> century. In his attempt to approximate <math>\pi</math>, Euler discovered the following nonintuitive formula:  However, mathematicians were still not satisfied with this efficiency. They kept substituting smaller ''x'' values into {{EquationNoteEq. 5a}} to get more convergent series. Among the mathematicians who did this was Leonhard Euler, one of the greatest mathematicians in the 18<sup>th</sup> century. In his attempt to approximate <math>\pi</math>, Euler discovered the following nonintuitive formula:  
Line 529:  Line 542:  
Although {{EquationNoteEq. 5c}} looks really weird, it is indeed an equality, not an approximation. The following hidden section shows how it is derived in detail.  Although {{EquationNoteEq. 5c}} looks really weird, it is indeed an equality, not an approximation. The following hidden section shows how it is derived in detail.  
  {{HideShowThisShowMessage=Click to show the derivation of Eq. 5cHideMessage='''Click to hide this message.HiddenText=  +  {{HideShowThisShowMessage=Click to show the derivation of Eq. 5cHideMessage='''Click to hide this message.HiddenText=:{{EquationNoteEq. 5c}} comes from the trigonometric identity of the tangent of two angles. Suppose we have 3 angles, <math>\alpha</math>, <math>\beta</math>, and <math>\gamma</math> that satisfy: 
  +  
  +  
  +  
  :{{EquationNoteEq. 5c}} comes from the trigonometric identity of the tangent of two angles. Suppose we have 3 angles, <math>\alpha</math>, <math>\beta</math>, and <math>\gamma</math> that satisfy:  +  
::<math>\gamma = \alpha  \beta</math>  ::<math>\gamma = \alpha  \beta</math>  
Line 568:  Line 577:  
::<math>\arctan 1 = \arctan {1 \over 2} + \arctan {1 \over 3}</math>  ::<math>\arctan 1 = \arctan {1 \over 2} + \arctan {1 \over 3}</math>  
  :So it turns out that the angle  +  :So it turns out that the angle is arctan (1/3). Substituting this into {{EquationNoteStep 1}} yields: 
{{AnchorReference=Figure7dLink=[[Image:EulerApproximationed.gifrightthumb400pxFigure 7d<br>Euler's approximation of <math>\pi</math>]]}}  {{AnchorReference=Figure7dLink=[[Image:EulerApproximationed.gifrightthumb400pxFigure 7d<br>Euler's approximation of <math>\pi</math>]]}}  
Line 595:  Line 604:  
:We can certainly carry on to keep dividing it into even smaller angles, or try different values for ''a'' and ''b'' to get different series, but Euler stopped here because he thought these angles were small enough to give him an efficient algorithm.  :We can certainly carry on to keep dividing it into even smaller angles, or try different values for ''a'' and ''b'' to get different series, but Euler stopped here because he thought these angles were small enough to give him an efficient algorithm.  
  +  }}  
NumChars=0}}  NumChars=0}}  
Line 606:  Line 615:  
This series converges so fast that each term of it gives more than 1 digit of <math>\pi</math>. Using this algorithm, it will not take more several days to calculate the first 35 digits of <math>\pi</math> with pencil and paper, which Ludolph spent most of his life on.  This series converges so fast that each term of it gives more than 1 digit of <math>\pi</math>. Using this algorithm, it will not take more several days to calculate the first 35 digits of <math>\pi</math> with pencil and paper, which Ludolph spent most of his life on.  
  Although Euler himself never undertook the calculation, this idea was developed and used by many other mathematicians at his time. In 1789, the Slovene mathematician Jurij Vega calculated 140 decimal places for <math>\pi</math>, 126 of which were correct. This record was broken in 1841, when William Rutherford calculated 208 decimal places, 152 of which  +  Although Euler himself never undertook the calculation, this idea was developed and used by many other mathematicians at his time. In 1789, the Slovene mathematician Jurij Vega calculated 140 decimal places for <math>\pi</math>, 126 of which were correct. This record was broken in 1841, when William Rutherford calculated 208 decimal places, 152 of which were correct. By the time of the invention of electronic digital computers, <math>\pi</math> had been expanded to more than 500 digits. All of these efficient approximations began with the Taylor series of trigonometric functions! 
Acknowledgement: Most of the historical information in this section comes from [http://www.maa.org/editorial/euler/HEDI%2064%20Estimating%20pi.pdf this article]<ref name = ref8>[http://www.maa.org/editorial/euler/HEDI%2064%20Estimating%20pi.pdf How Euler Did It], by Ed Sandifer. This articles talks about Euler's algorithm for estimating π.</ref>.  Acknowledgement: Most of the historical information in this section comes from [http://www.maa.org/editorial/euler/HEDI%2064%20Estimating%20pi.pdf this article]<ref name = ref8>[http://www.maa.org/editorial/euler/HEDI%2064%20Estimating%20pi.pdf How Euler Did It], by Ed Sandifer. This articles talks about Euler's algorithm for estimating π.</ref>.  
Line 620:  Line 629:  
:<math> e = \lim_{n \to \infin} (1 + {1 \over n}) ^n</math>  :<math> e = \lim_{n \to \infin} (1 + {1 \over n}) ^n</math>  
  In principle, we can approximate  +  In principle, we can approximate ''e'' using this definition. However, this method is slow and inefficient. For example, let ''n'' = 100 and substitute it into the definition. We get: 
:<math> e \approx (1 + {1 \over 100}) ^{100} = 2.70481 \cdots</math>  :<math> e \approx (1 + {1 \over 100}) ^{100} = 2.70481 \cdots</math>  
Line 659:  Line 668:  
:<math> e^x = 1 + x + {x^2 \over 2!} + {x^3 \over 3!} + \cdots + {x^n \over n!}</math>  :<math> e^x = 1 + x + {x^2 \over 2!} + {x^3 \over 3!} + \cdots + {x^n \over n!}</math>  
  In [[#Figure8bFigure 8b]], these two approximations are graphed together  +  In [[#Figure8bFigure 8b]], these two approximations are graphed together with the original function ''e''<sup>''x''</sup>. As we can see in the animation, the Taylor series approximates the original function much faster than the definition does. 
}}  }}  
Line 693:  Line 702:  
In any case, it is necessary to have some idea of how accurate an approximation is. Here, we will try to at least get a sense of just how accurate these smallangle approximations are.  In any case, it is necessary to have some idea of how accurate an approximation is. Here, we will try to at least get a sense of just how accurate these smallangle approximations are.  
  {{AnchorReference=Figure10bLink=[[Image:Small_rel_error.gifrightthumb320pxFigure 10b<br>The relative error (the absolute error divided by the actual function value) of the various small angle approximations. The horizontal, black curve represents 1%  +  {{AnchorReference=Figure10bLink=[[Image:Small_rel_error.gifrightthumb320pxFigure 10b<br>The relative error (the absolute error divided by the actual function value) of the various small angle approximations. The horizontal, black curve represents 1% error.]]}} 
One way to do this would be to bound the error of our approximation as we do above in [[#Error Bound of a Taylor Serieserror bound of a Taylor series]], but, for reasons explained in that section, this would necessarily be an overestimation of the error, which is helpful in practical circumstances but not for the point we are trying to make in this section. We can simply compare our smallangle approximations to the actual values of the functions that they approximate.  One way to do this would be to bound the error of our approximation as we do above in [[#Error Bound of a Taylor Serieserror bound of a Taylor series]], but, for reasons explained in that section, this would necessarily be an overestimation of the error, which is helpful in practical circumstances but not for the point we are trying to make in this section. We can simply compare our smallangle approximations to the actual values of the functions that they approximate.  
Revision as of 09:39, 26 July 2013
Taylor Series 

Taylor Series
 Taylor series and Taylor polynomials allow us to approximate functions that are otherwise difficult to calculate. The image at the right, for example, shows how successive Taylor polynomials come to better approximate the function sin(x). In this page, we will focus on how such approximations might be obtained as well as how the error of such approximations might be bounded.
Contents 
Basic Description
A Taylor series is a power series representation of an infinitely differentiable function. In other words, many functions, like the trigonometric functions, can be written alternatively as an infinite series of terms.An n^{th}degree Taylor polynomial for a function is the sum of the first n terms of a Taylor series. As a finite series, a Taylor polynomial can be computed exactly (no limits needed). Although it will not exactly match the infinite Taylor series or the original function, the approximation becomes progressively better as n increases.
In the animation above, Taylor polynomials are compared to the actual function y = sin(x) using the following polynomial expansion:
 (for odd n)
n varies from 0 to 36. As n becomes larger and there are more terms in the Taylor polynomial, the Taylor polynomial comes to "look" more like the original function. In other words, it becomes a progressively better approximation of the function; it becomes more accurate.
How does one construct a Taylor series? As mentioned, Taylor series can be used to approximate infinitely differentiable functions. A Taylor polynomial, as will be shown later in the More Mathematical Explanation, is actually constructed according to the derivatives of a function at a certain point. The key idea behind Taylor series is this: Derivatives, roughly speaking, correspond to the shape of a curve, so the more derivatives that two functions have in common at one point, the more similar they will look at other nearby points.
Taylor series are important because they allow us to compute functions that cannot be computed directly. While the above Taylor polynomial for the sine function looks complicated and is annoying to evaluate by hand, it is just the sum of terms consisting of exponents and factorials, so the Taylor polynomial can be reduced to the basic operations of addition, subtraction, multiplication, and division. We can obtain an approximation by truncating the infinite Taylor series into a finitedegree Taylor polynomial, which we can evaluate.
The Taylor series for sine may not seem very useful to us, since we are used to hitting the sine function on our calculator which then spits out an answer. But our calculators actually make use of similar series to approximate the trigonometric functions, as well as other functions, to provide us with a decimal approximation. Likewise, physicists often take measurements and produce curves that do not clearly resemble a known function. However, they can use Taylor series to come up with a working model, even if it is not exact.
A More Mathematical Explanation
 Note: understanding of this explanation requires: *Calculus
Basic Use of Taylor Series
Readers may, without knowing it, already be familiar with a particular [...]Basic Use of Taylor Series
Readers may, without knowing it, already be familiar with a particular type of Taylor series. Consider an infinite geometric series with first term 1 and common ratio x:
 for
The left side of the equation is the formula for the sum of the convergent geometric series on the right. The right side is also an infinite power series, so it is the Taylor series for . Later we will provide examples of some other Taylor series, as well as the process for deriving them from the original functions.
Using Taylor series, we can approximate infinitely differentiable functions. For example, imagine that we want to approximate the sum of the infinite geometric series with first term 1 and common ratio . Using our knowledge of infinite geometric series, we know that the sum is . Let's see how the Taylor approximation does:
This secondorder Taylor polynomial brings us somewhat close to the value of that we obtained above. Let's observe how adding on another term can improve our estimate:
As we expect, this approximation is closer still to the actual value, but not exact. Adding more terms would improve this accuracy further, but so long as the amount of terms that we add is finite, the approximation will never be exact.
At this point, you may be wondering what the use of a Taylor series approximation is if, as in the previous example,
we don't need an estimate; we already have the exact answer on the lefthand side. Well, we don't always know the exact answer. For instance, a more complicated Taylor series is that of cos(x):
 where x is in radians.
In this case, it is easy to select x so that we cannot exactly evaluate the lefthand side of the equation. For such functions, making an approximation can be more valuable. For instance, consider:
First we must convert degrees to radians in order to use the Taylor series:
Then, substitute into the Taylor series of cosine above:
Here we have written the 4^{th}degree Taylor polynomial, but this should be enough to show us something. The right side of the equation can be reduced to the four simple operations, so we can easily calculate its value:
We can compare this to the value given by the calculator. The calculator's value, actually, is also an approximation obtained by a similar method, but we can expect it to be accurate for all displayed decimal places.
So our approximating value agrees with the "actual" value to three decimal places, which is good accuracy for a basic approximation. As above, better accuracy could be attained by using more terms in the Taylor series.
This result can be observed if we zoom in the graph at the intersection point, as shown in Figure 1. In a large graph, the functions look almost identical at the point x = 35°, but there is indeed a difference between these two functions, as the graph shows.
The General Form of a Taylor Series
In this subsection, we will derive the general formula for a function's Taylor series. We begin by defining Taylor polynomials as follows:
 The Taylor polynomial of degree n for f at a, written , is the polynomial that has the same 0^{th} to n^{th}order derivatives as function f(x) at point a. In other words, the n^{th}degree Taylor polynomial must satisfy:
 (the 0^{th}order derivative of a function is itself)
 where is the k^{th}order derivative of at a.
We define Taylor series as follows:
 The Taylor series is the infinite Taylor polynomial for which all derivatives at a are equal to those of .
The following set of images show some examples of Taylor polynomials, from 0^{th} to 2^{nd}order:



In order to construct a general formula for a Taylor series, we start with what we know: a Taylor series is a power series. Using the definition of power series, we write a general Taylor series for a function f around a as
 ,
in which a_{0}, a_{1}, a_{2}, ... are unknown coefficients. Our goal is to find a more useful expression for these coefficients.
By definition of a Taylor polynomial, we know that the function and Taylor series must have the same derivatives of all degrees evaluated at a:
 , , ,
How might we use this fact to bring us closer to finding the coefficients a_{0}, a_{1}, a_{2}, ...? Let's start by taking the first few derivatives of Eq. 1:
The pattern should now be recognizable, and it may be apparent how to solve for a_{k}. When we evaluate any of the above derivatives at x = a, only the constant term will remain because all terms with (x  a) go to 0. Note then what happens after k derivatives. We get:
 .
Since in addition by definition, we conclude
 ,
so
 .
This formula even holds for k=0, since 0! = 1. Thus it holds for all nonnegative integers k. So, using derivatives, we have obtained an expression for all unknown coefficients of T^{(k)} (x) in terms of the given function f. Substitute this back into Eq. 1 to get an explicit expression of Taylor series:
or, in summation notation,
 .
This is the standard formula of Taylor series that we will use throughout the rest of this page.
The n^{th}degree Taylor polynomial simply restricts this polynomial to a finite number, n, of terms:
or, in summation notation,
 .
In many cases, it is convenient to let a = 0 to get a neater expression:
Eq. 3 is called the Maclaurin series and is named after Scottish mathematician Colin Maclaurin, who made extensive use of these series in the 18th century.^{[1]}
Finding the Taylor Series for a Specific Function
Many Taylor series can be derived using Eq. 2 by substituting in f and a. Here we will demonstrate this process in detail for the natural logarithm function. The process in this section can be repeated for other elementary functions, such as sin(x), cos(x), and e ^{x}. Their Taylor series will be discussed in the other Taylor series section.
The natural log function is:
Its derivatives are:
 ,
 ,
 ,
Since this function and its derivatives are undefined at x = 0, we cannot construct a Maclaurin series (Eq. 3) for it. Note that, when choosing a, one should select a value at which the derivatives f ^{(k)}(a) exist and at which they can be evaluated. For instance, centering our Taylor series at a = 2 would not be helpful because f ^{(0)}(2) = ln (2) is unknown and, in fact, cannot even be approximated until we have obtained our Taylor series. While it would be possible to write out the Taylor series, it would not be usable.
For the natural log, it makes sense to let a = 1 and compute the derivatives at this point:
 ,
 ,
 ,
 ,
Substitute these derivatives into Eq. 2, and we can get the Taylor series for centered at x = 1:
We can avoid the cumbersome (x  1)^{k} notation by introducing a new function, g(x) = ln (1 + x). Now we can expand our polynomial around x = 0:
The animation to the right shows this Taylor polynomial with degree n varying from 0 to 25. As we can see, at lower values, the polynomial quickly comes to generate a close approximation of the original function. However, the right side exhibits some strange behavior: the polynomial diverges as n grows larger. This tells us that a Taylor series is not always a reliable approximation of the original function. The fact that they have same derivatives at one point doesn't always guarantee that the Taylor series will represent a suitable approximation at all values of x, even for arbitrarily large n. Other factors need to be considered.
Alas, power series, like the Taylor series for ln(1 + x), do not necessarily converge for all values of x. The Taylor series for natural log is divergent when , while a valid polynomial approximation needs to be convergent. Consider an arbitrary term in this series, . As n increases, the denominator grows linearly, and the numerator grows exponentially. For arbitrarily large n, exponential growth will override linear growth, so the convergence or divergence of the series is determined by x^{n}. If x > 1, then the Taylor series will diverge, hence the abnormal behavior of the right side of Figure 3. In this "divergent zone," although we can still write out and evaluate the polynomial for whatever n we like, we cannot expect it to approximate the original function.
Does this make it impossible to approximate ln(1 +x) for x greater than 1? It would seem that this would make our Taylor series useless in many cases. For example, imagine that we want to approximate ln(4):
It is clear that this series will diverge rapidly, which contradicts our knowledge that ln(4) is defined. With some clever mathematical footwork, though, we can still find a solution. Instead, we write:
Since the Taylor series we found only converged for x < 1, we had to find some way to reduce the argument, 4, so that x was less than 1; we also needed to do this in such a way that the value of the whole expression remained unchanged. By using the identity ln(a ·b ) = ln(a ) + ln(b ), we were able to rewrite the logarithm so that our Taylor series did not diverge. Larger powers of e (Euler's number) may be used for larger values of x.
Let's review what we have done to find a Taylor series for ln(1 + x). How might this process be generalized to finding other Taylor series?
 We began by choosing a base point at which we could evaluate the derivatives of our function.
 We then figured out what those derivatives would be and found a general expression for the k^{th} derivative of our function at a.
 With this information, we could substitute into Eq. 2 to obtain our Taylor series.
 In this example, we modified this Taylor series by recentering it around 0. This is generally not necessary; many Taylor series can be centered around x = 0 to begin with.
 In using our Taylor series, we had to be attentive to its "divergent zone." This, also, is not always necessary, since other Taylor series, like those introduced in the next section, converge for all values of x.
Other Taylor Series
Using the process described above, we can obtain Taylor series for a variety of other functions, such as the following:
 , expanded around the origin. x is in radians.
 , expanded around the origin. x is in radians.
 , expanded around the origin.
In comparison with the above example of ln(x), these Taylor series are perhaps more straightforward to derive, even though they look slightly more complicated. Because the derivatives of sine, cosine and e^{x} are all defined and easily evaluable at x = 0, we can center their respective Taylor series at 0 from the outset. As noted above, these series converge for all x (although a given Taylor polynomial for some finite n may not be accurate, particularly for values of x that are not close to the base point; see error bound).
Note that the powers of each successive term in the Taylor series for sine and cosine increase by 2, and each term alternates between positive and negative; this makes sense when we consider the nature of successive derivatives of sin (x) and cos(x) at x = 0. Their derivatives cycle through 1, 0, 1, and 0, so we obtain a pattern like that observed above, where every other term is zero and the remaining terms alternate in signs.
The Taylor series for e^{x} follows from the fact that the derivative of e^{x} is itself. e^{x} will be derived in Approximating e. Let the derivation of Taylor series for sine and cosine using Eq. 2 be left to the reader.
These days, Taylor series are not often used directly to approximate the trigonometric functions, since it is easy enough to approximate the trigonometric functions using a calculator. They are, however, used in various indirect ways. For instance, we can compute the Taylor series of the function composition sin (2x^{2}) by substituting 2x^{2} for x into the Taylor series for sin(x):
More complicated composition is also possible; for instance, to find the Taylor series for one may substitute the whole Taylor series of sin(x) for x in the Taylor series for e^{x}. In physics, it is often useful to make approximations using the first few terms of compositions of a Taylor series. The Rope around the Earth problem is one instance where this technique is necessary.
It is also possible to compose other objects into Taylor series . For instance, if we have a square matrix A, the operation e^{A} is not defined by the normal rules of exponents. What does it mean, anyway, to put something to the power of a matrix? However, we can compose the matrix A into the Taylor series for e:
 , where I is the identity matrix of the same size as A.
This composition is necessary for solving some systems of linear differential equations. Hopefully these brief examples give you an idea of how powerful Taylor series can be when applied to other branches of mathematics!
Consider another example:
It is clear that when x = 0, the quotient in this limit expression is undefined, so one cannot evaluate the limit by evaluating the quotient at 0. One way to evaluate the limit of an expression whose numerator and denominator both go to 0 is by using l'Hôpital's rule:
Alternatively, one can use Taylor series! Substitute the Taylor series for sin(x) in:
We have obtained the same limit.
Taylor series also help us understand the derivatives of these functions. Above it was mentioned that each derivative of e^{x} is itself. More generally, for any real c, the arbitrary k^{th} derivative of e^{cx} is given by:
If we substitute cx for x in our Taylor series for e^{x}, we get:
Differentiating this, we get:
Each differentiation of the Taylor series will multiply e^{cx} by c, as expected.
Error Bound of a Taylor Series
Throughout this page so far, we have often made reference to the accuracy of our Taylor polynomial approximations...
Throughout this page so far, we have often made reference to the accuracy of our Taylorpolynomial approximations. Recall that accuracy is the closeness of an approximation to its true value. It would be practical to be able to quantify the closeness of our approximations so that we can know how much we can rely on them, or so that we may add more terms if our approximation is not sufficiently accurate. In other words, we want to understand how much error there might be for a given Taylor approximation so that the approximation is usable.
We should not expect to be able to calculate the exact error. If that were possible, then we would be able to find an exact "approximation" by adding the "error" to our Taylor polynomial. Similarly, we cannot directly compare the approximate value to the actual value because we don't know the actual value! What we can do is bound the error; we can find how accurate our approximation is at worst.
Consider a function for which we have a Taylor polynomial centered at a. We would like to find a formula to bound our approximation. We define the remainder as:
 , or
A useful characterization of happens to be:
 where M is the upper bound for the (n+1)^{th} derivative of f on the interval [a, x].
It is not obvious how Eq. 4 is derived from our definition of remainder; the proof is rather complex and unintuitive. You can choose to skip the derivation and go on to learn how to use the above equation to bound the error of a Taylorpolynomial approximation.
 Recall that we constructed our Taylor polynomial P_{n}(x) such that f(x) and P_{n}(x) have the same first n derivatives at a. We also defined
 .
 It must hold that
 Since P_{n}(x) is an n^{th}degree polynomial, its (n + 1)^{th} derivative is 0:
 so
 .
 We bound f ^{(n + 1)} (x) on the interval [a, x]. In particular, we choose M so that
 .
 So
 and
 .
 As established above,
 ,
 so
 .
 We can integrate this again:
 .
 Examine the integral:
 So we now have:
 It might be intuitively evident that, integrating this inequality n  1 more times, we will obtain Eq. 4. We will now demonstrate this by induction.
 Above we established the base case. We now assume that Eq. 4 holds for some integer k < n and will demonstrate that it therefore holds for k + 1.
 Again, we examine the integral:
 As established previously, the first n derivatives of R_{n}(x) evaluated at x = a are 0, so we obtain:
 Therefore, if we continue integrating, we obtain:
 , or
 .
How might one use Eq. 4 to check the accuracy of a Taylor polynomial? M is an upper bound on the (n+1)^{th} derivative of f on the interval [a, x] (that is, on the interval between where the Taylor polynomial is centered and where it is being evaluated). This seems fairly arbitrary but may make more sense in practice.
Imagine that we are trying to find an error bound for sin(x). All derivatives of sin(x) are one of:
 .
In other terms,
 ,
so
 .
Then we can say that, for any Taylor polynomial for sin(x) evaluated at any x,
This is straightforward to evaluate. Since the factorial growth in the denominator outpaces the exponential growth in the numerator, it is evident that, as expected, the error becomes smaller for larger n.
In Figure 4, the "flattened" part in the center of the graph is where our approximation is "good". To the naked eye, at least, the error appears to be very close to 0.
Notice, in Figure 5, that the approximation becomes sufficiently close to 0 for the lower x value much more quickly than it does for higher x values. But by including enough terms, we can make our approximation as accurate as we would like at either point. In this figure, it is also noteworthy that, although the error eventually displays a 0 in each decimal place, the error at any value never actually reaches 0, so long as n is finite. Finally, note that R_{n} in this graphic is actual error, the difference between the Taylor polynomial and the original function, not the error bound computed by boundingf ^{(k + 1)}(c).
As Figure 4 shows, the error bound is rarely equal to actual error; it is usually greater, often much greater, than the actual error. For instance,
but
As we can see, even at a point where the difference between the Taylor polynomial and original function could not be distinguished by the naked eye, the actual error is often much smaller than the bounded error. This should make us especially confident in using our approximations. In Figure 4, the red curve is almost always less than or equal to the blue curve (with a small exception when n = 1). This is desirable when approximating error: we would like to be certain that the actual error is less than our approximation.
Suppose that we would like to make an approximation of the value of at x = 0.25. Say we choose to make a 3^{rd}degree Taylor approximation using the Taylor polynomial centered at 0. The Taylor polynomial is:
The error is:
How do we bound M on the interval [0, 0.25]? We know that in general,
Evaluating this initially seems to be problematic. In our example, p = 2, and p^{k} can be calculated easily. But we don't know what e^{2x} is at most for the interval [0, 0.25]; that is why we are making a Taylor polynomial approximation in the first place! However, we just need to recall that we are looking for an error bound, which does not to be exact. We know:
 .
Moreover,
 ,
so
 .
Thus we are certain that on the interval [0, 0.25], . Each differentiation doubles this bound, so
 .
We can now finish calculating the error:
This gives us a good idea of how accurate our approximation is. The actual value of the function is less than 0.00521 away from the thirddegree Taylor approximation:
Suppose that we desire greater accuracy. Say, specifically, that we would like to know what degree Taylor polynomial would be necessary to have error less than 10^{4}. We must solve for N where:
By substituting in various values of N, we find that the lowest integer for which this inequality holds is N = 5, so if we want to be sure our approximation has an error of less than 10^^{4}, we should use a 5^{th} degree Taylor polynomial.
Why It's Interesting
Have you ever wondered how calculators determine square roots, sines, cosines, and exponentials? For instance, if you were to type or into your calculator, how does it determine which value to spit out? The number must be related to our input in some way, but what exactly is the relationship? Does the calculator just read from an index of known values? Is there a more mathematical and precise way for the calculator to evaluate these functions?
The answer to this latter question is yes. There are algorithms that give an approximate value of sine, for example, using only the four basic operations (+, , x, /)^{[2]}. Before the age of electronic calculators, mathematicians studied these algorithms in order to approximate these functions manually. The Taylor series, named after English mathematician Brook Taylor, is one such way of making these approximations. Basically, Taylor said that there is a way to expand any infinitely differentiable function into a polynomial series about a certain point. The strength of the Taylor series is its ability to approximate certain functions that cannot otherwise be calculated.
The calculator's algorithm for many functions uses this method to efficiently find a suitable approximation in the form of a polynomial series. Expanding enough terms for several digits of accuracy is easy for a computing device, even though Taylor series may look daunting and tedious to the naked eye. This algorithm is built in the permanent memory (ROM) of electronic calculators, and is triggered when a function like sine or cosine is called^{[3]}.
As is shown in the More Mathematical Explanation, Taylor series can be used to derive many interesting and useful series. Some of these series have helped mathematicians to approximate the values of important irrational constants such as and .
Approximating π
, or the ratio of a circle's circumference to its diameter, is one of the oldest, most important, and most interesting mathematical constants. The earliest documentation of can be traced back to ancient Egypt and Babylon, in which people used empirical values of such as 25/8 = 3.1250, or (16/9)^{2} ≈ 3.1605^{[4]}.
The first recorded algorithm for rigorously calculating the value of was a geometrical approach using polygons, devised around 250 BC by the Greek mathematician Archimedes. Archimedes computed upper and lower bounds of by drawing regular polygons inside and outside a circle, and calculating the perimeters of the outer and inner polygons. He proved that 223/71 < < 22/7 by using a 96sided polygon, which gives us 2 accurate decimal digits: π ≈ 3.14^{[5]}.
Mathematicians continued to use this polygon method for the next 1,800 years. The more sides their polygons had, the more accurate their approximations would be. This approach peaked at around 1600, when the Dutch mathematician Ludolph van Ceulen used a 2^{60}  sided polygon to obtain the first 35 digits of ^{[6]}. He spent a major part of his life on this calculation. In memory of his contribution, sometimes is still called "the Ludolphine number".
However, mathematicians have had enough of trillionsided polygons. Starting in the 17^{th} century, they devised much better approaches for computing , using calculus rather than geometry. Mathematicians discovered numerous infinite series associated with , and the most famous one among them is the Leibniz series:
We will explain how Leibniz got this amazing result and how it allowed him to approximate .
T [...]
This amazing series comes directly from the Taylor series of arctan(x):
We can get Eq. 5a by directly computing the derivatives of all orders for arctan(x) at x = 0, but the calculation involved is rather complicated. There is a much easier way to do this if we notice the following fact:
Recall that we gave the summation formula of geometric series in the More Mathematical Explanation section :
 ,
If we substitute r =  x^{2} into the summation formula above, we can expand the right side of Eq. 5b into an infinite sequence:
So Eq. 5b changes into:
Integrating both sides gives us:
Let x = 0. This changes the equation to 0 = C . So the integrating constant C vanishes, and we get Eq. 5a.
One may notice that, like Taylor series of many other functions, this series is not convergent for all values of x. It only converges for 1 ≤ x ≤ 1. Fortunately, this is just enough for us to proceed. Substituting x = 1 into it, we can get the Leibniz series:
The Leibniz series gives us a radically improved way to approximate : no polygons, no square roots, just the four basic operations. However, this particular series is not very efficient for computing , since it converges rather slowly. The first 1,000 terms of Leibniz series give us only two accurate digits: π ≈ 3.14. This is horribly inefficient, so most mathematicians would prefer not to use this algorithm.
Fortunately, we can get series that converge much faster if we substitute smaller values of x , such as , into Eq. 5a:
which gives us:
This series is much more efficient than the Leibniz series, since there are powers of 3 in the denominators. The first 10 terms of it give us 5 accurate digits, and the first 100 terms give us 50. Leibniz himself used the first 22 terms to compute an approximation of π, which is correct to 11 decimal places: 3.14159265358.
However, mathematicians were still not satisfied with this efficiency. They kept substituting smaller x values into Eq. 5a to get more convergent series. Among the mathematicians who did this was Leonhard Euler, one of the greatest mathematicians in the 18^{th} century. In his attempt to approximate , Euler discovered the following nonintuitive formula:
Although Eq. 5c looks really weird, it is indeed an equality, not an approximation. The following hidden section shows how it is derived in detail.
The next step is to expand Eq. 5c using Taylor series, which allows us to do the numeric calculations:
This series converges so fast that each term of it gives more than 1 digit of . Using this algorithm, it will not take more several days to calculate the first 35 digits of with pencil and paper, which Ludolph spent most of his life on.
Although Euler himself never undertook the calculation, this idea was developed and used by many other mathematicians at his time. In 1789, the Slovene mathematician Jurij Vega calculated 140 decimal places for , 126 of which were correct. This record was broken in 1841, when William Rutherford calculated 208 decimal places, 152 of which were correct. By the time of the invention of electronic digital computers, had been expanded to more than 500 digits. All of these efficient approximations began with the Taylor series of trigonometric functions!
Acknowledgement: Most of the historical information in this section comes from this article^{[7]}.
Teaching Materials
 There are currently no teaching materials for this page. Add teaching materials.
References
 ↑ Colin Maclaurin. Wikipedia.
 ↑ How does the calculator find values of sine, from homeschoolmath. This is an article about calculator programs for approximating functions.
 ↑ Calculator, from Wikipedia. This article explains the structure of an electronic calculator.
 ↑ Pi, from Wolfram MathWorld. This article contains some history of Pi.
 ↑ Archimedes' Approximation of Pi. This is a thorough explanation of Archimedes' method.
 ↑ Digits of Pi, by Barry Cipra. Documentation of Ludolph's work is included here.
 ↑ How Euler Did It, by Ed Sandifer. This articles talks about Euler's algorithm for estimating π.
Leave a message on the discussion page by clicking the 'discussion' tab at the top of this image page.
Approximating e
The mathematical constant , approximately equal to 2.71828, is also called Euler's Number. This important constant appears in calculus, differential equations, complex numbers, and many other branches of mathematics. It's also widely used in other disciplines like physics and engineering. So we would really like to know its exact value as accurately as possible.
One way to define is:
In principle, we can approximate e using this definition. However, this method is slow and inefficient. For example, let n = 100 and substitute it into the definition. We get:
This is only accurate to 2 digits. This is horrible accuracy for an approximating algorithm, so we have to find an alternative. One such alternative approximation can be found using Taylor series. Using calculus, we can derive the Taylor series for e^{x} and use it to make our approximation.
e^{x} has the very convenient property...
e^{x} has a very convenient property:
The proof of this property can be found in almost every calculus textbook. It tells us that all derivatives of the exponential function are equal:
 ,
and:
Substitute these derivatives into Eq. 2, the general formula of Taylor Series. We get:
Let x = 1 to approximate :
This sequence converges quickly, since there are factorials in the denominators of each term, and factorials grow really fast as n increases. Just take the first 10 terms and we can get:
The real value of is 2.718281828··· , so we have obtained 7 accurate digits! Compared to the approximation by definition, which gives us only two accurate digits at order 100, this algorithm is incredibly fast and efficient.
In fact, we can get the same conclusion if we plot the function e^{x} and its two approximations together, and see which one converges faster. We already have the Taylor series approximation:
In Figure 8b, these two approximations are graphed together with the original function e^{x}. As we can see in the animation, the Taylor series approximates the original function much faster than the definition does.
SmallAngle Approximation
Taylor series are useful in physics for approximating the trigonometric values of small angles. Consider sin(0.1):
It is straightforward to evaluate both P_{1}(0.1) = 0.1 and P_{3}(0.1) = 0.099833···. The calculator evaluates sin(0.1) = 0.0998334166. For small angles like 0.1 radians, the third term in the Taylorseries approximation is substantially smaller than the first term, which, in the case of sine, is equal to the argument of the function. (The second term is 0.) It is often suitable, then, to take the firstorder term of the Taylor series for sin(x) as its smallangle approximation:
 for small x
By a similar token, we may obtain smallangle approximations for the other trigonometric functions. In the case of cosine, we go out to the secondorder term, since that is the first term that includes x:
 for small x
Then
 for small x,
because for small x we only need the firstorder approximations and the firstorder approximation of cos(x) is 1.



What is the smallangle approximation good for? In the simplest respect, the smallangle approximation is "close enough," and it's quicker than evaluating more terms of a Taylor series. However, the smallangle approximation has an additional utility in that it can allow us to solve certain differential equations in closed form. The prime example of this is the derivation of the closedform pendulum formula, which involves solving a secondorder differential equation. Substituting in the smallangle approximation makes the derivation much simpler and gives us a cleaner result, although, since it is an approximation, it is not perfect and only holds for small angles.
How Small is Small?
It is, of course, important to know when a smallangle approximation is appropriate and at what values the smallangle approximation ceases to be accurate. (Recall, again, that accuracy is the closeness of an approximation to the actual value.) There is not a universal answer to this concern. Physicists will often use an approximation as long as it can be used to represent whatever they need to model. If an approximation is not useful, then they will not use it.
In any case, it is necessary to have some idea of how accurate an approximation is. Here, we will try to at least get a sense of just how accurate these smallangle approximations are.
One way to do this would be to bound the error of our approximation as we do above in error bound of a Taylor series, but, for reasons explained in that section, this would necessarily be an overestimation of the error, which is helpful in practical circumstances but not for the point we are trying to make in this section. We can simply compare our smallangle approximations to the actual values of the functions that they approximate.
Figure 10a plots the actual error of these functions; that is, the absolute value of the difference between the smallangle approximation and the original function. Figure 10b plots the relative error, or the actual error divided by the value of the actual function (this represents accuracy in the truest sense). The horizontal line represents 1% of relative error; where the curves intersect with this horizontal line is where the approximations begin to exceed 1% of relative error.
Cosine's smallangle approximation is the most accurate, while tangent is the least accurate. This makes sense when we consider the nature of each of the smallangle approximations. Sine and tangent are both firstorder approximations, while cosine must be a secondorder approximation, since its firstorder Taylor polynomial is always 1. We would expect it, then, to be the most accurate.
On the other hand, in making our smallangle approximation for tangent, we lose accuracy because we assume that the cosine is essentially 1. One could improve the tangent approximation's accuracy by using the secondorder smallangle approximation for cosine instead of 1, but then the tangent approximation would lose its simplicity, which is the appeal and utility of a smallangle approximation in the first place!
Field=Algebra
InProgress=Yes
Field=Algebra InProgress=Yes }}