> For the complete documentation index, see [llms.txt](https://exobrain.stfwn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://exobrain.stfwn.com/calculus/taylor-series.md).

# Taylor Series

The idea of the Taylor series is to approximate a function around a point with a polynomial. This is done by adjusting the coefficients of the polynomial such that its derivates match that of the function that is being approximated to a certain degree.

$$
f(x) = c\_0 x^0 + c\_1 x^1 + c\_2 x^2 + c\_3 x^3 ...
$$

> For the approximating polynomial, the $$n^{th}$$ coefficient of each $$x^n$$-term is the value of the $$n^{th}$$ derivative (of the original function) evaluated at $$0$$, divided by $$n!$$. (3Blue1Brown)

This makes it so that first, the *value* of the two functions is identical at $$0$$, then the slope is identical, then the rate of change, then the rate of change of the rate of change, and so on. The more terms you add, the closer the approximation.

You can craft the approximation for any point by evaluating the derivate at that point instead. The general equation for a Taylor series of a function $$f(x)$$ turns out to be:

$$
f(c) + \frac{f'(c)}{1!}(x-c)^2 + \frac{f''(c)}{2!}(x-c)^2 + \frac{f'''(c)}{3!}(x-c)^3
$$

TODO: add bit about approximations for functions with more than one variable.
