## 2019年1月11日金曜日

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

1. $\begin{array}{}\int \sqrt{1+{\left(\frac{d}{\mathrm{dx}}\mathrm{log}x\right)}^{2}}\mathrm{dx}\\ =\int \sqrt{1+\frac{1}{{x}^{2}}}\mathrm{dx}\\ =\int \frac{\sqrt{{x}^{2}+1}}{x}\mathrm{dx}\\ t=\sqrt{{x}^{2}+1}\\ \frac{\mathrm{dt}}{\mathrm{dx}}=\frac{1}{2}·2x·\frac{1}{\sqrt{{x}^{2}+1}}\\ =\frac{x}{\sqrt{{x}^{2}+1}}\\ \int \frac{t}{x}·\frac{\sqrt{{x}^{2}+1}}{x}\mathrm{dt}\\ =\int \frac{{t}^{2}}{{x}^{2}}\mathrm{dt}\\ =\int \frac{{t}^{2}}{{t}^{2}-1}\mathrm{dt}\\ =\int \frac{{t}^{2}-1+1}{{t}^{2}-1}\mathrm{dt}\\ =\int \left(1+\frac{1}{{t}^{2}-1}\right)\mathrm{dt}\\ =t+\int \frac{1}{{t}^{2}-1}\mathrm{dt}\\ \frac{a}{t+1}+\frac{b}{t-1}\\ =\frac{\left(a+b\right)t+\left(-a+b\right)}{{t}^{2}-1}\\ a+b=0\\ -a+b=1\\ 2b=1\\ b=\frac{1}{2}\\ a=-\frac{1}{2}\\ \int \frac{1}{{t}^{2}-1}\mathrm{dt}\\ =\frac{1}{2}\int \left(\frac{1}{t-1}-\frac{1}{t+1}\right)\mathrm{dt}\\ =\frac{1}{2}\left(\mathrm{log}\left(t-1\right)-\mathrm{log}\left(t+1\right)\right)\\ x=\frac{1}{2},t=\frac{\sqrt{5}}{2}\\ x=2,t=\sqrt{5}\end{array}$

よって求める曲線、対数関数の指示された区間における長さは、

$\begin{array}{}{\left[t\right]}_{\frac{\sqrt{5}}{2}}^{\sqrt{5}}+\frac{1}{2}{\left[\mathrm{log}\frac{t-1}{t+1}\right]}_{\frac{\sqrt{5}}{2}}^{\sqrt{5}}\\ =\sqrt{5}-\frac{\sqrt{5}}{2}+\frac{1}{2}\left(\mathrm{log}\frac{\sqrt{5}-1}{\sqrt{5}+1}-\mathrm{log}\frac{\sqrt{5}-2}{\sqrt{5}+2}\right)\\ =\frac{\sqrt{5}}{2}+\frac{1}{2}\mathrm{log}\left(\frac{\sqrt{5}-1}{\sqrt{5}+1}·\frac{\sqrt{5}+2}{\sqrt{5}-2}\right)\\ =\frac{\sqrt{5}}{2}+\frac{1}{2}\mathrm{log}\frac{3+\sqrt{5}}{3-\sqrt{5}}\\ =\frac{\sqrt{5}}{2}+\frac{1}{2}\mathrm{log}\frac{{\left(3+\sqrt{5}\right)}^{2}}{4}\\ =\frac{\sqrt{5}}{2}+\mathrm{log}\frac{3+\sqrt{5}}{2}\end{array}$

コード

Python 3

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

x = symbols('x')

f = log(x)
I = Integral(sqrt(1 + Derivative(f, x, 1) ** 2), (x, Rational(1, 2), 2))

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

p = plot((f, (x, 0.1, Rational(1, 2))),
(f, (x, Rational(1, 2), 2)),
(f, (x, 2, 3)),
legend=True, show=False)
colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
p[i].line_color = color
p.save('sample2.png')

for t in [I.doit(), sqrt(5) / 2 + log((3 + sqrt(5)) / 2)]:
print(float(t))


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