Math Without Rigor

June 12, 2007

Taylor Series

Filed under: Calculus — Justin @ 3:23 pm

One of the basic facts about calculus is that finding integrals is tough. The fundamental theorem helps a lot, but as the expressions get more and more complicated it gets tougher and tougher to find the integral. It makes you long for the good old days when everything you integrated was a polynomial in the form of axn. That is undoubtedly what drove people to invent the Taylor series. The central concept is to find a way to express a non-polynomial as a polynomial. For example, could you write sin x as a simple polynomial?

How would you do this? Ponder this for a minute (no, really – take a minute and think about how you would do it). Here is one hint: you can’t use a simple polynomial. Instead use a power series: a0 + a1x + a2x2 + … + anxn.

The secret is to start at the point x=0 (which makes the math really easy). and set the the various derivatives of the power series to the derivatives of sin x.

Step One: Find the derivatives of sin x

Lets start by finding the first five derivatives of sin x at the point x = 0:

sin 0 = 0
sin’0 = cos 0 = 1
sin”0 = -sin 0 = 0
sin(3)0 = -cos 0 = -1
sin(4)0 = sin 0 = 0
sin(5)0 = cos 0 = 1

Step Two: Find the derivatives of the power series

Now lets find the first five derivatives of the power series at x = 0. Lets call the power series a(x).

a(0) = a0 + a1x + a2x2 + … + anxn = a0
a’(0) = a1 + 2a2x + 3a3x2 + … + nanxn-1 = a1
a”(0) = 2a2 + 2·3a3x + 3·4a4x2 + … + (n-1)*nanxn-2 = 2a2
a(3)(0) = 2·3a3 + 2·3·4a4x + 3·4·5a5x2 … + (n-2)·(n-1)·nanxn-3 = 2·3a3
a(4)(0) = 2·3·4a4
a(5)(0) = 2·3·4·5a5
a(n)(0) = n!an

Now you see why it makes sense to find the derivatives at x = 0. All the higher degree terms drop out and you are left with a constant term of n!an. Note that step two is always exactly the same, even if you are finding an approximation for cos x or ex or any other complicated function.

Step Three: Solve for the values of the an’s

sin 0 = 0 = a0
sin’0 = 1 = a1
sin”0 = 0 = 2a2
sin(3)0 = -1 = 3!a3. So a3 = -1/3!
sin(4)0 = 0= 4!a4. So a4 = 0
sin(5)0 = 1 = 5!a5. So a5 = 1/5!

At this point the pattern emerges. Plug the an’s back into the power series to get:

sin x = x – x33! + x55! – x77! + …

This is a pretty accurate approximation. The sin of 1 (in radians of course) is .841470985. And plugging 1 into the power series – just going up the x77! term – gives .841468254. Not bad.

Uses of Taylor Series

The nice thing about Taylor series are that they are easy to integrate. Now we can finally integrate everything.

Limitations

There are some limitations to this technique. The biggest is that we are simply assuming that the power series converges, but that may not be the case. That is why tests for series convergence are so useful. A second, and more practical, limitation is that we built our approximation around the point x = 0. The approximation is pretty good near the point x = 0, but it gets worse and worse the farther you get from that point. You would have to rebuild the power series at a different point.

That is easy enough to do. If you want to find values around the point 3, then rebuild your power series using (x-3) instead of x. Otherwise the process is identical.

Tips and Tricks

What if you wanted to find the Taylor series for sin(x2)? You could start taking derivatives:

sin’(x2) = 2x*cos(x2)
sin”(x2) = 2cos(x2) – 4x2sin(x2)

As you can see, it gets ugly in a hurry! The thought of slogging through the process of taking the derivative a few more times is not pleasant. Luckily there is an easier way. Just substitute x2 for x into the Taylor series for sin x, to get:

sin(x2) = x2 – x233! + x255! – x277! + …

Rewriting we get:

sin(x2) = x2 – x63! + x105! – x147! + …

Another easy technique is to solve something like sin x(x+1) by taking the Taylor series for sin x and then dividing each tearm by x + 1. So:

sin x(x+1) = 1x+1[ x - x33! + x55! - x77! + ... ]

Exercises

There are a few Taylor series that you will repeatedly encounter, so they are worth memorizing. As an aid, calculate the following:

  1. ex
  2. sin x
  3. cos x
  4. ln(1 + x)
  5. (1 + x)p

Blog at WordPress.com.