## 2019年9月27日金曜日

### 数学 - Python - 解析学 - 級数 - べき級数 - 2の累乗(べき乗)、係数、累乗根、収束半径、絶対値、極限、逆数

1. $\begin{array}{l}\underset{n\to \infty }{\mathrm{lim}}{\left|{2}^{n}\right|}^{\frac{1}{n}}\\ =2\end{array}$

よって、 収束半径は、

$\frac{1}{2}$

コード

Python 3

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

print('8.')

n, m, x = symbols('n, m, x')
an = 2 ** n
f = summation(an * x ** n, (n, 0, 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(10)
# 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('sample8.png')


$./sample8.py 8. re(n) ───── n lim 2 n─→∞ 2 1/2 ⎧ ∞ for 2⋅x = 1 ⎪ ⎪ ∞ ⎨1 - (2⋅x) ⎪────────── otherwise ⎪ 1 - 2⋅x ⎩ (0, red) (1, green) (2⋅x + 1, blue) ⎛ 2 ⎞ ⎝4⋅x + 2⋅x + 1, brown⎠ ⎛ 3 2 ⎞ ⎝8⋅x + 4⋅x + 2⋅x + 1, orange⎠ ⎛ 4 3 2 ⎞ ⎝16⋅x + 8⋅x + 4⋅x + 2⋅x + 1, purple⎠ ⎛ 5 4 3 2 ⎞ ⎝32⋅x + 16⋅x + 8⋅x + 4⋅x + 2⋅x + 1, pink⎠ ⎛ 6 5 4 3 2 ⎞ ⎝64⋅x + 32⋅x + 16⋅x + 8⋅x + 4⋅x + 2⋅x + 1, gray⎠ ⎛ 7 6 5 4 3 2 ⎞ ⎝128⋅x + 64⋅x + 32⋅x + 16⋅x + 8⋅x + 4⋅x + 2⋅x + 1, skyblue⎠ ⎛ 8 7 6 5 4 3 2 ⎞ ⎝256⋅x + 128⋅x + 64⋅x + 32⋅x + 16⋅x + 8⋅x + 4⋅x + 2⋅x + 1, yellow⎠$