## 2019年4月30日火曜日

### 数学 - Python - 解析学 - 級数 - テイラーの公式 - 逆正接関数(対数関数、三角関数(正弦)、累乗(べき乗、平方)、極限)

1. $\begin{array}{l}\mathrm{log}\left(1+{x}^{2}\right)\\ ={x}^{2}-\frac{1}{2}{\left({x}^{2}\right)}^{2}+\frac{1}{3}{\left({x}^{2}\right)}^{3}-\dots \\ \mathrm{sin}\left({x}^{2}\right)\\ =\left({x}^{2}\right)-\frac{1}{3!}{\left({x}^{2}\right)}^{3}+\frac{1}{5!}{\left({x}^{2}\right)}^{5}-\\ \frac{\mathrm{log}\left(1+{x}^{2}\right)}{\mathrm{sin}\left({x}^{2}\right)}\\ =\frac{1-\frac{1}{2}{x}^{2}+\frac{1}{3}{\left({x}^{2}\right)}^{2}-\dots }{1-\frac{1}{3!}{\left({x}^{2}\right)}^{2}+\frac{1}{5!}{\left({x}^{2}\right)}^{4}-\dots }\\ \underset{x\to 0}{\mathrm{lim}}\frac{\mathrm{log}\left(1+{x}^{2}\right)}{\mathrm{sin}\left({x}^{2}\right)}=1\end{array}$

コード

Python 3

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

print('14.')

x = symbols('x')
f = log(1 + x ** 2)
g = sin(x ** 2)
h = f / g
l = Limit(h, x, 0)

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

p = plot(f, g, h,
1,
(x, -5, 5),
ylim=(-5, 5),
show=False,
legend=True)

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('sample14.png')


C:\Users\...>py sample14.py
14.
⎛   ⎛ 2    ⎞⎞
⎜log⎝x  + 1⎠⎟
lim ⎜───────────⎟
x─→0⁺⎜     ⎛ 2⎞  ⎟
⎝  sin⎝x ⎠  ⎠

1

⎛   ⎛ 2    ⎞⎞
⎜log⎝x  + 1⎠⎟
lim ⎜───────────⎟
x─→0⁻⎜     ⎛ 2⎞  ⎟
⎝  sin⎝x ⎠  ⎠

1

C:\Users\...>