## 2019年10月11日金曜日

### 数学 - Python - 解析学 - 級数 - べき級数 - 三角関数(正弦)、階乗、係数、累乗根、収束半径、絶対値、極限、逆数

1. $\begin{array}{l}\underset{n\to \infty }{\mathrm{lim}}{\left|\frac{\mathrm{sin}\left(2\pi n\right)}{n!}\right|}^{\frac{1}{n}}\\ =\underset{n\to \infty }{\mathrm{lim}}{0}^{\frac{1}{n}}\\ =\underset{n\to \infty }{\mathrm{lim}}0\\ =0\end{array}$

よって、 収束半経は

$\infty$

コード

Python 3

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

print('24.')

n, m, x = symbols('n, m, x')
an = sin(2 * pi * n)
f = summation(an * x ** n, (n, 2, m))

s = Limit(abs(an) ** (1 / n), n, oo)

for o in [s,  s.doit(), 1 / s.doit(), f.subs({m: oo})]:
pprint(o)
print()

ms = range(1, 11)
# fs = [f.subs({m: m0}) for m0 in ms]

def g(m):
return sum([an.subs({n: m}) * x ** m for m in range(m)])

fs = [g(m) for m in ms]

p = plot(*fs,
(x, -2, 2),
ylim=(-2, 2),
legend=False,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

for o in zip(fs, colors):
pprint(o)
print()

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


% ./sample24.py
24.
n ______________
lim ╲╱ │sin(2⋅π⋅n)│
n─→∞

1

1

∞
___
╲
╲    n
╱   x ⋅sin(2⋅π⋅n)
╱
‾‾‾
n = 2

(0, red)

(0, green)

(0, blue)

(0, brown)

(0, orange)

(0, purple)

(0, pink)

(0, gray)

(0, skyblue)

(0, yellow)

%