Taylor Series

The philosophy of Taylor series is to approximate a function with polynomials that use only the information of a single point in the domain of the function. Consider the function f:R→Rf: \mathbb{R} \rightarrow \mathbb{R} and a point a∈Ra \in \mathbb{R}. Further, we would like to use (x−a)0(x-a)^0, (x−a)1(x- a)^1, (x−a)2(x- a)^2, ..., (x−a)n(x- a)^n as the basic building blocks of our approximation. The polynomial constructed is of the form:

pn(x)=c0+c1(x−a)+c2(x−a)2+...+cn(x−a)n p_n(x) = c_0 + c_1 (x - a) + c_2(x - a)^2 + ... + c_n (x - a)^n

Now, assume that the nn-th derivative of ff exits. To approximate ff well, pnp_n should satisfy

pn(a)=f(a) p_n(a) = f(a)

so that c0=f(a)c_0 = f(a).

Further, f′(a)f'(a) tell how the function f(x)f(x) changes when xx moves from aa by a little bit. We require pn(x)p_n(x) to exhibit the same behavior:

pn′(a)=f′(a) p'_n(a) = f'(a)

so that c1=f′(a)c_1 = f'(a).

To fit f(x)f(x) even better, we force the second order derivative of pn(x)p_n(x) at xx comply with f′′(a)f''(a), hence

pn′′(a)=f′′(a) p_n''(a) = f''(a)

and c2=12f′′(a)c_2 = \frac{1}{2} f''(a).

Following the above procedure,we get

ci=1i!f(i)(a) c_i = \frac{1}{i!}f^{(i) } (a)

and

pn(x)=∑k=0nf(k)(a)k!(x−a)k p_n(x) = \sum_{k = 0}^n \frac{ f^{( k ) }(a) }{ k! } (x - a)^k

where f(0)≐ff^{(0)} \doteq f, 0!≐10! \doteq 1. We have just show that the construct polynomial satisfies

Theorem. pn(k)(a)=f(k)(a)p^{ (k) }_n (a) = f^{ (k) } (a), for k∈[n]k \in [n].

Remainder

One natural to ask is that, how accurate is the pn(x)p_n(x). In particular, given x≠ax \neq a, we want to measure the error

rn(x)=f(x)−pn(x) r_n(x) = f(x) - p_n(x)

quantitively.

Note that if the function ff is itself a polynomial up to order nn, then the approximation is accurate that is rn(x)≡0r_n(x) \equiv 0 for x∈Rx \in \mathbb{R}. In this case, we recover ff globally using only local information at aa.

In general, if f(n+1)(x)f^{ (n + 1)} (x) exists and is continuous, then the error is characterized as

Theorem

rn(x)=1n!∫axf(n+1)(t)(x−t)ndt=−∫axf(n+1)(t)d((x−t)n+1(n+1)!) r_n(x) = \frac{1}{n!} \int_a^x f^{ (n + 1) } (t) (x - t)^{n } dt = -\int_a^x f^{ (n + 1) } (t) d \left( \frac{(x - t)^{n + 1} }{(n + 1)!} \right)

Proof.

By fundamental theorem of calculus, we have

f(x)=f(a)+∫axf′(t)dt f(x) = f(a) + \int_{a}^x f'(t) dt

On the other hand

∂[f′(t)(t−x)]∂t=f′′(t)(t−x)+f′(t) \frac{\partial [f'(t) (t - x)] }{\partial t} = f''(t) (t - x) + f'(t)

Therefore,

f′(t)(t−x)∣t=ax=f′(a)(x−a)=∫axf′′(t)(t−x)dt+∫axf′(t)dt f'(t) (t - x) \mid_{t = a}^x = f'(a) (x -a) = \int_{a}^x f''(t) (t - x) dt + \int_{a}^x f'(t) dt

and

f(x)=f(a)+f′(a)(x−a)+∫axf′′(t)(x−t)dt f(x) = f(a) + f'(a) (x - a) + \int_{a}^x f''(t) (x - t) dt

Similarly,

∫axf′′(t)(x−t)dt=−∫axf′′(t)d(x−t)22!=f′′(a)(x−a)22!+∫ax(x−t)22!f(3)(t)dt \begin{aligned} \int_{a}^x f''(t) (x - t) dt &= - \int_{a}^x f''(t) d \frac{ (x - t)^2}{2!} \\ &= f''(a) \frac{ (x - a)^2}{2!} + \int_{a}^x \frac{ (x - t)^2}{2!} f^{(3) } (t) dt \end{aligned}

As just shown, the proof can be finished by induction. □\square

Weighted Mean Value Theorem. Given a continuous functions f≥0f \ge 0 and an Riemann integral function g≥0g \ge 0 defined on an closed interval II, then

∫If(t)g(t)dt=f(c)∫Ig(t)dt \int_I f(t) g(t) dt = f(c) \int_I g(t) dt

for some c∈Ic \in I.

Proof. As ff is continuous and II is closed, ∃m,M∈R\exists m, M \in \mathbb{R}, s.t.,

m≤f(t)≤M,∀t∈I m \le f(t) \le M, \qquad \forall t \in I

Therefore,

mg(t)≤f(t)g(t)≤Mg(t),∀t∈I mg(t) \le f(t) g(t) \le M g(t), \qquad \forall t \in I

Define S=∫Ig(t)dtS = \int_I g(t) dt. By monotonicity of Riemann integration, we have

mS≤∫If(t)g(t)dt≤MS m S \le \int_I f(t) g(t) dt \le M S

Note that Sf(t)S f(t) is a continuous function in II. Hence, by mean value theorem, ∃c∈I\exists c \in I, such that

Sf(c)=∫If(t)g(t)dt S f(c) = \int_I f(t) g(t) dt

□\square

Corollary 1. By weighted mean value theorem, we have

rn(x)=1n!∫axf(n+1)(t)(x−t)ndt=f(n+1)(c)∫ax1n!(x−t)ndt=f(n+1)(c)(n+1)!(x−a)n+1 \begin{aligned} r_n(x) &= \frac{1}{n!} \int_a^x f^{ (n + 1) } (t) (x - t)^{n } dt \\ &= f^{ (n + 1) } (c) \int_a^x \frac{1}{n!} (x - t)^{n } dt \\ &= \frac{f^{ (n + 1) } (c ) }{(n + 1) ! } (x - a)^{n + 1 } \end{aligned}

for some c∈[a,x]c \in [a, x].

Corollary 2. Let f:→Rn→Rf:\rightarrow \mathbb{R}^n \rightarrow \mathbb{R} be a function with continuous second partial derivatives, then given a∈Rna \in \mathbb{R}^n, it holds that

f(x)=f(a)+[∇f(c)]T(x−a) f(x) = f(a) + [\nabla f(c)]^T (x - a)

for some c∈a+t(x−a)c \in a + t(x - a), where t∈[0,1]t \in [0, 1].

Proof: Define g(t)=f(a+t(x−a)):[0,1]→Rg(t) = f(a + t (x- a)) : [0,1] \rightarrow \mathbb{R}. Then

  1. g(0)=f(a)g(0) = f(a).
  2. g(1)=f(x)g(1) = f(x).
  3. g′(t)=[∇f(a+t(x−a))]T(x−a)g'(t) = [\nabla f(a + t (x- a) ) ]^T (x - a)
  4. By mean value theorem, ∃t∈[0,1]\exists t \in [0, 1], s.t.,
g(1)−g(0)1=f(x)−f(a)=g′(t)=[∇f(a+t(x−a))]T(x−a) \frac{g(1) - g(0)}{1} = f(x) - f(a) = g'(t) = [\nabla f(a + t (x- a) ) ]^T (x - a)

□\square

Corollary 3. Let ff, gg and cc as defined before, then

f(x)=f(a)+[∇f(a)]T(x−a)+12(x−a)T[∇2f(c)](x−a) f(x) = f(a) + [\nabla f(a)]^T (x - a) + \frac{1}{2} (x - a)^T [\nabla^2 f(c)] (x - a)

Proof:

g′′(t)=(x−a)T[∇2f(a+t(x−a))](x−a) g''(t) = (x - a)^T [\nabla^2 f(a + t (x- a) ) ] (x - a)

Then applying Corollary 1 gives

g(1)=g(0)+g′(0)(1−0)+12g′′(t)(1−0)2 g(1) = g(0) + g'(0)(1 - 0) + \frac{1}{2} g''(t) (1 - 0)^2

for some t∈[0,1]t \in [0, 1].

□\square