## 2019年9月10日火曜日

### 数学 - Python - 解析学 - 級数 - 絶対収束と交代級数の収束 - 対数関数、逆数、収束と絶対収束、極限

1. $\begin{array}{l}\sum \left|\frac{{\left(-1\right)}^{n+2}}{\mathrm{log}n}\right|\\ =\sum \frac{1}{\mathrm{log}n}\end{array}$

よって絶対収束しない。

$\begin{array}{l}\underset{n\to 0}{\mathrm{lim}}\frac{{\left(-1\right)}^{n+2}}{\mathrm{log}n}=0\\ \left|{a}_{n+1}\right|\\ =\left|\frac{{\left(-1\right)}^{n+3}}{\mathrm{log}\left(n+1\right)}\right|\\ =\frac{1}{\mathrm{log}\left(n+1\right)}\\ \le \frac{1}{\mathrm{log}n}\\ =\left|\frac{{\left(-1\right)}^{n+2}}{\mathrm{log}n}\right|\\ =\left|{a}_{n}\right|\end{array}$

よって 収束する。

コード

Python 3

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

print('12.')

n = symbols('n')
f = (-1) ** (n + 2) / log(n)
s1 = summation(f, (n, 1, oo))
s2 = summation(abs(f), (n, 1, oo))
for o in [s1, s2]:
pprint(o)
print()

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

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

p = plot(f, abs(f),
(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')

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


C:\Users\...>py sample12.py
12.
∞
____
╲
╲       n + 2
╲  (-1)
╱  ─────────
╱     log(n)
╱
‾‾‾‾
n = 1

∞
____
╲
╲    -π⋅im(n) │  1   │
╲  ℯ        ⋅│──────│
╱            │log(n)│
╱
╱
‾‾‾‾
n = 1

c:\Users\...>