## 2019年9月24日火曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 三角関数(続き)、逆三角関数 - 正弦と余弦、級数、偶奇、不等号、帰納法による証明

1. $\begin{array}{l}\frac{d}{\mathrm{dx}}\left({f}_{2n-1}\left(x\right)-\mathrm{sin}x\right)\\ ={g}_{2a-1}\left(x\right)-\mathrm{cos}x\\ \frac{d}{\mathrm{dx}}\left(\mathrm{cos}x-{g}_{2n}\left(x\right)\right)\\ ={f}_{2n-1}\left(x\right)-\mathrm{sin}x\\ \frac{d}{\mathrm{dx}}\left(\mathrm{sin}x-{f}_{2n}\left(x\right)\right)\\ =\mathrm{cos}x-{g}_{2n}\left(x\right)\\ \frac{d}{\mathrm{dx}}\left({g}_{2n+1}\left(x\right)-\mathrm{cos}x\right)\\ =\mathrm{sin}x-{f}_{2n}\left(x\right)\end{array}$

また、

$\begin{array}{l}{f}_{2n-1}\left(0\right)-\mathrm{sin}0=0\\ \mathrm{cos}\left(0\right)-{g}_{2n}\left(0\right)=1-1=0\\ \mathrm{sin}0-{f}_{in}\left(0\right)=0\\ \mathrm{cos}0-{g}_{2n+1}\left(0\right)=0\end{array}$

よって、

${g}_{2n-1}\left(x\right)-\mathrm{cos}x>0$

と仮定すると、

$\begin{array}{l}x>0\\ {f}_{2n-1}\left(x\right)-\mathrm{sin}x>0\\ \mathrm{cos}x-{g}_{2n}\left(x\right)>0\\ \mathrm{sin}x-{f}_{2n}\left(x\right)>0\\ {g}_{2n+1}-\mathrm{cos}x>0\\ {f}_{2n+1}\left(x\right)-\mathrm{sin}x>0\\ \mathrm{cos}x-{g}_{2n+2}\left(x\right)>0\text{'}\\ \mathrm{sin}x-{f}_{2n+2}\left(x\right)>0\\ {f}_{2n+2}\left(x\right)<\mathrm{sin}x<{f}_{2n+1}\left(x\right)\\ {g}_{2n+2}\left(x\right)<\mathrm{cos}x<{g}_{2n+1}\left(x\right)\end{array}$

よって、 帰納法により 成り立つ。

（証明終）

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sin, cos, factorial, plot
from sympy import summation, factorial

print('10.')

k, n, x = symbols('k, n, x')
fn = summation((-1) ** (k - 1) * x ** (2 * k - 1) / factorial(2 * k - 1),
(k, 1, n))
gn = summation((-1) ** (k - 1) * x ** (2 * k - 2) / factorial(2 * k - 2),
(k, 1, n))

ns = range(1, 5)
fns = [fn.subs({n: n0}) for n0 in ns]
gns = [gn.subs({n: n0}) for n0 in ns]
hs = [sin(x)] + fns + [cos(x)] + gns

p = plot(*hs,
(x, 0, 5),
ylim=(-2.5, 2.5),
show=False,
legend=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

for o in zip(hs, colors):
pprint(o)
print()

p.show()
p.save(f'sample10.png')


$./sample10.py 10. (sin(x), red) ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 3 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝2, 5/2 │ 4 ⎠ ⎟ ⎜─────────────────────── + sin(x), green⎟ ⎝ 6 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 5 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜ x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝3, 7/2 │ 4 ⎠ ⎟ ⎜- ─────────────────────── + sin(x), blue⎟ ⎝ 120 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 7 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝4, 9/2 │ 4 ⎠ ⎟ ⎜─────────────────────── + sin(x), brown⎟ ⎝ 5040 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 9 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜ x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝5, 11/2 │ 4 ⎠ ⎟ ⎜- ──────────────────────── + sin(x), orange⎟ ⎝ 362880 ⎠ (cos(x), purple) ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 2 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝3/2, 2 │ 4 ⎠ ⎟ ⎜─────────────────────── + cos(x), pink⎟ ⎝ 2 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 4 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜ x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝5/2, 3 │ 4 ⎠ ⎟ ⎜- ─────────────────────── + cos(x), gray⎟ ⎝ 24 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 6 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝7/2, 4 │ 4 ⎠ ⎟ ⎜─────────────────────── + cos(x), skyblue⎟ ⎝ 720 ⎠ ⎛ ⎛ │ 2 ⎞ ⎞ ⎜ 8 ┌─ ⎜ 1 │ -x ⎟ ⎟ ⎜ x ⋅ ├─ ⎜ │ ────⎟ ⎟ ⎜ 1╵ 2 ⎝9/2, 5 │ 4 ⎠ ⎟ ⎜- ─────────────────────── + cos(x), yellow⎟ ⎝ 40320 ⎠$