While all the previous writeups have concentrated on the fact that you can calculate a Taylor series by calculating the appropriate derivatives, this is often not the best solution, especially if you just need a few terms. After all, you are finding the nth derivative of f, when all you need is the nth derivative of f , evaluated at a. Seems to me like you are wasting a lot of information and time! It is far easier if you forget that the coefficients can be obtained by differentiation.

In real life, when you are working with Taylor series you often do not need (or may not be able to obtain) the general formula for the series. Instead you will only have the first n terms. Before we go any further, a few basic facts and theorems on Taylor series (which I will not prove). Everything will be centered at 0.

In all the following, f will be a n times continuously differentiable function.

Saying that I have a nth degree taylor series centered at 0 of f means that I have real numbers a0,a1,a2...,an such that f(x)=a0 + a1x+a2x2+...+anxn+ o(xn).
The important part here is o(xn). This means "something which is very small compared to xn when x is small ". To be entirely precise it means a function g such that g/xn tends to 0 when x tends to 0. More details on this in little o notation.

The little o notation is a little ambiguous. Depending on the context it can mean the set of such functions, or it can mean one of those functions. The use of the little o notation makes these local Taylor series, I am only giving information on what happens round a point. If I were to provide an upper bound on the value of the little o (using Lagrange's or the integral remainder for example) then I would have a global Taylor series.

Some theorems

  • The first important theorem is the uniqueness of the coefficients. This means that:
    • There is only one set of coefficients for say my 3rd degree expansion
    • If I later decide that I want a 5th degree series, I haven't wasted my time, since the coefficients up to the 3rd degree are the same as the coefficients of my 3rd degree expansion.
  • The second important theorem is the integration theorem. This says that if I have a Taylor series for f then I can integrate that Taylor series term by term, and the result will be a Taylor series for an antiderivative of f. As you may have guessed this is very useful, as our integrated series has degree one higher than the original series. You might like to note than when you integrate o(xn) you get o(xn+1).
  • The third theorem is that you can multiply and add Taylor series together, but with one important caveat: you must watch the o(xn) carefully. It's not that difficult to understand why: if after doing your adding up, your series ends with o(x4) + x5 + o(x6), then something is obviously wrong : x is small, so x5 is smaller than x4. So we actually having 3 things very small compared to x4 which is something small compared to x4. All the above terms sum to o(x4). (If you want to show this properly, use the definition of o(xn) in terms of limits) In practice, what you need to do is find the o(xn) with the smallest n, and drop everything of higher degree.

    You also need to know is how to multiply the little o's. 2 easy rules:

    • o(xn) * o(xm) = o(xn+m)
    • xn * o(xm)=o(xm+n)
    To be 100% correct, the equal signs should be "is a member of" signs, with the o's on the left denoting elements of the set, and the o's on the right denoting sets.

  • The final theorem is that if I have a series for f and a series for g then I can get a series for f(g) by replacing the x's in the series for f by the series for g. When doing this one must watch the little o's carefully. There is also a more subtle requirement but I won't go into that.

Now that we have got this out of the way, an example. I'm going to choose tan. First of all we note that the first term is easy to guess. If we take a 0 degree series, we have f(x) = a0 + o(1), ie a0 is the limit of f as x tends to 0. In the case of tan we know this to be 0.

We have tan(x) = 0 + o(1)
You probably know that tan has the property that tan'(x)=(tan x)2+1. We can use this to our advantage:
Lets find a Taylor series for (tan x)2+1. Squaring the above gives (tan x)2+1= 1 + o(1)*o(1)= 1+o(1) (using our theorems on multiplying and adding).
We can then use the integration theorem :
tan x = a + x + o(x), where a is a constant that comes from integration. However from our uniqueness theorem we know that a=0.

Hence tan x = x + o(x).
Nothing stops us from continuing:

(tan x)2+1= x2+2 x*o(x)+o(x)*o(x) +1
          = x2+1 + 3 o(x2)
          = x2+1 + o(x2)

Integrating gives tan x = x + x3/3 + o(x3).

We could of course continue, and it would not be very difficult to work out a recursion relationship for these coefficients. The beauty of this method is that I have not calculated anything that I did not use entirely. In case you are not convinced, if you are thinking that i was lucky because of the special property of tan, I propose another example : 1/ (1 + tan x). You can probably see that differentiating this is quickly going to become a mess.

I will use the series for 1/(1+x) = 1-x+x2+...+ (-1)n mod 2xn+ o(xn)

Lets start with

tan x = x + o(x).
1/(1+x)= 1 - x + o(x)
1/(1+tan x) = 1 - (x+o(x)) + o(x+o(x))=1 - x + o(x)
There is no point in adding extra terms from the series of 1/(1+x) as they will be lost because of the o(x) in the second term: if we want more terms we must better our series for tan.
tan x = x + x3/3 + o(x3)
1/(1+x)= 1 - x + x2 + o(x2)
1/(1+tan x)= 1- (x + x3/3 + o(x3)) +(x + x3/3 + o(x3))2 + o(x + x3/3 + o((x3))2)
We can see that we are going to get a o(x2), so when evaluating this we can forget all terms with higher powers.
Hence 1/(1+tan x)=1-x+x2+o(x2)

As you can see getting the extra term was fairly painless. I won't go into the details, but it took me only a minute or so (including the time to get the next term in the series for tan) with a pen and paper to get the next term, -4x3/3 whereas calculating the 3rd derivative of 1/(1+tan x) would have taken me forever and I would probably have made a mistake somewhere (I calulated it with a CAS package and it ain't pretty ...). I would probably feel like killing myself too, watching all those carefully calculated terms disappear when I set x to 0... Verifying that this result is the same as when calculating the derivatives is left an an exercise to the very patient reader. If you're still not convinced, then you might want to try calculating 1/(1-1/(1+tan x)). Using this method, the calculation is almost identical to the previous one, but obtaining the coefficients by differentiation is a mess .

As you can see this is a quick and easy way of finding Taylor series, even if it requires a little more theory. You can even use this method for calculating derivatives at specific points, for example if you needed the 3rd derivative of 1/(1+tan x) at 0.

In a more general context, Taylor series have many uses, basically anytime an approximation for a function is needed, for example for finding a power series solution to an awkward differential equation. They can also be used for finding limits, eg (sin x)/x at 0. The Taylor series for this is 1 + o(x), which shows that the limit is indeed 1.

All in all Taylor series are an extremely useful mathematical tool to have around.