## 2019年1月10日木曜日

### 数学 - Python - 解析学 - 積分 - 積分の応用 - 曲線の長さ(微分、平方根、置換積分法)

1. $\begin{array}{}{\int }_{0}^{4}\sqrt{1+f\text{'}{\left(x\right)}^{2}}\mathrm{dx}\\ ={\int }_{0}^{4}\sqrt{1+{\left(\frac{3}{2}{x}^{\frac{1}{2}}\right)}^{2}}\mathrm{dx}\\ ={\int }_{0}^{4}\sqrt{1+\frac{9}{4}x}\mathrm{dx}\\ t=1+\frac{9}{4}x\\ \frac{\mathrm{dt}}{\mathrm{dx}}=\frac{9}{4}\\ x=0,t=1\\ x=4,t=10\\ \underset{1}{\overset{10}{\int }}{t}^{\frac{1}{2}}·\frac{4}{9}\mathrm{dt}\\ =\frac{4}{9}{\left[\frac{2}{3}{t}^{\frac{3}{2}}\right]}_{1}^{10}\\ =\frac{8}{27}\left(1{0}^{\frac{3}{2}}-1\right)\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, Derivative, plot, sqrt, Rational

print('1.')

x = symbols('x')

f = x ** Rational(3, 2)
I = Integral(sqrt(1 + Derivative(f, x, 1) ** 2), (x, 0, 4))

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

p = plot((f, (x, -5, 0)), (f, (x, 0, 4)), (f, (x, 4, 5)),
legend=True, show=False)
colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
p[i].line_color = color
p.save('sample1.png')


$python3 sample1.py 1. 4 ⌠ ⎮ _________________ ⎮ ╱ 2 ⎮ ╱ ⎛d ⎛ 3/2⎞⎞ ⎮ ╱ ⎜──⎝x ⎠⎟ + 1 dx ⎮ ╲╱ ⎝dx ⎠ ⌡ 0 8 80⋅√10 - ── + ────── 27 27$