Taylor Series

DinS          Written on 2018/4/30

1. A brief introduction to power series

Before we jump into Taylor series, let’s first look at something called power series.

If a series looks like this format, it’s a power series. We’ve already seen some. For example, when an =1/n, x = 1, it’s a harmonic series. When an = 1, x = 1/2, it’s a geometric series with r = 1/2.

Now look at a more general one. If an = n, x = 3, it becomes like this.

If we write the series out it will look like this.

This somehow looks like a polynomial function. Indeed. There’s something we can do between these two.

Clearly not all power series converge. The above is an example. It depends on x.

We’ll define a term called interval of convergence. It is a set for all real numbers x so that the series converge. From here on we’ll assume that all x falls in interval of convergence, which simply means that the power series will converge and we can write a function about it.

We can do something interesting about power series.

We can differentiate it.

That is we’re taking an as a constant and apply power rule to x.

We can also integrate it.

One application is that we can use this trick to find function for other series from a given series.

We’ve already know that

That’s what we’ve got from geometric series.

Now what if we integrate it?

Pardon me for being sloppy here. I just want to show you the whole picture, the idea.

From this we can get

By this way we’ve found the function for a new series.

2. Taylor Series: motivation

Up to now, all we’ve been doing is starting from certain series to get its function representation, if it exists.

Here we’ll start from certain function to get its series. That’s basically what Taylor series is meant to do.

Let’s first look at this problem.

From previous articles we know linear approximation.

f(x) ≈ f(a) + f’(a)*(x-a)

We can do better by using polynomial approximation.

We’ve added a secondary derivative to linear approximation. What’s the meaning of g(x)?

Actually g(a) = f(a), clearly.

This means that g’(a) = f’(a).

This means that g’’(a) = f’’(a).

All this leads to one thing: we’ve constructed a function g(x) that behaves likes f(x).

We can still do better by adding higher derivates.

Let’s see an example.

f(x) = sinx. Suppose we have worked out the derivatives of trig-functions. We have

This is a much better approximation to sinx.

Surely beats linear approximation.

 

We can still do better, but this time we’re not going to add more terms. Although more terms mean better approximation, it’s finite. We know power series share some similarity with polynomial function. Maybe we can use power series with infinite terms to do such thing.

Thus we know f(0) = a0.

What’ll happen if we differentiate it?

Thus we know f’(0) = a1.

What’ll happen if we continue to differentiate it?

Thus we know .

What’ll happen if we continue to differentiate it?

Thus we know 

You see a pattern here. We can conclude that the general form is:

This means we can express each term in regards of the derivatives of f. Time for conclusion.

This thing is called Maclaurin Series, or Taylor Series centered at zero.

We can extend this idea to points centered at a.

This is called Taylor Series around a.

For example we can write the Taylor Series for sin around zero as:

And for cos around zero:

I’m not going to prove this. Just give an idea what Taylor Series is.

3. Taylor’s Theorem

Statement:

Suppose f:R->R is smooth, i.e. can be differentiated anywhere, and

R stands for remainder error term.

Taylor’s Theorem can help us set an error boundary for approximation. Let’s how it works.

Question: Find polynomial function p(x) so that

That is to say we want an approximation p(x) so that the error is less than 0.01.

We’ve already known the Taylor Series for cosx. The question is how many terms should we keep to achieve the accurate standard?

According to Taylor’s Theorem we have

Now we have got rid of the xN+1 term.

Now we have got rid of the f(N+1)(z) term.

One more step.

We are requested with an error margin less than 0.01, and RN(x) is the error term. We need to make sure that

This means N should be equal or greater than 4. Let’s pick N = 5.

Now we expand Taylor Series to

We got our answer!

with an error no worse than 1/720.

Let’s check this.

Awesome!