## 2019年10月2日水曜日

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

1. $\begin{array}{l}\underset{n\to \infty }{\mathrm{lim}}{\left|1+{\left(-2\right)}^{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, sqrt

print('13.')

n, m, x = symbols('n, m, x')
an = 1 + (-2) ** n
f = summation(an * x ** n, (n, 1, 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(1, m)])

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

p = plot(*fs,
(x, -1, 1),
ylim=(-1, 1),
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('sample13.png')


$./sample13.py 13. _____________ n ╱ │ n │ lim ╲╱ │(-2) + 1│ n─→∞ ⎛⎧ ∞ for x = 1⎞ ⎛⎧ ∞ for 2⋅x = -1⎞ ⎜⎪ ⎟ ⎜⎪ ⎟ ⎜⎪ ∞ ⎟ ⎜⎪ ∞ ⎟ ⎜⎨x - x ⎟ + ⎜⎨-2⋅x - (-2⋅x) ⎟ ⎜⎪────── otherwise⎟ ⎜⎪────────────── otherwise ⎟ ⎜⎪1 - x ⎟ ⎜⎪ 2⋅x + 1 ⎟ ⎝⎩ ⎠ ⎝⎩ ⎠ (0, red) (-x, green) ⎛ 2 ⎞ ⎝5⋅x - x, blue⎠ ⎛ 3 2 ⎞ ⎝- 7⋅x + 5⋅x - x, brown⎠ ⎛ 4 3 2 ⎞ ⎝17⋅x - 7⋅x + 5⋅x - x, orange⎠ ⎛ 5 4 3 2 ⎞ ⎝- 31⋅x + 17⋅x - 7⋅x + 5⋅x - x, purple⎠ ⎛ 6 5 4 3 2 ⎞ ⎝65⋅x - 31⋅x + 17⋅x - 7⋅x + 5⋅x - x, pink⎠ ⎛ 7 6 5 4 3 2 ⎞ ⎝- 127⋅x + 65⋅x - 31⋅x + 17⋅x - 7⋅x + 5⋅x - x, gray⎠ ⎛ 8 7 6 5 4 3 2 ⎞ ⎝257⋅x - 127⋅x + 65⋅x - 31⋅x + 17⋅x - 7⋅x + 5⋅x - x, skyblue⎠ ⎛ 9 8 7 6 5 4 3 2 ⎞ ⎝- 511⋅x + 257⋅x - 127⋅x + 65⋅x - 31⋅x + 17⋅x - 7⋅x + 5⋅x - x, yellow⎠$