## 2019年8月26日月曜日

### 数学 - Python - 解析学 - 級数 - 積分による判定法 - 対数関数の累乗、累乗(べき乗)、有理数、逆数、収束

1. $\begin{array}{l}\int \frac{{\left(\mathrm{log}x\right)}^{2}}{{x}^{\frac{3}{2}}}\mathrm{dx}\\ =-2{x}^{-\frac{1}{2}}{\left(\mathrm{log}x\right)}^{2}-\int \left(-2{x}^{-\frac{1}{2}}\right)2\left(\mathrm{log}x\right)\frac{1}{x}\mathrm{dx}\\ =-2{x}^{-\frac{1}{2}}{\left(\mathrm{log}x\right)}^{2}+4\int {x}^{-\frac{3}{2}}\mathrm{log}x\mathrm{dx}\\ \int {x}^{-\frac{3}{2}}\mathrm{log}x\mathrm{dx}\\ =-2{x}^{-\frac{1}{2}}\mathrm{log}x-\int \left(-2{x}^{-\frac{1}{2}}\right)\frac{1}{x}\mathrm{dx}\\ =-2{x}^{-\frac{1}{2}}\mathrm{log}x+2\int {x}^{-\frac{3}{2}}\mathrm{dx}\\ =-2{x}^{-\frac{1}{2}}\mathrm{log}x+2\left(-2\right)x-\frac{1}{2}\\ =-2{x}^{-\frac{1}{2}}\left(\mathrm{log}x+2\right)\\ -2{x}^{-\frac{1}{2}}{\left(\mathrm{log}x\right)}^{2}+4\left(-2\right){x}^{-\frac{1}{2}}\left(\mathrm{log}x+2\right)\\ =-2{x}^{-\frac{1}{2}}\left({\left(\mathrm{log}x\right)}^{2}+4\left(\mathrm{log}x+2\right)\right)\\ {\left[-2{x}^{-\frac{1}{2}}\left({\left(\mathrm{log}x\right)}^{2}+4\left(\mathrm{log}x+2\right)\right)\right]}_{1}^{b}\\ =-2{b}^{-\frac{1}{2}}\left({\left(\mathrm{log}b\right)}^{2}+4\left(\mathrm{log}b+2\right)\right)+2·8\\ \underset{b\to \infty }{\mathrm{lim}}{\int }_{1}^{b}\frac{{\left(\mathrm{log}x\right)}^{2}}{{x}^{\frac{3}{2}}}\mathrm{dx}=16\end{array}$

よって、問題の無限級数は収束する。

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, summation, oo, Integral, plot, log
from sympy import Rational
import matplotlib.pyplot as plt

print('12-(d).')

n = symbols('n')
epsilon = symbols('ε', positive=True)
f = log(n) ** 2 / n ** Rational(3, 2)
s = summation(f, (n, 1, oo))
I = Integral(f, (n, 1, oo))

for o in [s, I, I.doit()]:
pprint(o)
print()

d = {epsilon: 0.00001}
p = plot(f.subs(d),
(n, 1, 11),
legend=True,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

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

def g(m):
return sum([f.subs({n: k}).subs(d) for k in range(1, m)])

ms = range(1, 11)
plt.plot(ms, [g(m) for m in ms])
plt.legend(['Σ (log n)^2 / n^(3/2)'])
plt.savefig('sample12.png')


C:\Users\...>py sample12.py
12-(d).
∞
_____
╲
╲       2
╲   log (n)
╲  ───────
╱     3/2
╱     n
╱
╱
‾‾‾‾‾
n = 1

∞
⌠
⎮    2
⎮ log (n)
⎮ ─────── dn
⎮    3/2
⎮   n
⌡
1

16

c:\Users\...>