## 2019年1月28日月曜日

### 数学 - Python - 解析学 - 積分 - 積分の応用 - 曲線の長さ(逆数、平方根、累乗(べき乗)、対数関数、微分、極座標表示)

1. $\begin{array}{}\underset{\frac{1}{2}}{\overset{4}{\int }}\sqrt{{\left(\frac{2}{\theta }\right)}^{2}+{\left(\frac{d}{d\theta }\left(\frac{2}{\theta }\right)\right)}^{2}}d\theta \\ =\underset{\frac{1}{2}}{\overset{4}{\int }}\sqrt{\frac{{2}^{2}}{{\theta }^{2}}+{\left(\frac{-2}{{\theta }^{2}}\right)}^{2}}d\theta \\ =2\underset{\frac{1}{2}}{\overset{4}{\int }}\sqrt{\frac{1}{{\theta }^{2}}+\frac{1}{{\theta }^{4}}}d\theta \\ =2\underset{\frac{1}{2}}{\overset{4}{\int }}\frac{\sqrt{{\theta }^{2}+1}}{{\theta }^{2}}d\theta \end{array}$

いろいろと微分してみる。

$\begin{array}{}\frac{d}{d\theta }\frac{\sqrt{{\theta }^{2}+1}}{\theta }\\ =\frac{1}{{\theta }^{2}}\left(\frac{\theta }{\sqrt{{\theta }^{2}+1}}·\theta -\sqrt{{\theta }^{2}+1}\right)\\ =\frac{1}{\sqrt{{\theta }^{2}+1}}-\frac{\sqrt{{\theta }^{2}+1}}{{\theta }^{2}}\\ =\frac{-{\theta }^{2}}{\sqrt{{\theta }^{2}+1}}\\ \frac{d}{d\theta }\mathrm{log}\left(\theta +\sqrt{{\theta }^{2}+1}\right)\\ =\frac{1}{\sqrt{1+{\theta }^{2}}}\\ \frac{d}{d\theta }\left(\mathrm{log}\left(\theta +\sqrt{{\theta }^{2}+1}\right)-\frac{\sqrt{{\theta }^{2}+1}}{\theta }\right)\\ =\frac{1}{\sqrt{1+{\theta }^{2}}}-\frac{1}{\sqrt{{\theta }^{2}+1}}+\frac{\sqrt{{\theta }^{2}+1}}{{\theta }^{2}}\\ =\frac{\sqrt{{\theta }^{2}+1}}{{\theta }^{2}}\end{array}$

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

$\begin{array}{}2{\left[\mathrm{log}\left(\theta +\sqrt{{\theta }^{2}+1}\right)-\frac{\sqrt{{\theta }^{2}+1}}{\theta }\right]}^{4}\frac{1}{2}\\ =2\left(\left(\mathrm{log}\left(4+\sqrt{17}\right)-\frac{\sqrt{17}}{4}\right)-\left(\mathrm{log}\left(\frac{1}{2}+\sqrt{\frac{1}{4}+1}\right)-2\sqrt{\frac{1}{4}+1}\right)\right)\\ =2\left(\mathrm{log}\left(4+\sqrt{17}\right)-\frac{\sqrt{17}}{4}-\mathrm{log}\left(\frac{1}{2}+\frac{\sqrt{5}}{2}\right)+\sqrt{5}\right)\\ =2\sqrt{5}-\frac{\sqrt{17}}{2}+2\mathrm{log}\frac{8+2\sqrt{17}}{1+\sqrt{5}}\end{array}$

コード

Python 3

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

theta = symbols('θ')
r = 2 / theta
x = r * cos(theta)
y = r * sin(theta)

I = Integral(sqrt(r ** 2 + Derivative(r, theta, 1) ** 2),
(theta, Rational(1, 2), 4))

for o in [I, I.doit()]:
pprint(o.simplify())
print()

I = 2 * Integral(sqrt(theta ** 2 + 1) / theta ** 2, (theta, Rational(1, 2), 4))
for o in [I, I.doit()]:
pprint(o.simplify())
print()

for o in [I.doit(),
2 * sqrt(5) - sqrt(17) / 2 + 2 *
log((8 + 2 * sqrt(17)) / (1 + sqrt(5)))]:
print(float(o))

p = plot_parametric((x, y, (theta, Rational(1, 3), Rational(1, 2))),
(x, y, (theta, Rational(1, 2), 4)),
(x, y, (theta, 4, 5)),
show=False)

colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
p[i].line_color = color
p.save('sample17.png')


$python3 sample17.py 4 ⌠ ⎮ _______________ ⎮ ╱ 2 ⎮ ╱ ⎛d ⎛2⎞⎞ 4 ⎮ ╱ ⎜──⎜─⎟⎟ + ── dθ ⎮ ╱ ⎝dθ⎝θ⎠⎠ 2 ⎮ ╲╱ θ ⌡ 1/2 4 ⌠ ⎮ ________ ⎮ ╱ 2 ⎮ ╱ θ + 1 2⋅ ⎮ ╱ ────── dθ ⎮ ╱ 4 ⎮ ╲╱ θ ⌡ 1/2 4 ⌠ ⎮ ________ ⎮ ╱ 2 ⎮ ╲╱ θ + 1 2⋅ ⎮ ─────────── dθ ⎮ 2 ⎮ θ ⌡ 1/2 √17 - ─── - 2⋅asinh(1/2) + 2⋅asinh(4) + 2⋅√5 2 5.637584586593745 5.637584586593745$