Let’s say we want to approximate a function ff. In an area around aa the value f(a)f(a) is probably a decent approximation for f(x)f(x).

Using the Fundamental Theorem of Calculus we can calculate the error

f(x)f(a)=axf(y)dy f(x) - f(a) = \int_a^x f'(y)dy

If ff' is bounded by f\|f'\|_\infty then our error is smaller than f(xa)\|f'\|_\infty (x-a). We can now improve this bound by approximating ff' itself in the same way:

f(x)f(a)=ax(f(a)+ayf(s)ds)dy=f(a)(xa)+axayf(s)dsdy  \begin{aligned} f(x) - f(a) &= \int_a^x \left( f'(a) + \int_a^y f''(s)ds \right) dy\\ &= f'(a) (x-a) + \int_a^x \int_a^y f''(s)ds dy\ \end{aligned}

Which results in a more precise approximation of ff:

f(x)f(a)+f(a)(xa) f(x) \approx f(a) + f'(a)(x-a)

If ff'' is bounded then our error is now only f(xa)2\|f''\|_\infty(x-a)^2 a significant improvement over the previous error close to aa.

Iterating on this idea yields the taylor approximation. If all the derivatives are bounded by the same constant, the error converges towards zero, the function is a taylor series

f(x)=f(a)+f(a)(xa)+f(a)(xa)22+=k=0f(k)(a)(xa)kk! \begin{aligned} f(x) &= f(a) + f'(a)(x-a) + f''(a)\frac{(x-a)^2}{2} + \dots\\ &= \sum_{k=0}^\infty f^{(k)}(a)\frac{(x-a)^k}{k!} \end{aligned}

Application: Exponential Function

If the change of something is equal to the current size (e.g. number of bacteria as it increases via cell division) then that implies f=ff=f'. If we also assume f(0)=1f(0)=1 for normalization then we immediately obtain the series representation of the unique function with this property: the exponential function

exp(x)=k=0exp(0)(x0)kk!=k=0xkk! \exp(x) = \sum_{k=0}^\infty \exp(0) \frac{(x-0)^k}{k!} = \sum_{k=0}^\infty \frac{x^k}{k!}

Taylor Approximation in Multiple Dimensions

To obtain the Taylor’s Theorem for functions f:RdRf:\mathbb{R}^d\to\mathbb{R} from multiple dimensions one can simply reduces them to the one dimensional version of the taylor theorem with the following trick. For a,xRa,x\in\mathbb{R} we can define

g:{[0,1]Rsf(a+s(xa)) g :\begin{cases} [0,1] \to \mathbb{R} \\ s\to f(a+s(x-a)) \end{cases}

which means we can apply the one dimensional taylor theorem from above to gg to get

f(x)=g(1)=g(0)+g(0)(10)+g(0)(10)22+=f(a)+f(a)T(xa)+12(xa)T2f(a)(xa)+ \begin{aligned} f(x) &= g(1) = g(0) + g'(0)(1-0) + g''(0)\frac{(1-0)^2}{2} + \dots\\ &=f(a) + \nabla f(a)^T(x-a) + \tfrac12 (x-a)^T\nabla^2f(a)(x-a) + \dots \end{aligned}