Download ModelDownload SourceembedLaunch WebsiteLaunch Website 2



Taylor approximations

At the left side of the window one of eight different base functions y = f(x) can be selected by radio buttons. A suitable x range 0 < x < 2a is attributed to each of them.

  • sin(x)
  • [sin(x)]2
  • sin(x2)
  • Power function pow (x,7) = x7
  • Gaussian:  exp(-(x-a)2)
  • sin(x-a)/(x-a))
  • [sin(x-a)/(x-a)]2
  • ex - 2

When opening the simulation, the Gaussian function will be activated and is drawn as a blue curve. The quadratic Taylor approximation around the origin is shown in magenta.

At the top of the window there are 9 radio buttons to select a Taylor approximation (expansion) around a model point xo, of index 0 (constant value y0) to 9 (considering up to the 9th derivative in x0, y0 ). The selected approximations is drawn in the color of the radio buttons .

The model point x0, y0 is shown as a red dot. It can be drawn with the mouse to calculate the expansion around an arbitrary model point.

Reset Dot returns the model point to its default position.

The first number field at the left shows the value of the function y0 in the model point x0, y0.

The other number fields show the factors of the power functions ( x-x0 ) n in the Taylor series, as

f5 = y(5)/5!

Very small numbers at high index may indicate numerical artifacts.


Taylor series

This simulation calculates the Taylor series of a function

y = f(x)

in the vicinity of a model point x0, y0

y = f(x0) + f ´(x0)(x - x0)/1! + f´´(x0)(x - x0)2/2!+... + f(n)(x0)(x - x0)n/n!...

n! = 1∙2∙3∙4...∙ n:  n faculty

The first member of the series is an approximation within the interval by the value in the model point:  y ≈ f(x0). This is commonly called the zeroth approximation.

The first approximation considers the first derivative, and is the tangent to the curve at the model point. It is also called the linear approximation and is already quite useful for small intervals.

y ≈ f(x0) + f ´(x0)(x - x0)/1! = f(x0) + f´(x0)(x - x0)

The second or quadratic approximation adds a parabola of second order, considering also the curvature in the model point.

y ≈ f(x0) + f ´(x0)(x - x0)/1! + f´´(x0)(x - x0)2/2

(One should realize that the resulting polynom of second order is not identical to the parabola used in the Kepler algorithm of integration:  The Kepler parabola cuts the curve in three points, while the Taylor polynom touches it in one. Both approximations converge with decreasing interval width of integration).

The higher order approximations are polynomials of increasing order, which approach the function well over wider and wider intervals (for "well behaved" functions, which our examples are).

For the example of a 7th power parabola the 7th Taylor approximation is identical to the function itself, as all higher derivatives are 0. (the very small deviations from 0 seen in the number fields for f8 and f9 are residual calculation errors).

(x - 0)7 = y0 + f1(x - x0) + f2 (x - x0)2 + f3(x - x0)3 + f4(x - x0)4 + f5(x - x0)5

+ f6(x - x0)6 + f7(x - x0)7

The identity demonstrates that the original parabola x7can be interpreted as a Taylor expansion around x = 0. Indeed, as one draws the dot to x = 0, all factors in the number fields become zero except f7, which will be 1.

Calculation of the derivatives

With h − the difference between consecutive x values − sufficiently small, the first derivative (differential quotient) is approximated by the difference quotient:

y(1)(x) = (1/2h) [y(x+h) - y(x-h)]

The second derivative is approximated as the difference quotient of the first difference quotient:

y(2)(x)= (1/2h) [y(1)(x+h) - y(1)(x-h)] = (1/2h)2 [y(x+2h) - 2y(x) + y(x-1h)]

This algorithm can be continued, leading to the code lines shown below for the base function a[0] and its derivatives up to the 9th order a[9].

For the predefined functions most approximations do not differ visibly from the analytical derivatives, with the interval h being 1/1000 of the total range.

For still higher derivatives the limits of the accuracy of the approximation and also of the computing accuracy are stressed, and noise appears.

Code for calculating the derivatives: With s = 1/(2h)











Code for calculating the Taylor approximations











The integers in the formulas of the derivatives follow simple generation rules; thus the series can be easily generated or continued.



  • The zero order approximation assumes that the value in the model point is true for the whole interval.
  • The first order considers the local steepness of the function curve.
  • The second derivative considers the local change in steepness = curvature.
  • The third derivative considers the local change in curvature =  ?
  • The fourth derivative considers the local change in the change of curvature = ??
  • ...and so on.

Try to understand what the higher derivatives mean, as applied to the Taylor approximation of a function.

E2:  Do that for the sine function. Why does the 4th approximation not look like the base function itself? (the 4th derivative alone is identical to it).

E3:  Go through the approximations of the power function:  What type of polynom is each one? (Write them down, using the factors in the number fields). Check that 7th to 9th are identical (tiny differences recognizable are calculation errors). Compare the 7th order polynoms around different model points and argue their identity. Look at the one for x0 = 0.

E4: Experiment with all base functions. Consider why and when a linear approximation, which is easy to handle analytically, is good enough. Take a look at the sequence factors.


This simulation was created in May 2010 by Dieter Roess

This simulation is part of

Learning and Teaching Mathematics using Simulations

– Plus 2000 Examples from Physics”

ISBN 978-3-11-025005-3, Walter de Gruyter GmbH & Co. KG



Code Language Translator Run

Software Requirements


Android iOS Windows MacOS
with best with Chrome Chrome Chrome Chrome
support full-screen? Yes. Chrome/Opera No. Firefox/ Samsung Internet Not yet Yes Yes
cannot work on some mobile browser that don't understand JavaScript such as.....
cannot work on Internet Explorer 9 and below



Dieter Roess - WEH- Foundation; Tan Wei Chiong; Loo Kang Wee

Sample Learning Goals


For Teachers

The Taylor Series is a generalised polynomial approximation to a function, centered around x = a, for any real number a.

In this simulation, you can choose a function to approximate with the Taylor Series from the combo box provided. However, this is technically not a series, as the terms do not go indefinitely.

Beside the combo box for selecting the function, there is a set of 10 checkboxes, each of them corresponding to a certain degree of approximation. The degree of the polynomial approximation is shown by the number beside the checkbox. When each box is checked, the graph of the polynomial corresponding to the degree denoted by the checkbox is made visible; unchecking it will make it invisible.

The available functions are as follows:
Gaussian: y = e^-(x^2)
y = sin(x)
y = sin(x)^2
y = sin(x)/x
sin(x)/x Quadratic: y = [sin(x)/x]^2
y = x^7
y = e^x

At the top of the simulation, the full 9th degree polynomial approximation for the function at the point denoted by the square in the graph is shown, and will automatically change when the point is moved. Likewise, the graphs of the different polynomial approximations will also adjust accordingly.






  1. improved version with joseph chua's inputs
  2. original simulation by lookang

Other Resources


end faq

{accordionfaq faqid=accordion4 faqclass="lightnessfaq defaulticon headerbackground headerborder contentbackground contentborder round5"}

1 1 1 1 1 1 1 1 1 1 Rating 0.00 (0 Votes)