## 2018年11月2日金曜日

### 数学 - Python - 解析学 - 積分 - 積分の応用 - 曲線の長さ(極座標の場合の長さの公式、三角関数(正弦と余弦)の等式の応用)

1. $\begin{array}{}{\int }_{{\theta }_{1}}^{{\theta }_{2}}\sqrt{{\left(\frac{d}{d\theta }f\left(\theta \right)\mathrm{cos}\theta \right)}^{2}+{\left(\frac{d}{d\theta }f\left(\theta \right)\mathrm{sin}\theta \right)}^{2}}d\theta \\ =\underset{{\theta }_{1}}{\overset{{\theta }_{2}}{\int }}\sqrt{{\left(f\text{'}\left(\theta \right)\mathrm{cos}\theta -f\left(\theta \right)\mathrm{sin}\theta \right)}^{2}+{\left(f\text{'}\left(\theta \right)\mathrm{sin}\theta +f\left(\theta \right)\mathrm{cos}\theta \right)}^{2}}d\theta \\ =\underset{{\theta }_{1}}{\overset{{\theta }_{2}}{\int }}\sqrt{f\text{'}{\left(\theta \right)}^{2}\left({\mathrm{cos}}^{2}\theta +{\mathrm{sin}}^{2}\theta \right)+f{\left(\theta \right)}^{2}\left({\mathrm{sin}}^{2}\theta {\mathrm{cos}}^{2}\theta \right)}d\theta \\ =\underset{{\theta }_{1}}{\overset{{\theta }_{2}}{\int }}\sqrt{f\text{'}{\left(\theta \right)}^{2}+f{\left(\theta \right)}^{2}}d\theta \\ =\underset{{\theta }_{1}}{\overset{{\theta }_{2}}{\int }}\sqrt{f{\left(\theta \right)}^{2}+f\text{'}{\left(\theta \right)}^{2}}d\theta \end{array}$

コード(Emacs)

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sin, cos, sqrt, Function, Derivative

θ = symbols('θ')
f = Function('f')
x = f(θ) * cos(θ)
y = f(θ) * sin(θ)

pprint(sqrt(Derivative(x, θ, 1) ** 2 + Derivative(y, θ, 1) ** 2).doit().simplify())


$./sample1.py _____________________ ╱ 2 ╱ 2 ⎛d ⎞ ╱ f (θ) + ⎜──(f(θ))⎟ ╲╱ ⎝dθ ⎠$