## 2020年6月7日日曜日

### 数学 - Python - 線形代数学 - 行列式 - 行列式の存在 - 全ての階数の導関数をもつ関数、行列式の導関数

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

1. $\begin{array}{l}\frac{d}{\mathrm{dt}}\phi \left(t\right)\\ =\frac{d}{\mathrm{dt}}\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]\\ =\frac{d}{\mathrm{dt}}\left(f\left(t\right)g\text{'}\left(t\right)-g\left(t\right)f\text{'}\left(t\right)\right)\\ =\left(f\text{'}\left(t\right)g\text{'}\left(t\right)+f\left(t\right)g\text{'}\text{'}\left(t\right)\right)-\left(g\text{'}\left(t\right)f\text{'}\left(t\right)+g\left(t\right)f\text{'}\text{'}\left(t\right)\right)\\ =f\left(t\right)g\text{'}\text{'}\left(t\right)-g\left(t\right)f\text{'}\text{'}\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}$

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import Matrix, Function
from sympy.abc import t

print('9.')

class TestMatrixDetDerivative(TestCase):
def test(self):
f = Function('f')(t)
g = Function('g')(t)
a = Matrix([[f, g],
[f.diff(t, 1), g.diff(t, 1)]]).det().diff(t, 1)
b = Matrix([[f, g],
[f.diff(t, 2), g.diff(t, 2)]]).det()
self.assertEqual(a, b)

if __name__ == "__main__":
main()


% ./sample9.py -v
9.
test (__main__.TestMatrixDetDerivative) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.019s

OK
%