## 2020年3月9日月曜日

### 数学 - Python - 解析学 - 多変数の関数 - ベクトルの微分 - 曲線の長さ - 三角関数(正弦と余弦)、置換積分法

1. $\begin{array}{l}X\text{'}\left(t\right)=\left(1-\mathrm{cos}t,\mathrm{sin}t\right)\\ \int \sqrt{{\left(1-\mathrm{cos}t\right)}^{2}+{\mathrm{sin}}^{2}t}\mathrm{dt}\\ =\int \sqrt{1-2\mathrm{cos}t+1}\\ =\int \sqrt{2-2\mathrm{cos}t}\mathrm{dt}\\ =\sqrt{2}\int \sqrt{1-\mathrm{cos}t}\mathrm{dt}\\ u=\mathrm{cos}t\\ \frac{du}{\mathrm{dt}}=-\mathrm{sin}t\\ \int \sqrt{1-\mathrm{cos}t}\mathrm{dt}\\ =\int \frac{\sqrt{1-u}}{-\mathrm{sin}t}du\\ {u}^{2}={\mathrm{cos}}^{2}t\\ {u}^{2}=1-{\mathrm{sin}}^{2}t\\ {\mathrm{sin}}^{2}t=1-{u}^{2}\end{array}$

場合分け。

$\begin{array}{l}0\le t\le \pi \\ \mathrm{sin}t=\sqrt{1-{u}^{2}}\\ \pi \le t\le 2\pi \\ \mathrm{sin}t=-\sqrt{1-{u}^{2}}\\ {\int }_{0}^{2\pi }\sqrt{1-\mathrm{cos}t}\mathrm{dt}\\ =-{\int }_{1}^{-1}\frac{\sqrt{1-u}}{\sqrt{1-{u}^{2}}}du+{\int }_{-1}^{1}\frac{\sqrt{1-u}}{\sqrt{1-{u}^{2}}}du\\ ={\int }_{-1}^{1}\frac{1}{\sqrt{1+u}}du+{\int }_{-1}^{1}\frac{1}{\sqrt{1+u}}du\\ =2{\left[2\sqrt{1+u}\right]}_{-1}^{1}\\ =4\sqrt{2}\end{array}$

よって、 求める曲線の長さは

$\sqrt{2}·4\sqrt{2}=8$

2. $\begin{array}{l}0\le t\le \frac{\pi }{2}\\ \mathrm{sin}t=\sqrt{1-{u}^{2}}\\ \underset{0}{\overset{\frac{\pi }{2}}{\int }}\sqrt{1-\mathrm{cos}t}\mathrm{dt}\\ =-{\int }_{1}^{0}\frac{\sqrt{1-u}}{\sqrt{1-{u}^{2}}}du\\ ={\int }_{0}^{1}\frac{1}{\sqrt{1+u}}du\\ ={\left[2\sqrt{1+u}\right]}_{0}^{1}\\ =2\sqrt{2}-2\\ \sqrt{2}\left(2\sqrt{2}-2\right)\\ =4-2\sqrt{2}\end{array}$

コード

#!/usr/bin/env python3
from sympy import symbols, Matrix, Integral, Derivative, sin, cos, pi, sqrt
from sympy.plotting import plot_parametric

print('4.')

t = symbols('t', real=True)
x = t - sin(t)
y = 1 - cos(t)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

p = plot_parametric(*[(x, y, (t, t1, t2))
for t1, t2 in [(-2 * pi, 0), (0, pi / 2), (pi / 2, 2 * pi), (2 * pi, 4 * pi)]],
legend=False,
show=False)
for o, color in zip(p, colors):
o.line_color = color
p.show()
p.save('sample4.png')


% ./sample4.py
4.
%