## 2019年8月15日木曜日

### 数学 - Python - 線形代数学 - 多項式と行列 - 特性多項式 - 複素固有値と固有ベクトル、因数分解

ラング線形代数学(下) (ちくま学現文庫)(S.ラング (著)、芹沢 正三 (翻訳)、筑摩書房)の9章(多項式と行列)、4(特性多項式)、練習問題3の解答を求めてみる。

1. 特性多項式。

$\begin{array}{l}f\left(t\right)\\ =\mathrm{det}\left(tI-A\right)\\ =\mathrm{det}\left[\begin{array}{cc}t-1& -i\\ -i& t+2\end{array}\right]\\ ={t}^{2}+t-2+1\\ ={t}^{2}+t-1\end{array}$

固有値。

$\begin{array}{l}{t}^{2}+t-1=0\\ t=\frac{-1±\sqrt{1+4}}{2}\\ =\frac{-1±\sqrt{5}}{2}\end{array}$

それぞれの固有値をもつ固有ベクトル。

$\begin{array}{l}\left\{\begin{array}{l}\left(t-1\right)x-iy=0\\ -ix+\left(t+2\right)y=0\end{array}\\ \frac{-3±\sqrt{5}}{2}x-iy=0\\ \left(2,\left(3\mp \sqrt{5}\right)i\right)\end{array}$

2. $\begin{array}{l}f\left(t\right)\\ =\mathrm{det}\left[\begin{array}{cc}t-1& -i\\ i& t-1\end{array}\right]\\ ={t}^{2}-2t+1-1\\ =t\left(t-2\right)\\ t=0,2\\ \left\{\begin{array}{l}\left(t-1\right)x-iy=0\\ ix+\left(t-1\right)y=0\end{array}\\ t=0\\ \left\{\begin{array}{l}-x-iy=0\\ ix-y=0\end{array}\\ \left(1,i\right)\\ t=2\\ \left\{\begin{array}{l}x-iy=0\\ ix+y=0\end{array}\\ \left(1,-i\right)\end{array}$

3. $\begin{array}{l}f\left(t\right)=\left(t-1\right)\left(t-2\right)\\ t=1,2\\ \left\{\begin{array}{l}\left(t-1\right)x-2iy=0\\ \left(t-2\right)y=0\end{array}\\ t=1\\ \left(1,0\right)\\ t=2\\ x-2iy=0\\ \left(2i,1\right)\end{array}$

4. $\begin{array}{l}f\left(t\right)=\left(t-2\right)\left(t-3\right)-20\\ ={t}^{2}-5t-14\\ =\left(t-7\right)\left(t+2\right)\\ t=-2,7\\ \left\{\begin{array}{l}\left(t-2\right)x-4y=0\\ -5x+\left(t-3\right)y=0\end{array}\\ t=-2\\ \left\{\begin{array}{l}-4x-4y=0\\ -5x-5y=0\end{array}\\ \left(1,1\right)\\ t=7\\ \left\{\begin{array}{l}5x-4y=0\\ -5x+4y=0\end{array}\\ \left(4,5\right)\end{array}$

5. $\begin{array}{l}f\left(t\right)=\left(t-1\right)\left(t+2\right)-4\\ ={t}^{2}+t-6\\ =\left(t+3\right)\left(t-2\right)\\ t=-3,2\\ \left\{\begin{array}{l}\left(t-1\right)x-2y=0\\ -2x+\left(t+2\right)y=0\end{array}\\ t=-3\\ \left\{\begin{array}{l}-4x-2y=0\\ -2x-y=0\end{array}\\ \left(1,-2\right)\\ t=2\\ \left\{\begin{array}{l}x-2y=0\\ -2x+4y=0\end{array}\\ \left(2,1\right)\end{array}$

6. $\begin{array}{l}f\left(t\right)={\left(t-3\right)}^{2}+4\\ ={t}^{2}-6t+13\\ t=3±\sqrt{9-13}\\ =3±2i\\ \left\{\begin{array}{l}\left(t-3\right)x-2y=0\\ 2x+\left(t-3\right)y=0\end{array}\\ t=3+2i\\ \left\{\begin{array}{l}2ix-2y=0\\ 2x+2iy=0\end{array}\\ \left(1,i\right)\\ t=3-2i\\ \left\{\begin{array}{l}-2ix-2y=0\\ 2x-2iy=0\end{array}\\ \left(1,-i\right)\end{array}$

7. $\begin{array}{l}f\left(t\right)\\ =\left(t+1\right)\left(t-2\right)\left(t+6\right)+12+24\\ +\left(t+1\right)12-4\left(t+6\right)+6\left(t-2\right)\\ =\left({t}^{2}-t-2\right)\left(t+6\right)+36+12t+12-4t-24+6t-12\\ ={t}^{3}+5{t}^{2}-8t-12+12+14t\\ ={t}^{3}+5{t}^{2}+6t\\ =t\left({t}^{2}+5t+6\right)\\ =t\left(t+2\right)\left(t+3\right)\\ t=-3,-2,0\\ \left\{\begin{array}{l}\left(t+1\right)x-2y-2z=0\\ -2x+\left(t-2\right)y-2z=0\\ 3x+6y+\left(t+6\right)z=0\end{array}\\ t=-3\\ \left\{\begin{array}{l}-2x-2y-2z=0\\ -2x-5y-2z=0\\ 3x+6y+3z=0\end{array}\\ z=-x-y\\ -3y=0\\ y=0\\ z=-x\\ \left(1,0,-1\right)\\ t=-2\\ \left\{\begin{array}{l}-x-2y-2z=0\\ -2x-4y-2z=0\\ 3x+6y+4z=0\end{array}\\ x=-2y-2z\\ 2z=0\\ z=0\\ x=-2y\\ \left(-2,1,0\right)\\ t=0\\ \left\{\begin{array}{l}x-2y-2z=0\\ -2x-2y-2z=0\\ 3x+6y+6z=0\end{array}\\ x=y+z\\ y+z+2y+2z=0\\ y+z=0\\ \left(0,1,-1\right)\end{array}$

8. $\begin{array}{l}f\left(t\right)\\ =\left(t-3\right)\left(t-1\right)\left(t+1\right)-\left(t-3\right)2\\ =\left(t-3\right)\left({t}^{2}-1-2\right)\\ =\left(t-3\right)\left({t}^{2}-3\right)\\ t=±\sqrt{3},3\\ \left\{\begin{array}{l}\left(t-3\right)x-2y-z=0\\ \left(t-1\right)y-2z=0\\ -y+\left(t+1\right)z=0\end{array}\\ t=-\sqrt{3}\\ \left\{\begin{array}{l}\left(-\sqrt{3}-3\right)x-2y-z=0\\ \left(-\sqrt{3}-1\right)y-2z=0\\ -y+\left(-\sqrt{3}+1\right)z=0\end{array}\\ z=-\frac{\sqrt{3}+1}{2}y\\ \left(-\sqrt{3}-3\right)x-2y+\frac{\sqrt{3}+1}{2}y=0\\ 2\left(-\sqrt{3}-3\right)x-4y+\left(\sqrt{3}+1\right)y=0\\ 2\left(-\sqrt{3}-3\right)x+\left(\sqrt{3}-3\right)y=0\\ x=\frac{\sqrt{3}-3}{2\left(\sqrt{3}+3\right)}y\\ z=-\frac{\sqrt{3}+1}{2}·2\left(\sqrt{3}+3\right)\\ =-\left(\sqrt{3}+1\right)\left(\sqrt{3}+3\right)\\ =-4\sqrt{3}-6\\ =-2\left(\sqrt{3}+1\right)\\ \left(\sqrt{3}-3,2\left(\sqrt{3}+3\right),-2\left(\sqrt{3}+1\right)\right)\\ t=\sqrt{3}\\ \left\{\begin{array}{l}\left(\sqrt{3}-3\right)x-2y-z=0\\ \left(\sqrt{3}-1\right)y-2z=0\\ -y+\left(\sqrt{3}+1\right)z=0\end{array}\\ y=\left(\sqrt{3}+1\right)z\\ \left(\sqrt{3}-3\right)x-2\left(\sqrt{3}+1\right)z-z=0\\ \left(\sqrt{3}-3\right)x+\left(-2\sqrt{3}-3\right)z=0\\ x=\frac{2\sqrt{3}+3}{\sqrt{3}-3}z\\ y=\left(\sqrt{3}+1\right)\left(\sqrt{3}-3\right)\\ =3-3-2\sqrt{3}\\ =-2\sqrt{3}\\ \left(2\sqrt{3}+3,-2\sqrt{3},\sqrt{3}-3\right)\\ t=3\\ \left\{\begin{array}{l}-2y-z=0\\ 2y-2z=0\\ -y+4z=0\end{array}\\ \left(1,0,0\right)\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Matrix, eye

print('3.')

print('(g)')

t = symbols('t')
I3 = eye(3)
A = Matrix([[-1, 2, 2],
[2, 2, 2],
[-3, -6, -6]])

f = (t * I3 - A).det()

for o in [f, f.factor()]:
pprint(o)
print()


C:\Users\...>py sample3.py
3.
(g)
14⋅t + (t - 2)⋅(t + 1)⋅(t + 6) + 12

t⋅(t + 2)⋅(t + 3)

C:\Users\...>