## 2019年1月20日日曜日

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

1. $\begin{array}{}\underset{0}{\overset{\frac{3}{4}}{\int }}\sqrt{1+{\left(\frac{d}{\mathrm{dx}}\mathrm{log}\left(1-{x}^{2}\right)\right)}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\sqrt{1+{\left(\frac{-2x}{1-{x}^{2}}\right)}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{\sqrt{{\left(1-{x}^{2}\right)}^{2}+4{x}^{2}}}{1-{x}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{\sqrt{1+2{x}^{2}+{x}^{4}}}{1-{x}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{\sqrt{{\left({x}^{2}+1\right)}^{2}}}{1-{x}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{{x}^{2}+1}{1-{x}^{2}}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\left(\frac{2}{1-{x}^{2}}-1\right)\mathrm{dx}\\ =2\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{1}{\left(1+x\right)\left(1-x\right)}\mathrm{dx}-\frac{3}{4}\\ \frac{a}{1+x}+\frac{b}{1-x}\\ =\frac{\left(-a+b\right)x+\left(a+b\right)}{\left(1+x\right)\left(1-x\right)}\\ a+b=1\\ -a+b=0\\ b=\frac{1}{2}\\ a=\frac{1}{2}\\ 2\underset{0}{\overset{\frac{3}{4}}{\int }}\frac{1}{\left(1+x\right)\left(1-x\right)}\mathrm{dx}\\ =\underset{0}{\overset{\frac{3}{4}}{\int }}\left(\frac{1}{1+x}+\frac{1}{1-x}\right)\mathrm{dx}\\ ={\left[\mathrm{log}\left(1+x\right)-\mathrm{log}\left(1-x\right)\right]}_{0}^{\frac{3}{4}}\\ =\mathrm{log}\frac{7}{4}-\mathrm{log}\frac{1}{4}\\ =\mathrm{log}7\end{array}$

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

$\mathrm{log}7-\frac{3}{4}$

コード

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(1 - x ** 2)
I = Integral(sqrt(1 + Derivative(f, x, 1) ** 2), (x, 0, Rational(3, 4)))

I1 = I.doit()
I2 = I1.doit()
for o in [I, I1, I2]:
pprint(o)
print()

I = Integral((x ** 2 + 1) / (1 - x ** 2), (x, 0, Rational(3, 4)))
for o in [I, I.doit()]:
pprint(o.simplify())
print()
p = plot((f, (x, -0.9, 0)),
(f, (x, 0, Rational(3, 4))),
(f, (x, Rational(3, 4), 0.9)),
legend=True,
show=False)
colors = ['red', 'green', 'blue']
for i, color in enumerate(colors):
p[i].line_color = color
p.save('sample9.png')


iMac:曲線の長さ kamimura$python3 sample9.py 3/4 ⌠ ⎮ __________________________ ⎮ ╱ 2 ⎮ ╱ ⎛d ⎛ ⎛ 2 ⎞⎞⎞ ⎮ ╱ ⎜──⎝log⎝- x + 1⎠⎠⎟ + 1 dx ⎮ ╲╱ ⎝dx ⎠ ⌡ 0 3/4 ⌠ ⎮ _________________ ⎮ ╱ 2 ⎮ ╱ 4⋅x ⎮ ╱ ─────────── + 1 dx ⎮ ╱ 2 ⎮ ╱ ⎛ 2 ⎞ ⎮ ╲╱ ⎝- x + 1⎠ ⌡ 0 3/4 ⌠ ⎮ _________________ ⎮ ╱ 2 ⎮ ╱ 4⋅x ⎮ ╱ ─────────── + 1 dx ⎮ ╱ 2 ⎮ ╱ ⎛ 2 ⎞ ⎮ ╲╱ ⎝- x + 1⎠ ⌡ 0 3/4 ⌠ ⎮ ⎛ 2 ⎞ ⎮ -⎝x + 1⎠ ⎮ ────────── dx ⎮ 2 ⎮ x - 1 ⌡ 0 -3/4 + log(7)$