## 2019年5月27日月曜日

### 数学 - Python - 線形代数学 - 行列式 - 行列式の存在(微分、導関数と行列式)

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の6章(行列式)、4(行列式の存在)、練習問題9の解答を求めてみる。

1. $\begin{array}{l}\phi \left(t\right)\\ =\mathrm{det}\left[\begin{array}{cc}f\left(t\right)& g\left(t\right)\\ f\text{'}\left(t\right)& g\text{'}\left(t\right)\end{array}\right]\\ =f\left(t\right)g\text{'}\left(t\right)-f\text{'}\left(t\right)g\left(t\right)\\ \phi \text{'}\left(t\right)\\ =f\text{'}\left(t\right)g\text{'}\left(t\right)+f\left(t\right)g\text{'}\text{'}\left(t\right)-f\text{'}\text{'}\left(t\right)g\left(t\right)-f\text{'}\left(t\right)g\text{'}\left(t\right)\\ =f\left(t\right)g\text{'}\text{'}\left(t\right)-f\text{'}\text{'}\left(t\right)g\left(t\right)\\ =\mathrm{det}\left[\begin{array}{cc}f\left(t\right)& g\left(t\right)\\ f\text{'}\text{'}\left(t\right)& g\text{'}\text{'}\left(t\right)\end{array}\right]\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Matrix, sin, cos, plot, Function, Derivative

print('9.')

t = symbols('t')

f = Function('f')(t)
g = Function('g')(t)
f1 = Derivative(f, t, 1)
g1 = Derivative(g, t, 1)
f2 = Derivative(f, t, 2)
g2 = Derivative(g, t, 2)
A = Matrix([[f, g],
[f1, g1]])
B = Matrix([[f, g],
[f2, g2]])
phi = A.det()
phi1 = B.det()

for o in [A, B, phi, phi1, phi1 == B.det()]:
pprint(o)
print()


C:\Users\...>py sample9.py
9.
⎡  f(t)      g(t)  ⎤
⎢                  ⎥
⎢d         d       ⎥
⎢──(f(t))  ──(g(t))⎥
⎣dt        dt      ⎦

⎡  f(t)       g(t)   ⎤
⎢                    ⎥
⎢  2          2      ⎥
⎢ d          d       ⎥
⎢───(f(t))  ───(g(t))⎥
⎢  2          2      ⎥
⎣dt         dt       ⎦

d               d
f(t)⋅──(g(t)) - g(t)⋅──(f(t))
dt              dt

2                2
d                d
f(t)⋅───(g(t)) - g(t)⋅───(f(t))
2                2
dt               dt

True

C:\Users\...>