## Oct 15, 2010

### taylor series

One of the more interesting math concepts I learned in college was that of the Taylor Series. Actually I learned about it in high school but actually learned how to use it in college. It's allows you to write any mathematical function as a series of polynomials. This is can be particularly useful if you want to perform derivatives or integrals on the function. These are generally easier to do on a polynomial. Or to use it in a computer program. Again it's easier to code actions on polynomials.

Every time I used it, it was because the function I was working with was just ungodly difficult to work with. Because I was working with conditions where a limited Taylor Series would be valid it just made sense to transpose everything over to a polynomial.

The most amazing thing about it though is what the series says. Before we get to that let's look at the equation,

Like all math equations this looks more complicated than it really is. Let's walk through it.  f(x) is the function we want to convert into a Taylor Series. Right of that is how to build your Taylor Series for that particular function.

• The first term f(a) is simply your function with the value 'a' plugged in.
• The second term f'(a) is the first derivative of f(x) with the value of 'a' plugged in.
• The third term f''(a) is the second derivative of f(x) with the value of 'a' plugged in.
• And so forth.

And then there are some terms after each of these items (x-a), (x-a) squared, (x-a) cubed, etc.

Let's assume a = 0 to make these easier.

It now looks like this,

A little bit easier to work with. So all this is saying is that any function is equal to an infinite series of polynomials with coefficients related the function and derivatives of the function when 0 is plugged in for 'x'.

But here's what I think is amazing.  Think about what this says.  Any function is entirely described by the value of that function and its derivatives at a single point. If you know everything about a function and its derivatives at x=0 but know nothing else, you can recreate the entire function. You know the value of that function at x=10,000,000 based on what you know at x=0. Remarkable.

So let's apply it to a common function, e^x.  Here's a film of the Taylor Series of e^x as more and more terms are added.  The blue line is the actual function e^x.  The red line is the Taylor Series with more and more terms added over time.

What you'll notice is that as more terms are added the resulting Taylor Series more closely resembles the original function. In theory you need an infinite number of terms to accurately describe most functions. BUT if you are really interested in recreating the function around a certain value, 'a', then you can stop adding terms at some point. In general this kind of analysis is referred to as perturbation theory (kinky name).

The other interesting use of Taylor Series analysis was to determine the derivatives of complex functions. For example how did anyone figure out the derivative of a sine function or a natural log function. Easy. They Taylor Series'd the function and took the derivative of the resulting polynomial. What people noticed is that this resulting polynomial was the same as other functions when they are transformed with a Taylor Series.

For example with the sine function. The derivative of the sine Taylor Series is the same as the Taylor Series for cosine. Therefore the derivative of sine is cosine. Awesome.