Open Educational Resources

Taylor Series: Applications

MacLaurin Series

The following are the MacLaurin series for some basic infinitely differentiable functions:

    \[\begin{split} e^x&=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots = \sum_{n=0}^\infty \frac{x^n}{n!}\\ \sin{x}&=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots = \sum_{n=0}^\infty \frac{(-1)^{n}x^{2n+1}}{(2n+1)!}\\ \cos{x}&=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots = \sum_{n=0}^\infty \frac{(-1)^{n}x^{2n}}{(2n)!} \end{split} \]

Numerical Differentiation

Taylor’s Theorem provides a means for approximating the derivatives of a function. The first-order Taylor approximation of a function f is given by:

    \[ f(x)=f(a)+f'(a)h+\mathcal O (h^2) \]

where h=x-a is the step size. Then, :

    \[ f'(a)=\frac{f(x)-f(a)}{h}+\frac{\mathcal O (h^2)}{h}=\frac{f(x)-f(a)}{h}+\mathcal O (h) \]

Forward finite-difference

If we use the Taylor series approximation to estimate the value of the function f at a point x_{i+1} knowing the values at point x_i<x_{i+1} then,we have:

(1)   \begin{equation*} f(x_{i+1})=f(x_{i})+f'(x_{i})h+\mathcal{O} (h^2) \end{equation*}

where h=x_{i+1}-x_i. In this case, the forward finite-difference can be used to approximate f'(x_{i}) as follows:

    \[ f'(x_{i})=\frac{f(x_{i+1})-f(x_i)}{x_{i+1}-x_i}+\mathcal{O} (h) \]

Backward finite-difference

If we use the Taylor series approximation to estimate the value of the function f at a point x_{i-1} knowing the values at point x_i>x_{i-1} then, we have:

(2)   \begin{equation*} f(x_{i-1})=f(x_{i})-f'(x_{i})h+\mathcal O (h^2) \end{equation*}

where h=x_{i}-x_{i-1}. In this case, the backward finite-difference can be used to approximate f'(x_{i}) as follows:

    \[ f'(x_{i})=\frac{f(x_{i-1})-f(x_i)}{x_{i-1}-x_i}+\mathcal O (h) \]

Centred Finite Difference

The centred finite difference can provide a better estimate for the derivative of a function at a particular point. If the values of a function f are known at the points x_{i-1}<x_i<x_{i+1} and x_{i+1}-x_i=x_i-x_{i-1}=h, then, we can use the Taylor series to find a good apprxoimation for the derivative as follows:

    \[ \begin{split} f(x_{i+1})&=f(x_i)+f'(x_i) h+\frac{f''(x_i)}{2!}h^2+\mathcal{O}(h^3)\\ f(x_{i-1})&=f(x_i)+f'(x_i)(-h)+\frac{f''(x_i)}{2!}h^2+\mathcal{O}(h^3) \end{split} \]

Subtracting the above two equations and dividing by h gives the following:

    \[ f'(x_i)=\frac{f(x_{i+1})-f(x_{i-1})}{2h}+\mathcal{O}(h^2) \]

Building Differential Equations

See momentum balance and beam approximation for examples where the Taylor’s approximation is used to build a differential equation.

Approximating Continuous Functions

Taylor’s theorem essentially discusses approximating differentiable functions using polynomials. The approximation can be as close as needed by adding more polynomial terms and/or by ensuring that the step size x-a is small enough. It is important to realize that polynomial approximations are valid for continuous functions that are not necessarily differentiable at every point. Let f:[a,b]\rightarrow \mathbb{R}, then the Stone-Weierstrass Theorem states that for any small number \varepsilon>0:\exists P(x) a polynomial function such that the biggest difference between \max_{x\in[a,b]}|f(x)-P(x)|\leq \varepsilon. In other words, we can always find a polynomial function that approximates any continuous function on the interval [a,b] within any degree of accuracy sought! This fact is extremely important in all engineering applications. Essentially, it allows modelling any continuous functions using polynomials. In other words, if a problem wishes to find the distribution of a variable (stress, strain, velocity, density, etc…) as a function of position, and if this variable is continuous, then, in the majority of applications we can assume differentiability and a Taylor approximation for the unknown function.

Lecture video



Leave a Reply

Your email address will not be published.