# 矩陣指數
Matrix exponential

This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
$\newcommand{\trans}{^\top}
\newcommand{\adj}{^{\rm adj}}
\newcommand{\cof}{^{\rm cof}}
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\dunion}{\mathbin{\dot\cup}}
\newcommand{\bzero}{\mathbf{0}}
\newcommand{\bone}{\mathbf{1}}
\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bd}{\mathbf{d}}
\newcommand{\be}{\mathbf{e}}
\newcommand{\bh}{\mathbf{h}}
\newcommand{\bp}{\mathbf{p}}
\newcommand{\bq}{\mathbf{q}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}
\newcommand{\bw}{\mathbf{w}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\nul}{\operatorname{null}}
\newcommand{\rank}{\operatorname{rank}}
%\newcommand{\ker}{\operatorname{ker}}
\newcommand{\range}{\operatorname{range}}
\newcommand{\Col}{\operatorname{Col}}
\newcommand{\Row}{\operatorname{Row}}
\newcommand{\spec}{\operatorname{spec}}
\newcommand{\vspan}{\operatorname{span}}
\newcommand{\Vol}{\operatorname{Vol}}
\newcommand{\sgn}{\operatorname{sgn}}
\newcommand{\idmap}{\operatorname{id}}
\newcommand{\am}{\operatorname{am}}
\newcommand{\gm}{\operatorname{gm}}
\newcommand{\mult}{\operatorname{mult}}
\newcommand{\iner}{\operatorname{iner}}$
```python
from lingeo import random_int_list
```
## Main idea
We know the exponential function can be written as
$$
e^x = \frac{1}{0!} + \frac{1}{1!}x + \frac{1}{2!}x^2 + \cdots.
$$
In a similar way, the **matrix exponential** of a square matrix $A$ is defined as
$$
e^A = \frac{1}{0!}I + \frac{1}{1!}A + \frac{1}{2!}A^2 + \cdots.
$$
The computation of the matrix exponential can be a tedious work, at least by hand.
However, when $D$ is a diagonal matrix, its matrix exponential can be easily obtained by
$$
\begin{aligned}
e^D &= \frac{1}{0!}I + \frac{1}{1!}D + \frac{1}{2!}D^2 + \cdots \\
&=
\frac{1}{0!}
\begin{bmatrix}
1 & ~ & ~ \\
~ & \ddots & ~ \\
~ & ~ & 1
\end{bmatrix}
+
\frac{1}{1!}
\begin{bmatrix}
\lambda_1 & ~ & ~ \\
~ & \ddots & ~ \\
~ & ~ & \lambda_n
\end{bmatrix}
+
\frac{1}{2!}
\begin{bmatrix}
\lambda_1^2 & ~ & ~ \\
~ & \ddots & ~ \\
~ & ~ & \lambda_n^2
\end{bmatrix}
+ \cdots \\
&=
\begin{bmatrix}
\frac{1}{0!} + \frac{1}{1!}\lambda_1 + \frac{1}{2!}\lambda_1^2 + \cdots & ~ & ~ \\
~ & \ddots & ~ \\
~ & ~ & \frac{1}{0!} + \frac{1}{1!}\lambda_n + \frac{1}{2!}\lambda_n^2 + \cdots
\end{bmatrix} \\
&=
\begin{bmatrix}
e^{\lambda_1} & ~ & ~ \\
~ & \ddots & ~ \\
~ & ~ & e^{\lambda_n}
\end{bmatrix}.
\end{aligned}
$$
Moreover, suppose $A$ is diagonalizable as $D = Q^{-1}AQ$ and $A = QDQ^{-1}$.
Then the matrix exponential can be computed as
$$
\begin{aligned}
e^A &= \frac{1}{0!}I + \frac{1}{1!}A + \frac{1}{2!}A^2 + \cdots \\
&= \frac{1}{0!}I + \frac{1}{1!}QAQ^{-1} + \frac{1}{2!}QA^2Q^{-1} + \cdots \\
&= Q\left(\frac{1}{0!}I + \frac{1}{1!}D + \frac{1}{2!}D^2 + \cdots \right)Q^{-1} \\
&= Qe^DQ^{-1}.
\end{aligned}
$$
## Side stories
- Taylor expansion
- Cayley transform
- solution to $\dot{\bx} = A\bx$
## Experiments
##### Exercise 1
執行以下程式碼。
令 $s_k = \sum_{r = 0}^k \frac{1}{r!}A^r$ 為計算 $e^A$ 時的部份和。
定義 $\|B - C\|^2$ 為 $B - C$ 矩陣各項的平方和。
<!-- eng start -->
Run the code below. Let $s_k = \sum_{r = 0}^k \frac{1}{r!}A^r$ be the partial sum of $e^A$. Define $\|B - C\|^2$ as the square sum of entries of $B - C$.
<!-- eng end -->
```python
### code
set_random_seed(0)
print_ans = False
n = 2
A = matrix(n, random_int_list(n^2, 3))
pretty_print(LatexExpr("A ="), A)
tk = [identity_matrix(n), A]
for k in range(2,16):
tk.append(tk[-1] * A / k)
sk = tk[:1]
for k in range(1,16):
sk.append(sk[-1] + tk[k])
pretty_print(LatexExpr("s_{5} ="), N(sk[5]))
pretty_print(LatexExpr("s_{10} ="), N(sk[10]))
pretty_print(LatexExpr("s_{15} ="), N(sk[15]))
if print_ans:
print("| s5 - s10 |^2 =", (sk[5] - sk[10]).norm("frob"))
print("| s10 - s15 |^2 =", (sk[10] - sk[15]).norm("frob"))
```
By setting `seed=0`.
$A=\begin{bmatrix}-3&3\\1&2\end{bmatrix}.$
$s_5=\begin{bmatrix}
-0.525000000000000 & 6.85000000000000 \\
2.28333333333333 & 10.8916666666667\end{bmatrix}.$
$s_{10}=\begin{bmatrix}
1.17567708333333 & 6.23704613095238 \\
2.07901537698413 & 11.5707539682540\end{bmatrix}.$
$s_{15}=\begin{bmatrix}
1.15645523757869 & 6.24794131648453 \\
2.08264710549484 & 11.5696907650529\end{bmatrix}.$
---
##### Exercise 1(a)
計算 $\|s_5 - s_{10}\|^2$。
<!-- eng start -->
Find 計算 $\|s_5 - s_{10}\|^2$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
$$
\|s_5 -s_{10}\|^2=
\left\|\begin{bmatrix}
-1.70067708333333 &0.612953869047620 \\
0.204317956349200 &-0.679087301587300
\end{bmatrix}\right\|^2=3.77092037781944
$$
---
##### Exercise 1(b)
計算 $\|s_{10} - s_{15}\|^2$。
<!-- eng start -->
Find 計算 $\|s_{10} - s_{15}\|^2$.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
$$
\|s_{10} -s_{15}\|^2=
\left\|\begin{bmatrix}
0.0192218457546400 & -0.0108951855321502 \\
-0.00363172851070992 & 0.00106320320109887
\end{bmatrix}\right\|^2=0.000502504275017477
$$
---
##### Remark
在高等微積分會學到,在一個完備的空間裡
(像是 $\mathbb{R}$ 或是 $\mathbb{R}^n$ 或是跟矩陣長很像的 $\mathbb{R}^{n^2}$),
如果一個數列有 $\| s_n - s_m \|$ 隨著 $n,m$ 變大而距離愈來愈小,
則 $\{s_n\}$ 數列會收斂。
<!-- eng start -->
In the future analysis courses, we will learn that in a complete space (such as $\mathbb{R}$, $\mathbb{R}^n$, or $\mathbb{R}^{n^2}$, which has a similar stucture as matrices), any sequence $\{s_n\}$ with $\| s_n - s_m \|$ going to zero as $n,m$ goes to infinity will converge.
<!-- eng end -->
:::info
What do the experiments try to tell you? (open answer)
...
:::
##### <font color="#f00">**Answer:**</font>
How to compute $e^A$ and as the remark mentioned.
---
## Exercises
##### Exercise 2
令 $O_n$ 為 $n\times n$ 的零矩陣,用定義計算 $e^{O_n}$。
<!-- eng start -->
Let $O_n$ be the $n\times n$ zero matrix. Find $e^{O_n}$ by definition.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
$e^{O_n}=
\frac{1}{0!}\mathit{I}_n + \frac{1}{1!}O_n + \frac{1}{2!} {O_n}^2+
\cdots = \mathit{I}_n.$
Thus, $e^{O_n}=\mathit{I}_n$, no matter what $n$ is.
---
##### Exercise 3
令
$$
A = \begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}.
$$
依照以下步驟求出 $e^{tA}$,其中 $t$ 是變數。
<!-- eng start -->
Let
$$
A = \begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}.
$$
Use the given instructions to find $e^{tA}$, where $t$ is a variable.
<!-- eng end -->
##### Exercise 3(a)
計算 $A, A^2, A^3, A^4$ 並找出 $A^n$ 的規律。
<!-- eng start -->
Find $A, A^2, A^3, A^4$. Then find a pattern of $A^n$.
<!-- eng end -->
##### <font color="#f00">**Answer :**</font>
##### <font color="#00A800">**part(a) :**</font>
By calculation,
$A = \begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix},\space
A^2 = \begin{bmatrix}
-1 & 0 \\
0 & -1
\end{bmatrix},\space
A^3 = \begin{bmatrix}
0 & 1 \\
-1 & 0
\end{bmatrix},\space
A^4 = \begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix} = \mathit{I}_2.$
##### <font color="#00A800">**part(b) :**</font>
From the pattern of $A$ ~ $A^4$, we find that
1. If $n = 4k+1$, $k \in \mathbb{N}$.
Then $A^n = \begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}.$
2. If $n = 4k+2$, $k \in \mathbb{N}$.
Then $A^n = \begin{bmatrix}
-1 & 0 \\
0 & -1
\end{bmatrix}.$
3. If $n = 4k+3$, $k \in \mathbb{N}$.
Then $A^n = \begin{bmatrix}
0 & 1 \\
-1 & 0
\end{bmatrix}.$
4. If $n = 4k$, $k \in \mathbb{N}$.
Then $A^n = \begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix} = \mathit{I}_2.$
---
##### Exercise 3(b)
利用定義求出 $e^{tA}$,並解釋 $t$ 在旋轉矩陣中扮演的角色。
<!-- eng start -->
Find $e^{tA}$ by definition. Then explain what is the geometric meaning of $t$.
<!-- eng end -->
##### <font color="#f00">**Answer :**</font>
From the definition of $e^{A}$ and the result of 3(a), we are able to orginize $e^{tA}$ to the folowing form,
$\displaystyle e^{tA}
=
\frac{1}{0!}I +
\frac{1}{1!}{tA} +
\frac{1}{2!}t^2A^2 +
\cdots$
$= \begin{bmatrix}
\frac{1}{0!} -
\frac{1}{2!}t^2 +
\frac{1}{4!}t^4 -
\cdots
& -\frac{1}{1!}t +
\frac{1}{3!}t^3 -
\frac{1}{5!}t^5 +
\cdots
\\
\frac{1}{1!}t -
\frac{1}{3!}t^3 +
\frac{1}{5!}t^5 -
\cdots
& \frac{1}{0!} -
\frac{1}{2!}t^2 +
\frac{1}{4!}t^4 -
\cdots
\end{bmatrix}
=
\begin{bmatrix}
\sum_{n = 0}^\infty
\frac{{(-1)}^n}{2n!}t^{2n}
&
\sum_{n = 0}^\infty
\frac{{(-1)}^n+1}{2n+1!}t^{2n+1}
\\
\sum_{n = 0}^\infty
\frac{{(-1)}^n}{2n+1!}t^{2n+1}
&
\sum_{n = 0}^\infty
\frac{{(-1)}^n}{2n!}t^{2n}
\end{bmatrix}
=
\begin{bmatrix}
\cos t & -\sin t \\
\sin t & \cos t
\end{bmatrix}.$
By observation, $e^{tA}$ is a rotation matrix, and $t$ is the the angle of rotation.
---
##### Exercise 4
對以下矩陣 $A$ 求出 $e^A$。
<!-- eng start -->
For the following matrices $A$, find $e^A$.
<!-- eng end -->
##### Exercise 4(a)
已知
$$
\begin{bmatrix}
4 & 0 \\
0 & 6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
4 & 0 \\
0 & 6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
4 & 0 \\
0 & 6
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
e^4 & 0 \\
0 & e^6
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{e^4+e^6}{2} & \frac{e^4-e^6}{2} \\
\frac{e^4-e^6}{2} & \frac{e^4+e^6}{2} \\
\end{bmatrix} .
$$
---
##### Exercise 4(b)
已知
$$
\begin{bmatrix}
4 & 0 \\
0 & -6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
4 & 0 \\
0 & -6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
-1 & 5 \\
5 & -1
\end{bmatrix}=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
4 & 0 \\
0 & -6
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
e^4 & 0 \\
0 & e^{-6}
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{e^4+e^{-6}}{2} & \frac{e^4-e^{-6}}{2} \\
\frac{e^4-e^{-6}}{2} & \frac{e^4+e^{-6}}{2} \\
\end{bmatrix} .
$$
---
##### Exercise 4(c)
已知
$$
\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}
\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
2 & 0 \\
0 & 0
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}
\begin{bmatrix}
e^2 & 0 \\
0 & e^0
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{e^2+1}{2} & \frac{e^2-1}{2} \\
\frac{e^2-1}{2} & \frac{e^2+1}{2} \\
\end{bmatrix} .
$$
---
##### Exercise 5
對以下矩陣 $A$ 求出 $e^A$。
<!-- eng start -->
For the following matrices $A$, find $e^A$.
<!-- eng end -->
##### Exercise 5(a)
已知
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
4 & 0 & -1 \\
0 & 4 & -1 \\
-1 & -1 & 5
\end{bmatrix}=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & 6
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}
\begin{bmatrix}
e^{3} & 0 & 0 \\
0 & e^{4} & 0 \\
0 & 0 & e^{6}
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{2e^3+3e^4+e^6}{6} & \frac{2e^3-3e^4+e^6}{6} & \frac{e^3-e^6}{3} \\
\frac{2e^3-3e^4+e^6}{6} & \frac{2e^3+3e^4+e^6}{6} & \frac{e^3-e^6}{3} \\
\frac{e^3-e^6}{3} & \frac{e^3-e^6}{3} & \frac{e^3+2e^6}{3} \\
\end{bmatrix} .
$$
---
##### Exercise 5(b)
已知
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & -6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & -6
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
2 & -2 & 3 \\
-2 & 2 & 3 \\
3 & 3 & -3
\end{bmatrix}=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}
\begin{bmatrix}
3 & 0 & 0 \\
0 & 4 & 0 \\
0 & 0 & -6
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}
\begin{bmatrix}
e^{3} & 0 & 0 \\
0 & e^{4} & 0 \\
0 & 0 & e^{-6}
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 1 \\
1 & -1 & 1 \\
1 & 0 & -2
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{2e^3+3e^4+e^{-6}}{6} & \frac{2e^3-3e^4+e^{-6}}{6} & \frac{e^3-e^{-6}}{3} \\
\frac{2e^3-3e^4+e^{-6}}{6} & \frac{2e^3+3e^4+e^{-6}}{6} & \frac{e^3-e^{-6}}{3} \\
\frac{e^3-e^{-6}}{3} & \frac{e^3-e^{-6}}{3} & \frac{e^3+2e^{-6}}{3} \\
\end{bmatrix} .
$$
---
##### Exercise 6
對以下矩陣 $A$ 求出 $e^A$。
<!-- eng start -->
For the following matrices $A$, find $e^A$.
<!-- eng end -->
##### Exercise 6(a)
已知
$$
\begin{bmatrix}
2 & 0 \\
0 & 3
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-6 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
0 & 1 \\
-6 & 5
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
2 & 0 \\
0 & 3
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-6 & 5
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
0 & 1 \\
-6 & 5
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
0 & 1 \\
-6 & 5
\end{bmatrix}=
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}
\begin{bmatrix}
2 & 0 \\
0 & 3
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}
\begin{bmatrix}
e^2 & 0 \\
0 & e^3
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
3 & 2
\end{bmatrix}^{-1}=
\begin{bmatrix}
-2e^2+3e^3 & e^2-e^3 \\
-6e^2+6e^3 & 3e^2-2e^3 \\
\end{bmatrix} .
$$
---
##### Exercise 6(b)
已知
$$
\begin{bmatrix}
2 & 0 \\
0 & -2
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-4 & 0
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
0 & 1 \\
-4 & 0
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
2 & 0 \\
0 & -2
\end{bmatrix}
=
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-4 & 0
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
0 & 1 \\
-4 & 0
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Known from the given diagonal matrix equation:
$$
A=
\begin{bmatrix}
0 & 1 \\
-4 & 0
\end{bmatrix}=
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}
\begin{bmatrix}
2 & 0 \\
0 & -2
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}^{-1}.
$$
Let $Q=
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}$
and we apply $e^A=Qe^DQ^{-1}$
$$
e^A=
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}
\begin{bmatrix}
e^2 & 0 \\
0 & e^{-2}
\end{bmatrix}
\begin{bmatrix}
1 & 1 \\
2 & -2
\end{bmatrix}^{-1}=
\begin{bmatrix}
\frac{e^4+1}{2e^2} & \frac{e^4-1}{4e^2} \\
\frac{e^4-1}{e^2} & \frac{e^4+1}{2e^2} \\
\end{bmatrix} .
$$
---
##### Exercise 6(c)
已知
$$
\begin{bmatrix}
2 & 1 \\
0 & 2
\end{bmatrix}
=
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-4 & 4
\end{bmatrix}
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
0 & 1 \\
-4 & 4
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
2 & 1 \\
0 & 2
\end{bmatrix}
=
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-4 & 4
\end{bmatrix}
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
0 & 1 \\
-4 & 4
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Notice that this is a **Jordan block**, and it has following chacteristic:
If
$$
B=
P\begin{bmatrix}
\lambda & 1 \\
0 & \lambda
\end{bmatrix}P^{-1},
$$
then
$$
B^n=
\begin{bmatrix}
\lambda^n & n\lambda^{n-1} \\
0 & \lambda^n
\end{bmatrix}.
$$
Therefore we know
$$
e^B=P^{-1}(\sum_{n=0}^{\infty} \frac{1}{n!}
\begin{bmatrix}
\lambda^n & n\lambda^{n-1} \\
0 & \lambda^n
\end{bmatrix})P
=P
\begin{bmatrix}
e^\lambda & e^\lambda \\
0 & e^\lambda
\end{bmatrix}P^{-1}.
$$
Let $Q=
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}$, and apply this formula to get
$$
e^A=
Qe^DQ^{-1}=
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}
\begin{bmatrix}
e^2 & e^2 \\
0 & e^2
\end{bmatrix}
\begin{bmatrix}
2 & -1 \\
4 & 0
\end{bmatrix}^{-1}=
\begin{bmatrix}
-e^2 & e^2 \\
-4e^2 & 3e^2
\end{bmatrix}.
$$
:::success
Well done!
:warning: There are typos, where $e^n$ should be $e^\lambda$.
:::
---
##### Exercise 6(d)
已知
$$
\begin{bmatrix}
3 & 1 \\
0 & 3
\end{bmatrix}
=
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-9 & 6
\end{bmatrix}
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}.
$$
令
$$
A = \begin{bmatrix}
0 & 1 \\
-9 & 6
\end{bmatrix}.
$$
<!-- eng start -->
It is known that
$$
\begin{bmatrix}
3 & 1 \\
0 & 3
\end{bmatrix}
=
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}^{-1}
\begin{bmatrix}
0 & 1 \\
-9 & 6
\end{bmatrix}
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}.
$$
Let
$$
A = \begin{bmatrix}
0 & 1 \\
-9 & 6
\end{bmatrix}.
$$
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
Similar as last question.
Let $Q=
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}$, and apply this formula to get
$$
e^A=
Qe^DQ^{-1}=
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}
\begin{bmatrix}
e^3 & e^3 \\
0 & e^3
\end{bmatrix}
\begin{bmatrix}
3 & -1 \\
9 & 0
\end{bmatrix}^{-1}=
\begin{bmatrix}
-2e^3 & e^3 \\
-9e^3 & 4e^3
\end{bmatrix}.
$$
---
##### Exercise 7
經由以下步驟說明 $\dot{\bx} = A\bx$ 的解就是 $e^{tA}\bc$,
其中 $\bc = (c_1,\ldots, c_n)$ 是一個控制常數的向量。
<!-- eng start -->
Use the given instructions to show that $e^{tA}\bc$ represents all the solutions of the equation $\dot{\bx} = A\bx$, where $\bc = (c_1,\ldots, c_n)$ is a vector of constant terms.
<!-- eng end -->
##### Exercise 7(a)
若 $A$ 可被對角化為 $D = Q^{-1}AQ$。
令 $Q\by = \bx$。
首先說明 $\dot{\by} = D\by$ 的解就是 $e^{Dt}\bd$,
其中 $\bd = (d_1,\ldots, d_n)$ 可以是任何常數。
<!-- eng start -->
Suppose $A$ is diagonalizable and has $D = Q^{-1}AQ$ for some diagonal matrix $D$. Let $Q\by = \bx$. First, show that $e^{Dt}\bd$ represents all the solutions of the equation $\dot{\by} = D\by$, where $\bd = (d_1,\ldots, d_n)$ is a vector of constant terms.
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
---
##### Exercise 7(b)
藉由 $\bx = Q^{-1}\by$ 來得到 $\bx = e^{tA}\bc$,
其中 $\bc = Q\bd$ 是一組獨立的常數(因為 $Q$ 可逆)。
<!-- eng start -->
Let $\bx = Q^{-1}\by$. Explain why $\bx = e^{tA}\bc$ represents all the solutions to the equation, where $\bc = Q\bd$ is composed of independent constants (since $Q$ is invertible).
<!-- eng end -->
##### <font color="#f00">**Answer:**</font>
---
##### Remark
如果 $A$ 不可對角化則必須仰賴喬丹標準型,但 $e^{tA}\bc$ 這個公式還是正確的。
<!-- eng start -->
If $A$ is not diagonalizable, then we need to find the Jordan canonical form of $A$, but the formula $e^{tA}\bc$ is still the general solution.
<!-- eng end -->
:::info
Excellent!
collaboration: 2
3 problems: 3
- done: 2, 3a, 3b
extra: 4.5
- done: 4abc, 5ab, 6abcd
moderator: 1
qc: 1
:::