## 2017年12月11日月曜日

### 数学 - Python - 解析学 - 距離空間の位相 - n次元実数空間における曲線(曲線の長さ、積分)

1. $\gamma \text{'}\left(t\right)=\left(-\mathrm{arcsin}t,\mathrm{arccos}t,b\right)$

長さ。

$\begin{array}{}L\left(t\right)=\underset{0}{\overset{2\pi }{\int }}\left|\left(-\mathrm{arcsin}t,\mathrm{arccos}t,b\right)\right|\mathrm{dt}\\ =\underset{0}{\overset{2\pi }{\int }}\sqrt{{a}^{2}{\mathrm{sin}}^{2}t+{a}^{2}{\mathrm{cos}}^{2}t+{b}^{2}}\mathrm{dt}\\ =\underset{0}{\overset{2\pi }{\int }}\sqrt{{a}^{2}+{b}^{2}}\mathrm{dt}\\ =\sqrt{{a}^{2}+{b}^{2}}{\left[t\right]}_{0}^{2\pi }\\ =2\pi \sqrt{{a}^{2}+{b}^{2}}\end{array}$

コード(Emacs)

Python 3

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

a, b, t = symbols('a, b, t', real=True)
f = Matrix([a * cos(t), a * sin(t), b * t])
D = Matrix([Derivative(x, t, 1) for x in f])
f1 = D.doit()
for g in [f, D, f1]:
pprint(g)
print()

I = Integral(f1.norm(), (t, 0, 2 * pi))
for s in [I, I.doit()]:
pprint(s)
print()


$./sample3.py ⎡a⋅cos(t)⎤ ⎢ ⎥ ⎢a⋅sin(t)⎥ ⎢ ⎥ ⎣ b⋅t ⎦ ⎡∂ ⎤ ⎢──(a⋅cos(t))⎥ ⎢∂t ⎥ ⎢ ⎥ ⎢∂ ⎥ ⎢──(a⋅sin(t))⎥ ⎢∂t ⎥ ⎢ ⎥ ⎢ ∂ ⎥ ⎢ ──(b⋅t) ⎥ ⎣ ∂t ⎦ ⎡-a⋅sin(t)⎤ ⎢ ⎥ ⎢a⋅cos(t) ⎥ ⎢ ⎥ ⎣ b ⎦ 2⋅π ⌠ ⎮ ______________________________ ⎮ ╱ 2 2 2 2 2 ⎮ ╲╱ a ⋅sin (t) + a ⋅cos (t) + b dt ⌡ 0 _________ ╱ 2 2 2⋅π⋅╲╱ a + b$