## 2019年1月26日土曜日

### 数学 - Python - 解析学 - 積分 - 積分の応用 - 曲線の長さ(極座標表示、指数関数、微分)

1. $\begin{array}{}{\int }_{1}^{2}\sqrt{{\left({e}^{-4\theta }\right)}^{2}+{\left(\frac{d}{d\theta }{e}^{-4\theta }\right)}^{2}}d\theta \\ ={\int }_{1}^{2}\sqrt{{e}^{-8\theta }+{\left(-4{e}^{-4\theta }\right)}^{2}}d\theta \\ ={\int }_{1}^{2}\sqrt{{e}^{-8\theta }+16{e}^{-8\theta }}d\theta \\ =\sqrt{17}{\int }_{1}^{2}{e}^{-4\theta }d\theta \\ =\sqrt{17}{\left[\frac{-1}{4}{e}^{-4\theta }\right]}_{1}^{2}\\ =\frac{\sqrt{17}}{4}\left({e}^{-4}-{e}^{-8}\right)\end{array}$

コード

Python 3

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

theta = symbols('θ')
r = exp(-4 * theta)
x = r * cos(theta)
y = r * sin(theta)

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

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

p = plot_parametric((x, y, (theta, 0, 1)),
(x, y, (theta, 1, 2)),
(x, y, (theta, 2, 2 * pi)),
show=False)

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


$python3 sample15.py 2 ⌠ ⎮ ______________________ ⎮ ╱ 2 ⎮ ╱ ⎛d ⎛ -4⋅θ⎞⎞ -8⋅θ ⎮ ╱ ⎜──⎝ℯ ⎠⎟ + ℯ dθ ⎮ ╲╱ ⎝dθ ⎠ ⌡ 1 ⎛ 4 ⎞ -8 -√17⋅⎝- ℯ + 1⎠⋅ℯ ──────────────────── 4$