Approximation by Taylor polynomials

Chapters

Taylor polynomials

Taylor remainder



Taylor polynomial of the sinus function


Taylor polynomials

The Taylor-expansion is used to approximate a complex function by a simple polynomial. Almost every fundamental function can be approximated by a Taylor polynomial like.



Taylor

For the derivation of a Taylor polynomial we start with a polynomial like



Taylor

The differentiation of this is



Taylor

and



Taylor

And so on


If x = 0


Taylor

And with this


If x = 0


Taylor


And these equations put in the polynomial




Taylor


(Please note: 0! = 1)

For f(x) and computed at the position 0. But that’s not all :-)

For a computation at a random point we have to go some steps further and substitute.




Taylor


f and q are both polynomial functions and so


Taylor


and


Taylor


and therefore


Taylor


And now: If t = x - a


Taylor


And that’s the formulation for the Taylor polynomial built at a random position “a”.

That’s quite o.k. but in the real world nobody calculates a polynomial with an infinite number of elements and if the number of elements is smaller than infinite, there is an inaccuracy.


Taylor remainder




Taylor



Taylor


And we need the differentiation of this. According to the product rule of the differentiation (See Differential calculus)


Taylor



If we extract the last element of the first sum and consider that the first element of the second sum is 0, this can as well be written as:

TaylorTaylor



and the second sum shall start at k = 0 again:

TaylorTaylor



And with this:

Taylor



Now there comes an interesting step:

We introduce a new function

Taylor



And say (according to the mean value theorem for differential calculus)

Taylor



With 0 <= θ <=1


And now with

Taylor



As only the first element of the sum is not 0 and this is f(b).

Taylor

Taylor

Taylor



All put into the above formula:

Taylor



Now we can replace b by x again and get:

Taylor



Which is Taylor’s theorem for the remainder of a Taylor polynomial of the order n. This remainder is not fully defined as θ is a random value between 0 and 1.

But never the less it’s quite well visible that it approaches 0 quite soon if n rises. The (n+1)! In the denominator becomes very big quite soon and therefore the whole expression becomes very small. That means the Taylor polynomial is a good approximation already with a relatively small order “n”.

Taylor polynomial for the sinus function



To develop the Taylor polynomial for the sinus function is a good task to see the impact of the Taylor remainder :-)

So we develop the Taylor polynomial for the sinus function at the position 0

Taylor

Taylor



These put into the Taylor polynomial:

Taylor



In the following graph I printed the Taylor polynomial for the sinus function with n = 1 till n = 9

Taylor



O.k. with n = 0 it’s just a straight line. That’s not too interesting. But it’s nice to see how much the shape approaches the real shape of the sinus better with each step of increasing n :-)


In the same manner we get for Cos(x)


Taylor




For Newton’s Pi

When I was working on Newton’s algorithm to compute Pi I converted the function

Taylor


To a Taylor polynomial. That helped a lot to get to a useful formulation and therefore I document it here :-)


First the derivations:

Taylor
Taylor
Taylor
Taylor
Taylor


And so on.

With these we get the derivations at 0:



Taylor
Taylor
Taylor
Taylor
Taylor
Taylor


And so on.

And from them the complete polynomial:



Taylor