Taylor Expansion
Definition
For a function \(f(x)\), if it is differentiable everywhere on its domain, then it can be written as a polynomial function (that is, the Taylor expansion of this function). In general, we have:
\[ f(x) = \sum_{n = 0}^{\infty} \frac{f^{(n)}(x_0)}{n!}(x - x_0)^n \]
When \(x_0 = 0\), this expression is also called the Maclaurin series.
Derivation
Consider the case \(x_0 = 0\) (as it turns out, \(x_0\) does not affect the conclusion): Taylor's idea is to construct a polynomial function that gets infinitely close to an arbitrary function; the larger \(n\) is taken, the closer it fits the original function. Let the function to approximate be \(f(x)\), and let the polynomial function be \(g(x)\). We consider setting this polynomial function to be:
\[ g(x) = \sum_{n = 0}^{\infty} a_n x^n \]
To find this polynomial function, the most important thing is to find \({a_n}\). If we look at this problem from the angle of calculus, we find that higher-order derivatives can give us enough information.
Let us think about the conditions these two functions must satisfy. First, take \(x=0\); then we certainly have:
\[ f(0) = g(0) \]
This is beyond doubt. Expanding it, we find:
\[ f(0) = a_0 \]
So we have the information for the first coefficient. Now we consider the information that differentiation gives us. First we list the case of the first derivative, then the cases of the other derivatives:
\[ \begin{gathered} f'(0) = g'(0), f'(0) = a_1 \\ f''(0) = g''(0), f''(0) = 2a_2 \\ f'''(0) = g'''(0), f'''(0) = 6a_3 \\ \dots \end{gathered} \]
This pattern is obvious; thinking about the basic differentiation formulas, you can see that \(f^n(0) = (n!)a_n\). So, going the other way, we get:
\[ a_n = \frac{f^n(0)}{n!} \]
Substituting back into the original expression:
\[ g(x) = \sum_{n = 0}^{\infty} \frac{f^n(0)}{n!} x^n \]