## 2020年1月18日土曜日

### 数学 - Python - 解析学 - 積分の計算 - 定積分の計算 - 三角関数(正弦と余弦)、周期性、加法定理、倍角、置換積分法、指数関数、対数関数

1. $\begin{array}{l}x=k\pi +t\\ k\in \text{ℤ}\end{array}$

とおく。

$\begin{array}{l}\frac{\mathrm{dx}}{\mathrm{dt}}=1\\ {\int }_{k}^{\left(k+1\right)\pi }{e}^{-x}\left|\mathrm{sin}x\right|\mathrm{dx}\\ ={e}^{-k\pi }{\int }_{k}^{\left(k+1\right)\pi }{e}^{-t}\left|\mathrm{sin}\left(k\pi +t\right)\right|\mathrm{dt}\\ ={e}^{-k\pi }{\int }_{0}^{\pi }{e}^{-t}\mathrm{sin}t\mathrm{dt}\\ \int {e}^{-t}\mathrm{sin}t\mathrm{dt}\\ =-{e}^{-t}\mathrm{sin}t+\int {e}^{-t}\mathrm{cos}t\mathrm{dt}\\ =-{e}^{-t}\mathrm{sin}t+\left(-{e}^{-t}\mathrm{cos}t-\int {e}^{-t}\mathrm{sin}t\mathrm{dt}\right)\\ =-{e}^{-t}\mathrm{sin}t-{e}^{-t}\mathrm{cos}t-\int {e}^{-t}\mathrm{sin}t\mathrm{dt}\\ \int {e}^{-t}\mathrm{sin}t\mathrm{dt}=-\frac{{e}^{-t}}{2}\left(\mathrm{sin}t+\mathrm{cos}t\right)\\ {\int }_{k}^{\left(k+1\right)\pi }{e}^{-k\pi -t}\left|\mathrm{sin}x\right|\mathrm{dx}\\ ={e}^{-k\pi }{\left[-\frac{1}{2}{e}^{-t}\left(\mathrm{sin}t+\mathrm{cos}t\right)\right]}_{0}^{\pi }\\ =-\frac{1}{2}{e}^{-k\pi }\left({e}^{-\pi }\left(-1\right)-1\right)\\ =\frac{1}{2}{e}^{-k\pi }\left({e}^{-\pi }+1\right)\end{array}$

よって、

$\begin{array}{l}{\int }_{0}^{n\pi }{e}^{-x}\left|\mathrm{sin}x\right|dx\\ =\frac{1}{2}\left({e}^{-\pi }+1\right)\sum _{k=0}^{n-1}{e}^{-k\pi }\\ =\frac{1}{2}\left({e}^{-\pi }+1\right)\frac{1-{e}^{-\left(n-1\right)\pi }}{1-{e}^{-\pi }}\\ {\int }_{0}^{\infty }{e}^{-x}\left(\mathrm{sin}x\right)\mathrm{dx}\\ =\underset{n\to \infty }{\mathrm{lim}}{\int }_{0}^{n\pi }{e}^{-x}\left|\mathrm{sin}x\right|\mathrm{dx}\\ =\frac{1}{2}·\frac{{e}^{-\pi }+1}{1-{e}^{-\pi }}\\ =\frac{1}{2}·\frac{{e}^{\pi }+1}{{e}^{\pi }-1}\end{array}$

（証明終）

2. $0

とする。

$\begin{array}{l}\mathrm{log}\mathrm{sin}\theta \\ =\mathrm{log}\theta ·\frac{\mathrm{sin}\theta }{\theta }\\ =\mathrm{log}\theta +\mathrm{log}\frac{\mathrm{sin}\theta }{\theta }\\ {\theta }^{a}\mathrm{log}\mathrm{sin}\theta \\ ={\theta }^{a}\mathrm{log}\theta +{\theta }^{a}\mathrm{log}\frac{\mathrm{sin}\theta }{\theta }\\ \underset{\theta \to +0}{\mathrm{lim}}\left({\theta }^{a}\mathrm{log}\theta +{\theta }^{a}\mathrm{log}\frac{\mathrm{sin}\theta }{\theta }\right)=0\end{array}$

よって、 積分

$\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta d\theta$

は収束する。

$\begin{array}{l}\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta d\theta \\ =\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{cos}\theta d\theta \\ =\underset{\frac{\pi }{2}}{\overset{\pi }{\int }}\mathrm{log}\mathrm{sin}\theta d\theta \\ \underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta d\theta \\ =\frac{1}{2}·2\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta d\theta \\ =\frac{1}{2}\left(\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta d\theta +\underset{\frac{\pi }{2}}{\overset{\pi }{\int }}\mathrm{log}siq\theta d\theta \right)\\ =\frac{1}{2}{\int }_{0}^{\pi }\mathrm{log}\mathrm{sin}\theta d\theta \end{array}$

ここで、

$\theta =2t$

とおくと、

$\begin{array}{l}\frac{d\theta }{\mathrm{dt}}=2\\ \underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}\theta \mathrm{dt}\\ =\frac{1}{2}{\int }_{0}^{\pi }\mathrm{log}\mathrm{sin}\theta d\theta \\ =\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}2t\mathrm{dt}\\ =\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\left(2\mathrm{sin}t\mathrm{cos}t\right)\mathrm{dt}\\ =\underset{0}{\overset{\frac{\pi }{2}}{\int }}\left(\mathrm{log}2+\mathrm{log}\mathrm{sin}t+\mathrm{log}\mathrm{cos}t\right)\mathrm{dt}\\ =\frac{\pi }{2}\mathrm{log}2+2\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}t\mathrm{dt}\end{array}$

よって、

$\underset{0}{\overset{\frac{\pi }{2}}{\int }}\mathrm{log}\mathrm{sin}x\mathrm{dx}=-\frac{\pi }{2}\mathrm{log}2$

である。

（証明終）

コード

#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, log, exp, sin, pi, oo, plot, Limit

print('8.')

x = symbols('x', real=True)
f = exp(-x) * abs(sin(x))
g = log(sin(x))
xs = [(0, oo),
(0, pi / 2)]

for h, (x1, x2) in zip([f, g], xs):
I = Integral(h, (x, x1, x2))
for o in [I, I.doit()]:
pprint(o)
print()

p = plot(f, g,
(x, 0.1, 10),
ylim=(-5, 5),
legend=True,
show=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

for o, color in zip(p, colors):
o.line_color = color

p.show()
p.save('sample8.png')


% ./sample8.py
8.
∞
⌠
⎮  -x
⎮ ℯ  ⋅│sin(x)│ dx
⌡
0

∞
⌠
⎮  -x
⎮ ℯ  ⋅│sin(x)│ dx
⌡
0

π
─
2
⌠
⎮ log(sin(x)) dx
⌡
0

π
─
2
⌠
⎮ log(sin(x)) dx
⌡
0

%


SymPyでは定積分を求められなかった。SymPyには苦手な積分がまだあるみたい。