Taylor Series

From Math Images

Jump to: navigation, search
Image:inprogress.png
Taylor Series
A Taylor series or Taylor polynomial is a series expansion of a function used to approximate its value around a certain point. The animation to the side shows a function and the first eight polynomials. The larger n of the polynomial, the more it looks like the original function.

Contents

Basic Description

Taylor polynomials are often used to approximate more complicated differentiable functions that are not periodic on the interval in question.

Polynomials are often easier to work with than more complicated functions such as exponentials. It is easy to take derivatives of polynomials and take integrals of them. They are also easier than many other functions to use in many mathematical models of systems. Therefore, when a Taylor Polynomial can be substituted for a more complicated function in a wide range of mathematical problems.

Taylor Polynomials have to be centered around a particular input value. Generally, as one moves farther away from that input, the Taylor polynomial becomes a less accurate approximation. We can see that in the animation--the further away from the center, the further apart the two lines are.

A More Mathematical Explanation

Note: understanding of this explanation requires: *Basic Calculus

Taylor Series Form for a Single Variable

Every function that is infinitely differentiable at a g [...]

Taylor Series Form for a Single Variable

Every function that is infinitely differentiable at a given point has a Taylor series centered at that point.

The Taylor Series of a function is an infinite series involving the function's first and higher order derivatives, the function's value at the series' center, and constants.

For a function of a single variable,  f , the Taylor Series,  T, about a point  a is given by

T(x) = f(a)+\frac {f'(a)}{1!} (x-a)+ \frac{f''(a)}{2!} (x-a)^2+\frac{f^{(3)}(a)}{3!}(x-a)^3+ \cdots

or in summation notation,

 T(x)=\sum_{n=0} ^ {\infin } \frac {f^{(n)}(a)}{n!} \, (x-a)^{n}

A Taylor Polynomial,  p_n for a function is simply this series truncated at its nth term.


In summation notation, we denote these polynomials as

 p_n(x)=\sum_{m=0}^n \frac{f^{(m)}(a)}{m!} \, (x-a)^{m}.

In the case of a=0, the series expansion is called a Maclaurin series.

Example Taylor Series

Let's let  f(x)=ln(x)\,, and let's find the first three Taylor Polynomials about the point 1. We see that  f'(x)=1/x ,  f''(x)=-1/x^2 , and  f'''(x)=2/x^3.

Now we have

 f(1)=ln(1)=0\,

 f'(1)=1/(1)=1/1=1\,

 f''(1)=-1/(1)^2=-1\,

 f'''(1)=2/(1)^3=2\,

From this we are able to calculate the 1st, 2nd, and 3rd order Taylor polynomials.



p_1(x)= f(1)+f'(1) (x-1)=0+1(x-1)=x-1\,


The graph of this polynomial is shown in green in the image on the right, while the graph of the original function is shown in red.

We can see that near  x=1 , the polynomial is a good approximation for the original function, but that if we move to left or the right by even 0.2 units or so, the difference between the two functions can be seen in the graph.




Now we can calculate the second order polynomial.

p_2(x)=f(1)+f'(1)(x-1)+\frac{f''(1)}{2} (x-1)^2  = 0+1(x-1)-\frac{1}{2}(x-1)^2=(x-1)-\frac{1}{2}(x-1)^2,

This polynomial is plotted below in blue while  ln(x) is shown in red. We can see that this quadratic function does a better job approximating the original function. It starts to become a poor approximation at distances between 0.3 and 0.4 away from one.


Now we can calculate the third polynomial:

p_3(x)=f(1)+f'(1)(x-1)+\frac{f''(1)}{2} (x-1)^2 +\frac{f'''(1)}{6} (x-1)^3  =0+1(x-1)-\frac{1}{2}(x-1)^2+\frac{2}{6}(x-1) =(x-1)^2-\frac{1}{2}(x-1)^2+\frac{1}{3}(x-1)^3

This polynomial is plotted to the right in pink, and the original function is still in red. We can see that it is even closer to the original function: it only starts to separate from it around 0.5 and 1.6.





If we keep going in this process, we see that, like the animation that's the main image, the polynomial keeps getting closer to our original function. If we look at  p_8(x) (shown in purple below), we see that the two lines are even closer than for the previous polynomials.

Uses

Small Angle Approximation

Many problems in physics and engineering involve some function of an angle--most frequently a sine or a cosine function. While both of these functions are periodic, we often only care about small displacements from equilibrium (often this is set to be  \theta = 0 ).

Take for example, the simple pendulum. If we want to know the equations of motion, we have to solve the equation  -\frac{g}{L} \sin \theta = \frac{d^2}{dt^2}(\theta) where g is the acceleration due to gravity, L is the length of the pendulum and  \theta is the angle the pendulum makes with the vertical axis (want to know where this equation comes from? Hyperphysics has an great explanation).

The thing about this seemingly simple equation is that it cannot be solved analytically. Putting in the constants and the initial position and speed of the pendulum, it can be solved using numerical approximation methods, but there is no exact, general solution.

Since we only care about values around zero, we can use a Taylor polynomial around zero. Let's calculate some derivatives and values.

 \sin(\theta) \rightarrow \sin(0)=0   \frac{d}{d\theta} \sin(\theta)= \cos(\theta) \rightarrow \cos(0)=1 .

As it turns out, in many cases the first order polynomial is enough, so we only need these values. Plugging into the formula for the polynomial gives

 p_1(\theta)=0+1(\theta-0)=\theta .

Now, substituting  \theta for  \sin \theta in our equation gives

 -\frac{g}{L}\theta = \frac{d^2}{dt^2}(\theta)

This differential equation can be solved, and we find the simple solution

 \theta (t)=\theta_{max} \sin \left( \sqrt{\frac{g}{L}} t \right)

where we've made the assumption that at time  t=0 the pendulum is released from  \theta_{max} .

So we see that using a Taylor series allows us to solve this important, basic problem in physics.


Approximating  e

e \approx 2.7183 is an important number in mathematics. One of its notable properties is that  \frac{d}{dx} e^x=e^x. Using this fact, we can write the Taylor Series of  e^x . For simplicity, we center the series around zero.

Since here,  f(x)=e^x=f'(x)=f''(x)=f'''(x)=\cdots , we know that  f(0)=1; f'(0)=1; f''(0)=1; f'''(0)=1; \cdots . As it turns out, this is one of the easiest Taylor series to write. Let's start out by writing the third order polynomial:

p_3(x)=1+x+\frac{x^2}{2}+\frac{x^3}{6} .

In general, we have the series  1+x+\frac{x^2}{2}+\frac{x^3}{6} + \frac{x^4}{24} +\cdots + \frac{x^n}{n!} +\cdots .


Since  f(1)=e^1=e we can plug in  x=1 to find an approximate value for e.

Using the second order polynomial, we don't get a very good approximation, but as we increase the number of terms we use, we get a closer and closer approximation to the value of  e .

 p_1(x) = 1+1=2

 e\approx 1+1+\frac{1}{2}=2.5

 e\approx 1+1+\frac{1}{2}+\frac{1}{6}=2.667

 e\approx 1+1+\frac{1}{2}+\frac{1}{6}+\frac{1}{24}=2.708

 e\approx 1+1+\frac{1}{2}+\frac{1}{6}+\frac{1}{24}+\frac{1}{120}=2.7167

 e\approx 1+1+\frac{1}{2}+\frac{1}{6}+\frac{1}{24}+\frac{1}{120}+\frac{1}{720} =2.7181 .

Using these first seven terms gives a very accurate approximation of e.




Teaching Materials

There are currently no teaching materials for this page. Add teaching materials.









If you are able, please consider adding to or editing this page!

Have questions about the image or the explanations on this page?
Leave a message on the discussion page by clicking the 'discussion' tab at the top of this image page.






Personal tools