## 2019年6月19日水曜日

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

1. $\begin{array}{l}\frac{d}{\mathrm{dx}}\mathrm{tan}x\\ =\frac{{\mathrm{cos}}^{2}x+{\mathrm{sin}}^{2}y}{{\mathrm{cos}}^{2}x}\\ =\frac{1}{{\mathrm{cos}}^{2}x}\\ \frac{{d}^{2}}{d{x}^{2}}\mathrm{tan}x\\ =\frac{2\mathrm{cos}x\mathrm{sin}x}{{\mathrm{cos}}^{4}x}\\ =\frac{2\mathrm{sin}x}{{\mathrm{cos}}^{3}x}\\ \frac{{d}^{3}}{d{x}^{3}}\mathrm{tan}x\\ =2·\frac{\mathrm{cos}x{\mathrm{cos}}^{3}x+\left(\mathrm{sin}x\right)3\left({\mathrm{cos}}^{2}x\right)\mathrm{sin}x}{{\mathrm{cos}}^{6}x}\\ =2·\frac{{\mathrm{cos}}^{2}x+3{\mathrm{sin}}^{2}x}{{\mathrm{cos}}^{4}x}\\ \mathrm{tan}x=x+\frac{2}{3!}{x}^{3}+\dots \\ \mathrm{tan}\left({x}^{2}\right)={x}^{2}+\frac{1}{3}{x}^{6}+\dots \\ {\left(\mathrm{tan}x\right)}^{2}={x}^{2}+2·\frac{2}{3!}{x}^{4}+\dots \\ ={x}^{2}+\frac{2}{3}{x}^{4}+\dots \\ \underset{x\to 0}{\mathrm{lim}}\frac{\mathrm{tan}{x}^{2}}{{\mathrm{tan}}^{2}x}=1\end{array}$

コード

Python 3

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

print('22.')

x = symbols('x')
f = tan(x ** 2) / tan(x) ** 2

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

p = plot(tan(x), tan(x ** 2), tan(x) ** 2, 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('sample22.png')


C:\Users\...>py sample22.py
22.
⎛   ⎛ 2⎞⎞
⎜tan⎝x ⎠⎟
lim ⎜───────⎟
x─→0⁺⎜   2   ⎟
⎝tan (x)⎠

1

⎛   ⎛ 2⎞⎞
⎜tan⎝x ⎠⎟
lim ⎜───────⎟
x─→0⁻⎜   2   ⎟
⎝tan (x)⎠

1

C:\Users\...>