## 2019年8月18日日曜日

### 数学 - Python - 解析学 - 級数 - 積分による判定法 - 対数関数、累乗(べき乗、平方)、逆数、部分積分法、極限、収束

1. $\begin{array}{l}{\int }_{2}^{b}\frac{1}{x{\left(\mathrm{log}x\right)}^{2}}\mathrm{dx}\\ ={\left[\left(\mathrm{log}x\right)·\frac{1}{{\left(\mathrm{log}x\right)}^{2}}\right]}_{2}^{b}-{\int }_{2}^{b}\frac{-2\mathrm{log}x}{{\left(\mathrm{log}x\right)}^{4}}·\frac{1}{x}\mathrm{log}x\mathrm{dx}\\ ={\left[\frac{1}{\mathrm{log}x}\right]}_{2}^{b}+2{\int }_{2}^{b}\frac{1}{x{\left(\mathrm{log}x\right)}^{2}}\mathrm{dx}\\ {\int }_{2}^{b}\frac{1}{x{\left(\mathrm{log}x\right)}^{2}}\mathrm{dx}=-{\left[\frac{1}{\mathrm{log}x}\right]}_{2}^{b}\\ =-\left(\frac{1}{\mathrm{log}b}-\frac{1}{\mathrm{log}2}\right)\\ b\to \infty ⇒\frac{1}{\mathrm{log}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('5.')

n = symbols('n', integer=True)
f = 1 / (n * log(n) ** 2)
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('sample5.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)^2'])
plt.savefig('sample5.png')


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

1
──────
log(2)

c:\Users\...>