## 2019年8月17日土曜日

### 数学 - Python - 解析学 - 級数 - 積分による判定法 - 対数関数、累乗(べき乗、立方)、逆数

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

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

コード

Python 3

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

print('4.')

n = symbols('n', integer=True)
f = 1 / (n * log(n) ** 3)
s = summation(f, (n, 2, oo))
pprint(s)

I = Integral(f, (n, 2, oo))
for o in [I, I.doit()]:
pprint(o)
print()

p = plot(f,
(n, 2, 12),
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('sample4.png')

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

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


C:\Users\...>py sample4.py
4.
∞
____
╲
╲       1
╲  ─────────
╱       3
╱   n⋅log (n)
╱
‾‾‾‾
n = 2
∞
⌠
⎮     1
⎮ ───────── dn
⎮      3
⎮ n⋅log (n)
⌡
2

1
─────────
2
2⋅log (2)

c:\Users\...>