Taylor Series
From Math Images
m 

Line 161:  Line 161:  
:<math> f'(x)=1/x </math>, <math> f''(x)=1/x^2 </math>, <math> f ^{(3)}(x)=2/x^3, \cdots</math> <math> f ^{(k)}(x) = {{(1)^{k1} \cdot (k1)!} \over x^k}</math>  :<math> f'(x)=1/x </math>, <math> f''(x)=1/x^2 </math>, <math> f ^{(3)}(x)=2/x^3, \cdots</math> <math> f ^{(k)}(x) = {{(1)^{k1} \cdot (k1)!} \over x^k}</math>  
<br>  <br>  
  Since this function and its derivatives are undefined at ''x'' = 0, we cannot construct a  +  Since this function and its derivatives are undefined at ''x'' = 0, we cannot construct a <balloon title="a Taylor series center at ''x'' = 0</balloon> Maclaurin series for it. Note that, when choosing ''a'', one should select a value not only for which all derivatives ''f'' <sup>(''k'')</sup>(''a'') exist but 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) = log (2) is unknown and, in fact, cannot even be approximated until we have obtained our Taylor series. For the natural log, it makes sense to let ''a'' = 1 and compute the derivatives at this point: 
<br><br>  <br><br>  
:<math> f(1) = \log 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, \cdots</math> <math> f ^{(k)} (1) = {(1)^{k1} \cdot (k1)!}</math>  :<math> f(1) = \log 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, \cdots</math> <math> f ^{(k)} (1) = {(1)^{k1} \cdot (k1)!}</math> 
Revision as of 14:56, 24 May 2013
{{Image Description Ready
ImageName=Taylor Series
Image=Taylor Main.gif
ImageIntro=
A Taylor series is a power series representation of an infinitely differentiable function. In other words, certain functions, like the trigonometric functions, can be written as the sum of an infinite series. Taylor series, then, provide an alternative method of evaluating those functions.
 An n^{th}degree Taylor polynomial for a function approximates the value of the function around a certain point by evaluating only up to the n^{th}degree term of the Taylor series. By doing so, we obtain a finite series, which can be summed but will not exactly match the infinite Taylor series. In the animation on the right, successive Taylor polynomials are compared to the actual function y = sin(x) using the following polynomial expansion:
 In this example, n varies from 0 to 36. As we can see, as n becomes larger and there are more terms in the Taylor polynomial, the Taylor polynomial comes to "look" more like the original function; it becomes a progressively better approximation of the function sin(x). Since it is impossible to evaluate every term in an infinite series, we settle for using a Taylor polynomial with finite n as an approximation.
 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.
 For the math behind this, please go to the More Mathematical Explanation section.
ImageDescElem=
Taylor series are important because they allow us to compute functions that cannot otherwise be computed by conventional means. While the above Taylor polynomial for the sine function seems complicated and is annoying to evaluate, it is just the sum of terms composed 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 Taylor series into a finitedegree Taylor polynomial, which we can evaluate reliably.
Readers may, without knowing it, already be familiar with a particular type of Taylor series. Consider, for instance, an infinite geometric series with common ratio x:
 for
The left side of the equation is the formula for the sum of a convergent geometric series. The right side is an infinite power series, so we have the Taylor series for . The More Mathematical Explanation 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 an infinite geometric series with common ratio . By our knowledge of infinite geometric series, we know that the sum is . Let's see how the Taylor approximation does:
This second order Taylor polynomial brings us somewhat close to the value of we obtained before. Let's observe how adding on another term can improve our estimate:
As we would expect, this approximation is closer still to the expected value, but not exact. Adding more terms would improve this accuracy.
At this point, you may be wondering what the use of a Taylor series approximation is if, as in the previous case, a more accurate estimate can actually be made by evaluating the lefthand side. It is important to note that this is not always the case. 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 directly 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 only used 3 terms, since this should be enough to tell us something. Notice that the right side of the equation above involves only the four simple operations, so we can easily calculate its value:
On the other hand, trigonometry gives us the exact numerical value of this particular cosine:
So our approximating value agrees with the actual value to the fourth decimal, which is good accuracy for a basic approximation. Better accuracy can be achieved by using more terms in the Taylor series.
We can get the same conclusion if we graph the original cosine function and its approximation together as shown in Figure 1b. We can see that the original function and the approximating Taylor series are almost identical when x is small. In particular, the line x = π/6 cuts the two graphs almost simultaneously, so there is not much difference between the exact value and the approximating value. However, this doesn't mean that these two functions are exactly the same. For example, when x grows larger, they start to deviate significantly from each other. What's more, if we zoom in the graph at the intersection point, as shown in Figure 1c, we can see that there is indeed a difference between these two functions, which we cannot see in a graph of normal scale.
ImageDesc=
The general form of a Taylor series
In this subsection, we will derive a general formula for a function's Taylor series using the derivatives a general function f(x). Taylor polynomials are defined as follows:
 The Taylor polynomial of degree n for f at a, written as , 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)
 in which is the k^{th}order derivative of both and at a.
 The Taylor series is the Taylor polynomial for which all derivatives at a are equal to those of . Note again that our selection of is limited to infinitely differentiable functions; this is why must be an infinite series.
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 must start with what we know. Using the definition of a power series, we can write the Taylor series of a function f around a as
in which a_{0}, a_{1}, a_{2} ... are unknown coefficients. Our goal is to find these coefficients. From the definition of Taylor polynomials, we know that function f and Taylor series must have same derivatives of all degrees:
 , , ,
How might we use this fact? Let's attempt to evaluate the first few terms by taking the derivative of our general T(x):
The pattern may now be recognizable. Because each derivative is evaluated at a, all terms but the constant term go to 0. Note then what happens after k derivatives. We get:
This step is important in understanding the Taylor series both practically and theoretically. The Taylor series approximates an infinitely differentiable function by exploiting qualities of the differentiability of polynomials. In particular, it can be ensured that every degree of derivatives at a is the same for T(x) as for f(x). The k! is a just a result of the derivations of polynomial terms. From this equation, we easily obtain:
Since 0! = 1, this formula holds for all nonnegative integers n. So, using derivatives, we have obtained an expression for all unknown coefficients of the given function f. Substitute them 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. In many cases, it is convenient to let a = 0 to get a neater expression:
Eq. 3 is called the Maclaurin series after Scottish mathematician Colin Maclaurin, who made extensive use of these series in the 18th century.
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. Other elementary functions, such as sin(x), cos(x), and e ^{x}, can be treated similarly. Their Taylor series will also be provided.
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 for it. Note that, when choosing ''a'',
InProgress=Yes
Field=Algebra InProgress=Yes }}