Post · 15 min read· pp. 1064–1072

Taylor Theorem

Introduction

Taylor theorem is widely used for the approximation of a kk-times differentiable function around a given point by a polynomial of degree kk, called the kkth-order Taylor polynomial. In addition, it is also useful for proving some of the convex function properties.

In this blog post, I would like to discuss and prove the univariate Taylor theorem followed by touching some of the basic expressions for the commonly used quadratic multivariate Taylor theorem.

Prerequisites

The following theorem and lemmas are prerequisite knowledge for proving the univariate Taylor theorem.

Rolle’s Theorem

Rolle’s theorem is a special case of mean value theorem.

If a real-valued function ff is continuous on a proper closed interval [a,b][a, b], differentiable on the open interval (a,b)(a, b), and f(a)=f(b)f(a) = f(b), then there exists at least one cc in the open interval (a,b)(a, b) such that f(c)=0f(c) = 0.

Lemma 1

Let f:R→Rf: \mathbb{R} \rightarrow \mathbb{R} be $2$ times differentiable on the open interval with f′f^{\prime} and f′′f^{\prime\prime} continuous on the closed interval II between aa and x0x_0 (a function of class C2C^2 on II). If f′(a)=0f^{\prime}(a) = 0, and x0x_0 is a point such that f(x0)=f(a)f(x_0) = f(a) and x0≠ax_0 \neq a, then there exists t∈(0,1)t \in (0,1) such that f′′(a+t(x0−a))=0f^{\prime\prime}(a + t(x_0 - a)) = 0.

Proof

Because f(x0)=f(a)f(x_0) = f(a) and x0≠ax_0 \neq a, according to Rolle’s Theorem, there exists t1∈(0,1)t_1 \in (0,1) such that f′(a+t1(x0−a))=0f^{\prime}(a + t_1(x_0 - a)) = 0. Now, because f′(a)=f′(a+t1(x0−a))f^{\prime}(a) = f^{\prime}(a + t_1(x_0 - a)) and a+t1(x0−a)≠aa + t_1(x_0 - a) \neq a, again, according to Rolle’s Theorem, there exists t2∈(0,1)t_2 \in (0,1) such that f′′(a+t2(a+t1(x0−a)−a))=0f^{\prime\prime}(a + t_2(a + t_1(x_0 - a) - a)) = 0.

f′′(a+t2(a+t1(x0−a)−a))=f′′(a+t2t1(x0−a))=f′′(a+t(x0−a))=0\begin{align} f^{\prime\prime}(a + t_2(a + t_1(x_0 - a) - a)) &= f^{\prime\prime}(a + t_2t_1(x_0 - a)) \\ &= f^{\prime\prime}(a + t(x_0 - a)) \\ &= 0 \\ \end{align}

where t=t1t2t = t_1t_2.

This concludes the proof.

Lemma 2

Let ff of class CkC^k on the closed interval II between aa and x0x_0. If f′(a)=f′′(a)=⋯=f(k−1)(a)=0f^{\prime}(a) = f^{\prime\prime}(a) = \cdots = f^{(k-1)}(a) = 0, and x0x_0 is a point such that f(x0)=f(a)f(x_0) = f(a) and x0≠ax_0 \neq a, then there exists t∈(0,1)t \in (0,1) such that f(k)(a+t(x0−a))=0f^{(k)}(a + t(x_0 - a)) = 0.

Proof

Because f(x0)=f(a)f(x_0) = f(a), x0≠ax_0 \neq a, and f′(a)=0f^{\prime}(a) = 0, according to Lemma 1, there exists t1∈(0,1)t_1 \in (0,1) such that f′′(a+t1(x0−a))=0f^{\prime\prime}(a + t_1(x_0 - a)) = 0. Because f′′(a+t1(x0−a))=f′′(a)f^{\prime\prime}(a + t_1(x_0 - a)) = f^{\prime\prime}(a), a+t1(x0−a)≠aa + t_1(x_0 - a) \neq a, and f′′(a)=0f^{\prime\prime}(a) = 0, according to Lemma 1, there exists t2′∈(0,1)t_2^{\prime} \in (0,1) such that f(3)(a+t2′(a+t1(x0−a)−a))=0f^{(3)}(a + t_2^{\prime}(a + t_1(x_0 - a) - a)) = 0. We rearrange the terms, so there must exists t2∈(0,1)t_2 \in (0,1) such that f(3)(a+t2(x0−a))=0f^{(3)}(a + t_2(x_0 - a)) = 0, where t2=t1t2′t_2 = t_1 t_2^{\prime}.

Iterating this process, there exists tk−1∈(0,1)t_{k-1} \in (0,1) such that f(k)(a+tk−1(x0−a))=0f^{(k)}(a + t_{k-1}(x_0 - a)) = 0.

This concludes the proof.

Univariate Taylor Theorem

General Univariate Taylor Theorem

Let k≥1k \geq 1 be an integer and let the function f:R→Rf: \mathbb{R} \rightarrow \mathbb{R} be kk times differentiable at the point a∈Ra \in \mathbb{R}. Then there exists a function hk:R→Rh_k: \mathbb{R} \rightarrow \mathbb{R} such that

f(x)=Pk(x)+Rk(x)f(x) = P_k(x) + R_k(x)

where Pk(x)P_k(x) is the kk-th order Taylor polynomial,

Pk(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(k)(a)k!(x−a)kP_k(x) = f(a) + f^{\prime}(a)(x-a) + \frac{f^{\prime\prime}(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(k)}(a)}{k!}(x-a)^k

and Rk(x)R_k(x) is the remainder term.

The remainder term could have many different forms. The commonly seen form is the Peano form of the remainder, where the formula of the remainder is not explicitly defined.

Rk(x)=hk(x)(x−a)k,lim⁡x→ahk(x)=0R_k(x) = h_k(x)(x-a)^k, \quad \lim_{x \rightarrow a} h_k(x) = 0

There are explicit formula for the remainder, with some additional assumptions. Among the mean-value forms of the remainder, the Lagrange form of the remainder is widely used.

Let f:R→Rf: \mathbb{R} \rightarrow \mathbb{R} be k+1k+1 times differentiable on the open interval with f(k)f^{(k)} continuous on the closed interval between aa and xx, then the remainder term could be expressed as

Rk(x)=f(k+1)(ξL)(k+1)!(x−a)k+1=f(k+1)(a+t(x−a))(k+1)!(x−a)k+1\begin{align} R_k(x) &= \frac{f^{(k+1)}(\xi_L)}{(k+1)!}(x-a)^{k+1} \\ &= \frac{f^{(k+1)}(a + t(x-a))}{(k+1)!}(x-a)^{k+1} \\ \end{align}

where ξL\xi_L is some real value between aa and xx, and $0 \leq t \leq 1$.

It is easy to show that Taylor theorem with the Lagrange form remainder implies Taylor theorem with the Peano form remainder.

f(x)=Pk(x)+Rk(x)=Pk−1(x)+Rk−1(x)\begin{align} f(x) &= P_k(x) + R_k(x) \\ &= P_{k-1}(x) + R_{k-1}(x) \\ \end{align}

We will use Peano form for Rk(x)R_k(x) and Lagrange form for Rk−1(x)R_{k-1}(x), we then have

f(k)(a)k!(x−a)k+hk(x)(x−a)k=f(k)(a+t(x−a))k!(x−a)kf(k)(a)k!+hk(x)=f(k)(a+t(x−a))k!\begin{align} \frac{f^{(k)}(a)}{k!}(x-a)^k + h_k(x)(x-a)^k &= \frac{f^{(k)}(a + t(x-a))}{k!}(x-a)^{k} \\ \frac{f^{(k)}(a)}{k!} + h_k(x) &= \frac{f^{(k)}(a + t(x-a))}{k!} \\ \end{align}

hk(x)=f(k)(a+t(x−a))−f(k)(a)kh_k(x) = \frac{f^{(k)}(a + t(x-a)) - f^{(k)}(a)}{k}

Apparently,

lim⁡x→ahk(x)=0\lim_{x \rightarrow a} h_k(x) = 0

This concludes the proof that Taylor theorem with the Lagrange form remainder implies Taylor theorem with the Peano form remainder.

Let’s check Taylor’s theorem quickly. When k=1k = 1, using the Peano form of the remainder, we have

f(x)=P1(x)+R1(x)=f(a)+f′(a)(x−a)+h1(x)(x−a)\begin{align} f(x) &= P_1(x) + R_1(x) \\ &= f(a) + f^{\prime}(a)(x - a) + h_1(x)(x-a) \\ \end{align}

We have the expression for h(x)h(x)

h1(x)=f(x)−f(a)−f′(a)(x−a)x−a=f(x)−f(a)x−a−f′(a)\begin{align} h_1(x) &= \frac{f(x) - f(a) - f^{\prime}(a)(x - a)}{x - a} \\ &= \frac{f(x) - f(a)}{x - a} - f^{\prime}(a)\\ \end{align}

Because of the definition of derivative,

f′(a)=lim⁡x→af(x)−f(a)x−af^{\prime}(a) = \lim_{x \rightarrow a} \frac{f(x) - f(a)}{x - a}

we have

lim⁡x→ah1(x)=lim⁡x→a(f(x)−f(a)x−a−f′(a))=lim⁡x→a(f(x)−f(a)x−a)−f′(a)=f′(a)−f′(a)=0\begin{align} \lim_{x \rightarrow a} h_1(x) &= \lim_{x \rightarrow a} \bigg( \frac{f(x) - f(a)}{x - a} - f^{\prime}(a) \bigg) \\ &= \lim_{x \rightarrow a} \bigg( \frac{f(x) - f(a)}{x - a} \bigg) - f^{\prime}(a) \\ &= f^{\prime}(a) - f^{\prime}(a) \\ &= 0 \\ \end{align}

Let’s try to prove Taylor’s theorem more formally using the Lagrange form now. (To make the proof somewhat easier, it is not using the more general Peano form remainder.)

Proof

We define new functions g1g_1 and g2g_2.

g1(x)=f(x)−(f(a)+f′(a)(x−a)+⋯+f(k−1)(a)(k−1)!(x−a)k−1)\begin{align} g_1(x) &= f(x) - \bigg( f(a) + f^{\prime}(a) (x-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-1)!} (x-a)^{k-1} \bigg) \end{align}

g2(x)=g1(x)−(x−ax0−a)kg1(x0)\begin{align} g_2(x) &= g_1(x) - \Big(\frac{x - a}{x_0 - a}\Big)^k g_1(x_0) \end{align}

where aa and x0x_0 are some arbitrary real values and a≠x0a \neq x_0.

The derivatives of g1(x)g_1(x) are as follows.

g1(1)(x)=f(1)(x)−(f(1)(a)+f(2)(a)(x−a)+f(3)(a)2!(x−a)2+⋯+f(k−1)(a)(k−2)!(x−a)k−2)g1(2)(x)=f(2)(x)−(f(2)(a)+f(3)(a)(x−a)+⋯+f(k−1)(a)(k−3)!(x−a)k−3)⋮g1(i)(x)=f(i)(x)−(f(i)(a)+f(i+1)(a)(x−a)+⋯+f(k−1)(a)(k−i−1)!(x−a)k−i−1)⋮g1(k−1)(x)=f(k−1)(x)−f(k−1)(a)g1(k)(x)=f(k)(x)\begin{gather} g_1^{(1)}(x) = f^{(1)}(x) - \bigg( f^{(1)}(a) + f^{(2)}(a) (x-a) + \frac{f^{(3)}(a)}{2!} (x-a)^2 + \cdots + \frac{f^{(k-1)}(a)}{(k-2)!} (x-a)^{k-2} \bigg) \\ g_1^{(2)}(x) = f^{(2)}(x) - \bigg( f^{(2)}(a) + f^{(3)}(a) (x-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-3)!} (x-a)^{k-3} \bigg) \\ \vdots \\ g_1^{(i)}(x) = f^{(i)}(x) - \bigg( f^{(i)}(a) + f^{(i+1)}(a) (x-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-i-1)!} (x-a)^{k-i-1} \bigg) \\ \vdots \\ g_1^{(k-1)}(x) = f^{(k-1)}(x) - f^{(k-1)}(a) \\ g_1^{(k)}(x) = f^{(k)}(x) \\ \end{gather}

It is easy to verify that g1(i)(a)=0g_1^{(i)}(a) = 0 for i∈[1,k−1]i \in [1, k-1].

The derivatives of g2(x)g_2(x) are as follows.

g2(1)(x)=g1(1)(x)−k(x−a)k−1(x0−a)kg1(x0)g2(2)(x)=g1(2)(x)−k(k−1)(x−a)k−2(x0−a)kg1(x0)g2(i)(x)=g1(i)(x)−k!(k−i)!(x−a)k−i(x0−a)kg1(x0)g2(k−1)(x)=g1(k−1)(x)−k!x−a(x0−a)kg1(x0)g2(k)(x)=g1(k)(x)−k!1(x0−a)kg1(x0)\begin{gather} g_2^{(1)}(x) = g_1^{(1)}(x) - k \frac{(x - a)^{k-1}}{(x_0 - a)^k} g_1(x_0) \\ g_2^{(2)}(x) = g_1^{(2)}(x) - k(k-1) \frac{(x - a)^{k-2}}{(x_0 - a)^k} g_1(x_0) \\ g_2^{(i)}(x) = g_1^{(i)}(x) - \frac{k!}{(k-i)!} \frac{(x - a)^{k-i}}{(x_0 - a)^k} g_1(x_0) \\ g_2^{(k-1)}(x) = g_1^{(k-1)}(x) - k! \frac{x - a}{(x_0 - a)^k} g_1(x_0) \\ g_2^{(k)}(x) = g_1^{(k)}(x) - k! \frac{1}{(x_0 - a)^k} g_1(x_0) \\ \end{gather}

Given g1(i)(a)=0g_1^{(i)}(a) = 0 for i∈[1,k−1]i \in [1, k-1], it is also easy to verify that g2(i)(a)=0g_2^{(i)}(a) = 0 for i∈[1,k−1]i \in [1, k-1].

Further more,

g1(a)=f(a)−f(a)=0\begin{align} g_1(a) = f(a) - f(a) = 0 \end{align}

g2(a)=g1(a)=0\begin{align} g_2(a) = g_1(a) = 0 \end{align}

g2(x0)=g1(x0)−g1(x0)=0\begin{align} g_2(x_0) = g_1(x_0) - g_1(x_0) = 0 \end{align}

So we have g2(x0)=g2(a)g_2(x_0) = g_2(a) and a≠x0a \neq x_0.

So we have g2(x0)=g2(a)g_2(x_0) = g_2(a) and a≠x0a \neq x_0, and g2′(a)=g2′′(a)=⋯=g2(k−1)(a)=0g_2^{\prime}(a) = g_2^{\prime\prime}(a) = \cdots = g_2^{(k-1)}(a) = 0. According to Lemma 2, there exists t∈(0,1)t \in (0,1) such that g2(k)(a+t(x0−a))=0g_2^{(k)}(a + t(x_0 - a)) = 0.

Therefore,

g2(k)(a+t(x0−a))=g1(k)(a+t(x0−a))−k!1(x0−a)kg1(x0)=f(k)(a+t(x0−a))−k!1(x0−a)k(f(x0)−(f(a)+f′(a)(x0−a)+⋯+f(k−1)(a)(k−1)!(x0−a)k−1))=0\begin{align} g_2^{(k)}(a + t(x_0 - a)) &= g_1^{(k)}(a + t(x_0 - a)) - k! \frac{1}{(x_0 - a)^k} g_1(x_0) \\ &= f^{(k)}(a + t(x_0 - a)) - k! \frac{1}{(x_0 - a)^k} \Bigg( f(x_0) - \bigg( f(a) + f^{\prime}(a) (x_0-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-1)!} (x_0-a)^{k-1} \bigg) \Bigg) \\ &= 0 \\ \end{align}

f(x0)=f(a)+f′(a)(x0−a)+⋯+f(k−1)(a)(k−1)!(x0−a)k−1+f(k)(a+t(x0−a))k!(x0−a)k\begin{align} f(x_0) &= f(a) + f^{\prime}(a) (x_0-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-1)!} (x_0-a)^{k-1} + \frac{f^{(k)}(a + t(x_0 - a))}{k!}(x_0 - a)^k \end{align}

Note that we have assumed aa and x0x_0 to be arbitrary as long as a≠x0a \neq x_0. So we basically have,

f(x)=f(a)+f′(a)(x−a)+⋯+f(k−1)(a)(k−1)!(x−a)k−1+f(k)(a+t(x−a))k!(x−a)k\begin{align} f(x) &= f(a) + f^{\prime}(a) (x-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-1)!} (x-a)^{k-1} + \frac{f^{(k)}(a + t(x - a))}{k!}(x - a)^k \end{align}

where x≠ax \neq a.

However, it is easy to see that when x=ax = a, the above equation still holds. So ultimately, we have

f(x)=f(a)+f′(a)(x−a)+⋯+f(k−1)(a)(k−1)!(x−a)k−1+f(k)(a+t(x−a))k!(x−a)k\begin{align} f(x) &= f(a) + f^{\prime}(a) (x-a) + \cdots + \frac{f^{(k-1)}(a)}{(k-1)!} (x-a)^{k-1} + \frac{f^{(k)}(a + t(x - a))}{k!}(x - a)^k \end{align}

The above verifies Taylor theorem with the Lagrange form remainder.

This concludes the proof.

Multivariate Taylor Theorem

The multivariate Taylor theorem is a little bit complicated. We will only focus on the quadratic form here without discussing the proofs.

Multi-Index Notation

There are some notations in order to express the multivariate Taylor theorem conveniently.

Suppose α∈Nn\alpha \in \mathbb{N}^n, α={α1,α2,⋯ ,αn}\alpha = \{\alpha_1, \alpha_2, \cdots, \alpha_n\}, and x∈Rnx \in \mathbb{R}^n, x={x1,x2,⋯ ,xn}x = \{x_1, x_2, \cdots, x_n\}, we have the following notations.

∣α∣=α1+α2+⋯+αn\lvert \alpha \rvert = \alpha_1 + \alpha_2 + \cdots + \alpha_n

α!=α1!α2!⋯αn!\alpha ! = \alpha_1! \alpha_2! \cdots \alpha_n!

(nα)=n!α!=n!α1!α2!⋯αn!{n \choose \alpha} = \frac{n!}{\alpha !} = \frac{n!}{\alpha_1! \alpha_2! \cdots \alpha_n!}

xα=x1α1x2α2⋯xnαnx^{\alpha} = x_1^{\alpha_1} x_2^{\alpha_2} \cdots x_n^{\alpha_n}

Suppose α∈Nn\alpha \in \mathbb{N}^n and a constant natural number kk, how many different α\alpha are there such that ∣α∣=k\lvert \alpha \rvert = k?

Let’s look at an example. Assume n=3n = 3 and k=2k = 2, the α\alpha such that ∣α∣=k\lvert \alpha \rvert = k are

α=(2,0,0)α=(0,2,0)α=(0,0,2)α=(1,1,0)α=(1,0,1)α=(0,1,1)\begin{gather} \alpha = (2, 0, 0) \\ \alpha = (0, 2, 0) \\ \alpha = (0, 0, 2) \\ \alpha = (1, 1, 0) \\ \alpha = (1, 0, 1) \\ \alpha = (0, 1, 1) \\ \end{gather}

Therefore, we have $6$ different α\alpha for n=3n = 3 and k=2k = 2.

The formula for the general case is actually not hard to derive. This combination problem is actually equivalent to the combination problem that we have k+nk + n identical balls, and nn different boxes, how many unique ways to put these balls into the boxes such that each box has at least one ball. To solve it, we would need to put all the k+nk+n balls as a sequence, and insert n−1n-1 barriers between the balls, such that each two adjacent balls could have at most one barrier. The number of combinations for this problem is, obviously, (k+n−1n−1)k+n-1 \choose n-1.

Let’s verify if the formula we derived is valid for the example we have seen above.

(k+n−1n−1)=(2+3−13−1)=(42)=6{k+n-1 \choose n-1} = {2+3-1 \choose 3-1} = {4 \choose 2} = 6

kk-th Order Partial Derivatives

Suppose a function f:Rn→Rf: \mathbb{R}^n \rightarrow \mathbb{R} is kk times differentiable, the kk-th order partial derivatives of ff are

Dαf=∂∣α∣f∂x1α1∂x2α2⋯∂xnαnD^{\alpha} f = \frac{\partial^{\lvert \alpha \rvert}f}{\partial x_1^{\alpha_1} \partial x_2^{\alpha_2} \cdots \partial x_n^{\alpha_n}}

for all α\alpha such that ∣α∣=k\lvert \alpha \rvert = k.

Suppose a function f:Rn→Rf: \mathbb{R}^n \rightarrow \mathbb{R} is kk times differentiable at point x∈Rnx \in \mathbb{R}^n, the kk-th order partial derivatives of ff evaluated at point xx are

Dαf(x)=∂∣α∣f∂x1α1∂x2α2⋯∂xnαn(x)D^{\alpha} f (x) = \frac{\partial^{\lvert \alpha \rvert}f}{\partial x_1^{\alpha_1} \partial x_2^{\alpha_2} \cdots \partial x_n^{\alpha_n}} (x)

for all α\alpha such that ∣α∣=k\lvert \alpha \rvert = k.

Let’s look at an example. Assume n=3n = 3 and k=2k = 2,

f(x)=5x13+7x22x34f(x) = 5 x_1^3 + 7 x_2^2 x_3^4

From the example in the Multi-Index Notation section, we know that all the α\alpha are

α=(2,0,0)α=(0,2,0)α=(0,0,2)α=(1,1,0)α=(1,0,1)α=(0,1,1)\begin{gather} \alpha = (2, 0, 0) \\ \alpha = (0, 2, 0) \\ \alpha = (0, 0, 2) \\ \alpha = (1, 1, 0) \\ \alpha = (1, 0, 1) \\ \alpha = (0, 1, 1) \\ \end{gather}

So the $2$-th order partial derivatives of ff evaluated at point xx are

D(2,0,0)f(x)=∂2f∂x12∂x20∂x30=30x1+7x22x34D(0,2,0)f(x)=∂2f∂x10∂x22∂x30=5x13+14x34D(0,0,2)f(x)=∂2f∂x10∂x20∂x32=5x13+84x22x32D(1,1,0)f(x)=∂2f∂x11∂x21∂x30=15x12+14x2x34D(1,0,1)f(x)=∂2f∂x11∂x20∂x31=15x12+28x22x33D(0,1,1)f(x)=∂2f∂x10∂x21∂x31=5x13+56x2x33\begin{gather} D^{(2, 0, 0)} f(x) = \frac{\partial^{2}f}{\partial x_1^{2} \partial x_2^{0} \partial x_3^{0}} = 30 x_1 + 7 x_2^2 x_3^4\\ D^{(0, 2, 0)} f(x) = \frac{\partial^{2}f}{\partial x_1^{0} \partial x_2^{2} \partial x_3^{0}} = 5 x_1^3 + 14 x_3^4 \\ D^{(0, 0, 2)} f(x) = \frac{\partial^{2}f}{\partial x_1^{0} \partial x_2^{0} \partial x_3^{2}} = 5 x_1^3 + 84 x_2^2 x_3^2 \\ D^{(1, 1, 0)} f(x) = \frac{\partial^{2}f}{\partial x_1^{1} \partial x_2^{1} \partial x_3^{0}} = 15 x_1^2 + 14 x_2 x_3^4 \\ D^{(1, 0, 1)} f(x) = \frac{\partial^{2}f}{\partial x_1^{1} \partial x_2^{0} \partial x_3^{1}} = 15 x_1^2 + 28 x_2^2 x_3^3 \\ D^{(0, 1, 1)} f(x) = \frac{\partial^{2}f}{\partial x_1^{0} \partial x_2^{1} \partial x_3^{1}} = 5 x_1^3 + 56 x_2 x_3^3 \\ \end{gather}

Quadratic Multivariate Taylor Theorem

Let f:Rn→Rf: \mathbb{R}^n \rightarrow \mathbb{R} be a $2$-times differentiable function at the point a∈Rna \in \mathbb{R}^n. Using the Lagrange form of the remainder, there exists t∈(0,1)t \in (0, 1) such that

f(x)=f(a)+∇f(a)⊤(x−a)+12(x−a)⊤H(a+t(x−a))(x−a)\begin{align} f(x) &= f(a) + \nabla f(a)^{\top} (x-a) + \frac{1}{2} (x-a)^{\top} H(a + t(x - a)) (x-a) \\ \end{align}

where ∇f(a)⊤\nabla f(a)^{\top} is a row vector and x−ax - a is a column vector, HH is the Hessian matrix and H(a+t(x−a))H(a + t(x - a)) is the Hessian matrix evaluated at a+t(x−a)a + t(x - a). Concretely,

∇f(a)⊤=[∂f∂x1(a),∂f∂x2(a),⋯ ,∂f∂xn(a)]\nabla f(a)^{\top} = \bigg[ \frac{\partial f}{\partial x_1}(a), \frac{\partial f}{\partial x_2}(a), \cdots, \frac{\partial f}{\partial x_n}(a) \bigg]

and

x−a=[x1−a1,x2−a2,⋯ ,xn−an]⊤x - a = [x_1 - a_1, x_2 - a_2, \cdots, x_n - a_n]^{\top}

General Multivariate Taylor Theorem

Let f:Rn→Rf: \mathbb{R}^n \rightarrow \mathbb{R} be a kk-times differentiable function at the point a∈Rna \in \mathbb{R}^n, we have

f(x)=Pk(x)+Rk(x)\begin{align} f(x) &= P_k(x) + R_k(x) \end{align}

where the kk-th order Taylor polynomial

Pk(x)=∑j=0k1j!∑∣α∣=j(∣α∣α)Dαf(a)(x−a)α=∑j=0k∑∣α∣=j1j!(jα)Dαf(a)(x−a)α=∑j=0k∑∣α∣=jDαf(a)α!(x−a)α=∑0≤∣α∣≤kDαf(a)α!(x−a)α\begin{align} P_k(x) &= \sum_{j = 0}^{k} \frac{1}{j!} \sum_{\lvert \alpha \rvert = j}^{} {\lvert \alpha \rvert \choose \alpha} D^{\alpha}f(a) (x-a)^{\alpha} \\ &= \sum_{j = 0}^{k} \sum_{\lvert \alpha \rvert = j}^{} \frac{1}{j!} {j \choose \alpha} D^{\alpha}f(a) (x-a)^{\alpha} \\ &= \sum_{j = 0}^{k} \sum_{\lvert \alpha \rvert = j}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \\ &= \sum_{0 \leq \lvert \alpha \rvert \leq k}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \\ \end{align}

and the Peano form of the remainder

Rk(x)=∑∣α∣=khα(x)(x−a)α,lim⁡x→ahα(x)=0R_k(x) = \sum_{\lvert \alpha \rvert = k}^{} h_{\alpha}(x) (x-a)^{\alpha}, \quad \lim_{x \rightarrow a} h_{\alpha}(x) = 0

where hα:Rn→Rh_{\alpha}: \mathbb{R}^n \rightarrow \mathbb{R}. So instead of having one single hh in the univariate case, here we have multiple different hh, each for one α\alpha whose ∣α∣=k\lvert \alpha \rvert = k.

For example, assume n=3n = 3 and k=2k = 2, for the $2$-th order Taylor polynomial,

P2(x)=∑0≤∣α∣≤2Dαf(a)α!(x−a)α=(∑∣α∣=0Dαf(a)α!(x−a)α)+(∑∣α∣=1Dαf(a)α!(x−a)α)+(∑∣α∣=2Dαf(a)α!(x−a)α)=f(a)+D(1,0,0)f(a)(1,0,0)!(x−a)(1,0,0)+D(0,1,0)f(a)(0,1,0)!(x−a)(0,1,0)+D(0,0,1)f(a)(0,0,1)!(x−a)(0,0,1)+D(2,0,0)f(a)(2,0,0)!(x−a)(2,0,0)+D(2,0,0)f(a)(2,0,0)!(x−a)(2,0,0)+D(0,0,2)f(a)(0,0,2)!(x−a)(0,0,2)+D(1,1,0)f(a)(1,1,0)!(x−a)(1,1,0)+D(1,0,1)f(a)(1,0,1)!(x−a)(1,0,1)+D(0,1,1)f(a)(0,1,1)!(x−a)(0,1,1)\begin{align} P_2(x) &= \sum_{0 \leq \lvert \alpha \rvert \leq 2}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \\ &= \Bigg( \sum_{\lvert \alpha \rvert = 0}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \Bigg) + \Bigg( \sum_{\lvert \alpha \rvert = 1}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \Bigg) \\ &\quad + \Bigg( \sum_{\lvert \alpha \rvert = 2}^{} \frac{D^{\alpha}f(a)}{\alpha !} (x-a)^{\alpha} \Bigg) \\ &= f(a) + \frac{D^{(1,0,0)}f(a)}{(1,0,0) !} (x-a)^{(1,0,0)} + \frac{D^{(0,1,0)}f(a)}{(0,1,0) !} (x-a)^{(0,1,0)} \\ &\quad + \frac{D^{(0,0,1)}f(a)}{(0,0,1) !} (x-a)^{(0,0,1)} + \frac{D^{(2,0,0)}f(a)}{(2,0,0) !} (x-a)^{(2,0,0)} \\ &\quad + \frac{D^{(2,0,0)}f(a)}{(2,0,0) !} (x-a)^{(2,0,0)} + \frac{D^{(0,0,2)}f(a)}{(0,0,2) !} (x-a)^{(0,0,2)} \\ &\quad + \frac{D^{(1,1,0)}f(a)}{(1,1,0) !} (x-a)^{(1,1,0)} + \frac{D^{(1,0,1)}f(a)}{(1,0,1) !} (x-a)^{(1,0,1)} \\ &\quad + \frac{D^{(0,1,1)}f(a)}{(0,1,1) !} (x-a)^{(0,1,1)} \\ \end{align}

Each of the term could be expanded using the multi-index notation and the kk-th order partial derivatives.

For the Peano form of the remainder,

R2(x)=∑∣α∣=2hα(x)(x−a)α=h(2,0,0)(x)(x−a)(2,0,0)+h(0,2,0)(x)(x−a)(0,2,0)+h(0,0,2)(x)(x−a)(0,0,2)+h(1,1,0)(x)(x−a)(1,1,0)+h(1,0,1)(x)(x−a)(1,0,1)+h(0,1,1)(x)(x−a)(0,1,1)\begin{align} R_2(x) &= \sum_{\lvert \alpha \rvert = 2}^{} h_{\alpha}(x) (x-a)^{\alpha} \\ &= h_{(2,0,0)}(x) (x-a)^{(2,0,0)} + h_{(0,2,0)}(x) (x-a)^{(0,2,0)} + h_{(0,0,2)}(x) (x-a)^{(0,0,2)} \\ &\quad + h_{(1,1,0)}(x) (x-a)^{(1,1,0)} + h_{(1,0,1)}(x) (x-a)^{(1,0,1)} + h_{(0,1,1)}(x) (x-a)^{(0,1,1)} \\ \end{align}

References