## 2018年5月6日日曜日

### 数学 - Python - 線形代数学 - 線形写像 – 行列式の存在(導関数)

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の6章(線形写像)、4(行列式の存在)、練習問題9.を取り組んでみる。

1. $\begin{array}{}\phi \left(t\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}$

コード(Emacs)

Python 3

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

x = symbols('x')
f = Function('f')(x)
g = Function('g')(x)
h = Matrix([[f, g],
[Derivative(f, x), Derivative(g, x)]]).det()
h1 = Derivative(h, x).doit()
M = Matrix([[f, g],
[Derivative(f, x, 2), Derivative(g, x, 2)]])

for t in [h1, M]:
pprint(t)
print()

print(h1 == M.det())


$./sample5.py 2 2 d d f(x)⋅───(g(x)) - g(x)⋅───(f(x)) 2 2 dx dx ⎡ f(x) g(x) ⎤ ⎢ ⎥ ⎢ 2 2 ⎥ ⎢ d d ⎥ ⎢───(f(x)) ───(g(x))⎥ ⎢ 2 2 ⎥ ⎣dx dx ⎦ True$