## 2019年6月25日火曜日

### 数学 - Python - 解析学 - 級数 - テイラーの公式 - 指数関数、直線、差、商、極限

1. $\begin{array}{l}\frac{d}{\mathrm{dx}}\left({e}^{x}-1-x\right)\\ ={e}^{x}-1\\ \frac{{d}^{2}}{d{x}^{2}}\left({e}^{x}-1-x\right)\\ ={e}^{x}\\ \frac{{d}^{3}}{d{x}^{3}}\left({e}^{x}-1-x\right)\\ ={e}^{x}\\ {e}^{x}-1-x\\ =\frac{1}{2!}{x}^{3}+\frac{1}{3!}{x}^{3}+...\\ \underset{x\to 0}{\mathrm{lim}}\frac{{e}^{x}-1-x}{x}=0\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Limit, exp

print('28.')

x = symbols('x')
f = (exp(x) - 1 - x) / x

for dir in ['+', '-']:
l = Limit(f, x, 0, dir=dir)
for o in [l, l.doit()]:
pprint(o)
print()

p = plot(exp(x), -1, -x, x,
exp(x) - 1 - x, f,
(x, -5, 5),
ylim=(-5, 5),
legend=True,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

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

C:\Users\...>py sample28.py
28.
⎛      x    ⎞
⎜-x + ℯ  - 1⎟
lim ⎜───────────⎟
x─→0⁺⎝     x     ⎠

0

⎛      x    ⎞
⎜-x + ℯ  - 1⎟
lim ⎜───────────⎟
x─→0⁻⎝     x     ⎠

0

C:\Users\...>