A Taylor series uses the derivatives of a function at one point to build a power series. Its finite versions, called Taylor polynomials, give practical approximations near that point.
Recovering coefficients from derivatives
Suppose a function has a power-series representation centered at a:
f(x)=n=0∑∞cn(x−a)n=c0+c1(x−a)+c2(x−a)2+⋯.
Setting x=a removes every positive power of (x−a), so
c0=f(a).
Differentiate once:
f′(x)=c1+2c2(x−a)+3c3(x−a)2+⋯.
At x=a, this gives c1=f′(a). Differentiating twice gives
f′′(a)=2!c2,
and continuing the pattern gives
f(n)(a)=n!cn.
Therefore every coefficient is forced by the derivatives of f at the center:
cn=n!f(n)(a).
This also gives a quick way to read derivatives from a known power series: the coefficient of (x−a)n is f(n)(a)/n!.
Example: reading derivatives from a power series
From the geometric-series calculation in the previous section,
2+x23=n=0∑∞2n+13(−1)nx2n,∣x∣<2.
To find f(10)(0), look for the x10 term. Since 2n=10, it comes from n=5, and its coefficient is
263(−1)5=−643.
The coefficient of x10 is also f(10)(0)/10!, so
f(10)(0)=10!(−643).
Only even powers appear in this series. There is no x9 term, so its coefficient is 0 and
f(9)(0)=0.
Taylor and Maclaurin series
The Taylor series of f centered at a is
f(x)=n=0∑∞n!f(n)(a)(x−a)n
where the equality is valid at the values of x for which the series actually converges to f(x). We use the conventions
f(0)(a)=f(a),0!=1,(x−a)0=1.
A Taylor series centered at 0 is called a Maclaurin series:
f(x)=n=0∑∞n!f(n)(0)xn.
The degree-k Taylor polynomial keeps only the terms through degree k:
Tk(x)=n=0∑kn!f(n)(a)(x−a)n.
It is a finite polynomial, so it approximates the function without requiring an infinite sum.
Three standard Maclaurin series
Every derivative of ex is ex, and each derivative equals 1 at 0. Therefore,
ex=n=0∑∞n!xn=1+x+2!x2+3!x3+⋯.
The derivatives of sinx cycle through
sinx,cosx,−sinx,−cosx.
At 0, their values cycle through 0,1,0,−1. Only the odd powers remain:
sinx=n=0∑∞(2n+1)!(−1)nx2n+1=x−3!x3+5!x5−⋯.
For example, the degree-4 Maclaurin polynomial has no fourth-degree term, so
T4(x)=x−3!x3.
The derivatives of cosx give the same alternating pattern on even powers:
cosx=n=0∑∞(2n)!(−1)nx2n=1−2!x2+4!x4−⋯.
These three series converge to their functions for every real x.
The Taylor remainder
A Taylor polynomial is usually an approximation, not the whole function. The difference
Rk(x)=f(x)−Tk(x)
is the kth Taylor remainder. Rearranging gives
f(x)=Tk(x)+Rk(x).
For a fixed x, the Taylor series equals f(x) when
k→∞limRk(x)=0.
The remainder is therefore the part that must disappear as more Taylor terms are included.
Taylor's inequality
Taylor's inequality gives an upper bound on the approximation error. Suppose
∣f(k+1)(u)∣≤M
for every u between the center a and the point x. Then
∣Rk(x)∣≤(k+1)!M∣x−a∣k+1.
The bound becomes smaller when x is closer to the center or when the factorial in the denominator grows faster than the derivative bound.
Example: approximating ex on (−1,1)
The degree-4 Maclaurin polynomial for ex is
T4(x)=1+x+2!x2+3!x3+4!x4.
Every derivative of ex is ex. On (−1,1),
∣f(5)(x)∣=ex≤e,
so we may use M=e. Taylor's inequality gives
∣R4(x)∣≤5!e∣x∣5<120e≈0.023.
Thus, throughout (−1,1),
∣ex−T4(x)∣<0.023.
The number 0.023 is a guaranteed worst-case error bound on that interval. The actual error may be smaller.