## 2019年9月10日火曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 三角関数(続き)、逆三角関数 - 基本的な極限、正弦、余弦、逆正接関数

1. $\begin{array}{l}\underset{x\to 0}{\mathrm{lim}}\frac{\mathrm{sin}bx}{\mathrm{sin}ax}\\ =\underset{x\to 0}{\mathrm{lim}}\frac{abx}{abx}\frac{\mathrm{sin}bx}{\mathrm{sin}ax}\\ =\frac{b}{a}\underset{x\to 0}{\mathrm{lim}}\frac{\mathrm{sin}bx}{bx}·\frac{ax}{\mathrm{sin}ax}\\ =\frac{b}{a}·1·1\\ =\frac{b}{a}\end{array}$

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

3. $\begin{array}{l}y=\mathrm{arctan}x\\ \mathrm{tan}y=x\\ \underset{x\to 0}{\mathrm{lim}}\frac{\mathrm{arctan}x}{x}\\ =\underset{y\to 0}{\mathrm{lim}}\frac{y}{\mathrm{tan}y}\\ =\underset{y\to 0}{\mathrm{lim}}\frac{y}{\mathrm{sin}y}·\frac{1}{\mathrm{cos}y}\\ =1\end{array}$

4. $\begin{array}{l}\underset{x\to n\pi }{\mathrm{lim}}\frac{{\left(x-n\pi \right)}^{2}}{{\mathrm{sin}}^{2}x}\\ =\underset{y\to 0}{\mathrm{lim}}\frac{{y}^{2}}{{\mathrm{sin}}^{2}y}\\ =1\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sqrt, sin, cos, pi, atan, Limit, plot

print('1.')

a, b = symbols('a, b', nonzero=True)
n = symbols('n', integer=True)
x = symbols('x', real=True)
fs = [(sin(b * x) / sin(a * x), 0),
((x - n * pi) ** 2 / sin(x) ** 2, 0),
(atan(x) / x, 0),
((x - n * pi) ** 2 / sin(x) ** 2, n * pi)]

for i, (f, x0) in enumerate(fs, 1):
print(f'({i})')
for d in ['-', '+']:
l = Limit(f, x, x0, dir=d)
for o in [l, l.doit()]:
pprint(o)
print()
fs = [sin(1 * x) / sin(2 * x),
(1 - cos(x)) / x ** 2,
atan(x) / x,
(x - 2 * pi) ** 2 / sin(x) ** 2]

p = plot(*[(f, (x, -1, -0.1)) for f in fs],
*[(f, (x, 0.1, 1)) for f in fs],
ylim=(0.5, 1.5),
show=False,
legend=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']
for t in zip(fs, colors):
pprint(t)
print()

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

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


C:\Users\...>py sample1.py
1.
(1)
⎛sin(b⋅x)⎞
lim ⎜────────⎟
x─→0⁻⎝sin(a⋅x)⎠

b
─
a

⎛sin(b⋅x)⎞
lim ⎜────────⎟
x─→0⁺⎝sin(a⋅x)⎠

b
─
a

(2)
⎛          2⎞
⎜(-π⋅n + x) ⎟
lim ⎜───────────⎟
x─→0⁻⎜     2     ⎟
⎝  sin (x)  ⎠

⎛ 2⎞
∞⋅sign⎝n ⎠

⎛          2⎞
⎜(-π⋅n + x) ⎟
lim ⎜───────────⎟
x─→0⁺⎜     2     ⎟
⎝  sin (x)  ⎠

⎛ 2⎞
∞⋅sign⎝n ⎠

(3)
⎛atan(x)⎞
lim ⎜───────⎟
x─→0⁻⎝   x   ⎠

1

⎛atan(x)⎞
lim ⎜───────⎟
x─→0⁺⎝   x   ⎠

1

(4)
⎛          2⎞
⎜(-π⋅n + x) ⎟
lim  ⎜───────────⎟
x─→π⋅n⁻⎜     2     ⎟
⎝  sin (x)  ⎠

1

⎛          2⎞
⎜(-π⋅n + x) ⎟
lim  ⎜───────────⎟
x─→π⋅n⁺⎜     2     ⎟
⎝  sin (x)  ⎠

1

⎛ sin(x)      ⎞
⎜────────, red⎟
⎝sin(2⋅x)     ⎠

⎛1 - cos(x)       ⎞
⎜──────────, green⎟
⎜     2           ⎟
⎝    x            ⎠

⎛atan(x)      ⎞
⎜───────, blue⎟
⎝   x         ⎠

⎛         2       ⎞
⎜(x - 2⋅π)        ⎟
⎜──────────, brown⎟
⎜    2            ⎟
⎝ sin (x)         ⎠

C:\Users\...>