Taylor series of single-variable and multi-variable functions

The Taylor series is a way to express a function as an infinite sum of terms, each of which is derived from the function’s derivative value at a specific point \(a\).

Consider the power series \(f(x)=c_0+c_1(x-a)+c_2(x-a)^2+\cdots+c_n(x-a)^n\). We have \(f(a)=c_0\), \(f^{\prime}(a)=c_1\), \(f^{\prime}^{\prime}(a)=2c_2\), \(f^{\prime}^{\prime}^{\prime}(a)=6c_3\) and so on. Therefore,

$$f(x)=f(a)+\frac{f^{\prime}(a)}{1!}(x-a)+\frac{f^{\prime}^{\prime}(a)}{2!}(x-a)^2+\cdots+\frac{f^n(a)}{n!}(x-a)^n\;\;\;\;\;\;\;\;32b$$

Eq32b is called a Taylor series, which approximates a function in the neighbourhood of the point \(a\). When \(a=0\), the Taylor series is also known as a Maclaurin series:

$$f(x)=f(0)+\frac{f^{\prime}(0)}{1!}x+\frac{f^{\prime}^{\prime}(0)}{2!}x^2+\cdots+\frac{f^n(0)}{n!}x^n$$

The input value \(x\) of \(f\) in eq32b represents points in the domain of \(f\) that are near \(a\). In other words, we can express \(f(x)\) as \(f(a+t(x-a))\), where \(a\) is a constant, \(t\) is a variable, and \(x-a\) represents a small change in \(a\) that is scaled by \(t\). This alternate expression of \(f\) is useful when dealing with multiple-variable functions.

For a multivariable function \(f(x_1,x_2,\cdots,x_n)\), the Taylor series about the point \((a_1,a_2,\cdots,a_n)\) is

$$\begin{align*}f(x_1,x_2,\cdots,x_n)&=f(a_1,a_2,\cdots,a_n)+\sum_{i=1}^n\frac{\partial f(a_1,a_2,\cdots,a_n)}{\partial x_i}(x_i-a_i)\\&+\frac{1}{2!}\frac{\partial^2 f(a_1,a_2,\cdots,a_n)}{\partial x_i\partial x_j}(x_i-a_i)(x_j-a_j)+\cdots\;\;\;\;\;\;\;\;32c\end{align*}$$

 

Question

How do we use vector notation to express the function \(f(x_1,x_2,\cdots,x_n)=c_1x_1+c_2x_2+\cdots+c_nx_n\)?

Answer

If we let \(\hat{x}=(x_1,x_2,\cdots,x_n)\), then we write \(f(\hat{x})\) in place of \(f(x_1,x_2,\cdots,x_n)\). In other words, we have \(f(\hat{x})=\hat{c}\cdot\hat{x}\), where \(\hat{c}=(c_1,c_2,\cdots,c_n)\). Consequently, \(f\) can be regarded as

    1. a function of \(n\) variables \(x_1,x_2,\cdots,x_n\),
    2. a function of a single point variable \((x_1,x_2,\cdots,x_n)\), or
    3. a function of a single vector variable \(\hat{x}\).

 

To derive eq32c, let \(\hat{x}=(x_1,x_2,\cdots,x_n)\) and \(\hat{a}=(a_1,a_2,\cdots,a_n)\). Consider the function

$$g(t)=f(\hat{b}=\hat{a}+t(\hat{x}-\hat{a}))\;\;\;\;\;\;\;\;32d$$

which implies that \(\hat{b}=(x_1,x_2,\cdots,x_n)\).

\(f(\hat{a}+t(\hat{x}-\hat{a}))\) is a multivariable function, whose input is the vector \(\hat{a}+t(\hat{x}-\hat{a})\), which varies with \(t\). In the domain of \(f(x_1,x_2,\cdots,x_n)\), \(\hat{a}\) is the vector representing a point where \(f\) is expanded, and \((\hat{x}-\hat{a})\) is a fixed vector that determines the direction of the displacement from the point \(\hat{a}\). In other words, \((\hat{x}-\hat{a})\) is not a variable of \(g(t)\), but a parameter that we choose before plotting \(g(t)\). The function \(g(t)\) is therefore a single variable function of \(t\), and its points are of the form \((t,g(t))\).

The Maclaurin series expansion of \(g(t)\) when \(t=1\) is

$$g(1)=g(0)+\frac{g^{\prime}(0)}{1!}+\frac{g^{\prime}^{\prime}(0)}{2!}+\cdots\;\;\;\;\;\;\;\;32e$$

According to the multivariable chain rule, \(\small{\frac{df(\hat{b})}{dt}=\frac{\partial f(\hat{b})}{\partial x_1}\frac{dx_1}{dt}+\frac{\partial f(\hat{b})}{\partial x_2}\frac{dx_2}{dt}+\cdots+\frac{\partial f(\hat{b})}{\partial x_n}\frac{dx_n}{dt}=\nabla f(\hat{b})\cdot\frac{d\hat{x}}{dt}}\), where \(\small{\nabla=\boldsymbol{i}\frac{\partial}{\partial x_1}+\boldsymbol{j}\frac{\partial}{\partial x_2}+\cdots+\boldsymbol{k}\frac{\partial}{\partial x_n}}\) and \(\hat{x}=\boldsymbol{i}x_1+\boldsymbol{j}x_2+\cdots+\boldsymbol{k}x_n\). So,

$$g^{\prime}(t)=\nabla f(\hat{b})\cdot\frac{d\hat{x}}{dt}=\cdots=\sum_{i=1}^n\frac{\partial f(\hat{b})}{\partial x_i}(x_i-a_i)\;\;\;\;\;\;\;\;32f$$

The second derivative \(g^{\prime}^{\prime}(t)=f^{\prime}^{\prime}(\hat{b})\) is

$$g^{\prime}^{\prime}(t)=\frac{d^2f(\hat{b})}{dt^2}=\frac{d}{dt}\biggr[\frac{\partial f(\hat{b})}{\partial x_1}\frac{dx_1}{dt}+\frac{\partial f(\hat{b})}{\partial x_2}\frac{dx_2}{dt}+\cdots+\frac{\partial f(\hat{b})}{\partial x_n}\frac{dx_n}{dt}\biggr]$$

Using the multivariable chain rule again, we get

$$g^{\prime}^{\prime}(t)=\frac{d^2f(\hat{b})}{dt^2}=\sum_{i,j=1}^n\frac{\partial^2 f(\hat{b})}{\partial x_i\partial x_j}\frac{dx_i}{dt}\frac{dx_j}{dt}+\sum_{k=1}^n\frac{\partial f(\hat{b})}{\partial x_k}\frac{d^2x_k}{dt^2}\;\;\;\;\;\;\;\;32g$$

With reference to eq32d, \(\hat{b}=\hat{a}+t(\hat{x}-\hat{a})\) with components \(x_i=a_i+t(x_i-a_i)\). It follows that \(\frac{dx_i}{dt}=x_i-a_i\), \(\frac{dx_j}{dt}=x_j-a_j\) and \(\frac{d^2x_k}{dt^2}=0\). Eq32g becomes

$$g^{\prime}^{\prime}(t)=\frac{d^2f(\hat{b})}{dt^2}=\sum_{i,j=1}^n\frac{\partial^2 f(\hat{b})}{\partial x_i\partial x_j}(x_i-a_i)(x_j-a_j)\;\;\;\;\;\;\;\;32h$$

Furthermore, when \(t=0\), we have \(\hat{b}=\hat{a}\). So, eq32f and eq32h become

$$g^{\prime}(0)=\sum_{i=1}^n\frac{\partial f(\hat{a})}{\partial x_i}(x_i-a_i)\;\;\;\;\;\;\;\;32i$$

and

$$g^{\prime}^{\prime}(0)=\sum_{i,j=1}^n\frac{\partial^2 f(\hat{a})}{\partial x_i\partial x_j}(x_i-a_i)(x_j-a_j)\;\;\;\;\;\;\;\;32j$$

respectively.

Substituting eq32i and eq32j in eq32e and noting that \(g(0)=f(\hat{a})\) and \(g(1)=f(\hat{x})\), we have eq32c. Finally, the Maclaurin series of a multivariable function is

$$\begin{align*}f(x_1,x_2,\cdots,x_n)&=f(a_1=0,a_2=0,\cdots,a_n=0)\\&+\sum_{i=1}^n\frac{\partial f(a_1=0,a_2=0,\cdots,a_n=0)}{\partial x_i}x_i\\&+\frac{1}{2!}\frac{\partial^2 f(a_1=0,a_2=0,\cdots,a_n=0)}{\partial x_i\partial x_j}x_ix_j\\&+\cdots\;\;\;\;\;\;\;\;32k\end{align*}$$

 

Question

Can \(x\) in the Taylor series expansion \(e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots\) be a square matrix \(A\)?

Answer

Yes. The expansion is an infinite polynomial and a polynomial does not care whether its input is a number or a matrix. It only requires that the input supports addition, multiplication, scalar multiplication, and has an identity element. Square matrices satisfy all of these properties, so we can replace the number \(x\) by a square matrix \(A\). The resulting power series converges, so the matrix exponential is well defined. For example, if \(A=\begin{pmatrix}0&1\\0&0\end{pmatrix}\), then \(A^2=\begin{pmatrix}0&0\\0&0\end{pmatrix}=A^3=A^4=\cdots\). Hence,

$$e^A=I+A+\frac{A^2}{2!}+\frac{A^3}{3!}+\cdots=I+A$$

where \(A^0=I\) to satisfy \(A^mA^0=A^{m+0}=A^m\).

The Taylor series involving the exponential of a matrix is used to derive the matrix representation of the SU(2) group.

 

Next article: Generating function and Rodrigues’ formula for the Hermite polynomials
Previous article: Recurrence relations of the Hermite polynomials
Content page of vibrational spectroscopy
Content page of advanced chemistry
Main content page

Leave a Reply

Your email address will not be published. Required fields are marked *

Mono Quiz