## 2019年9月13日金曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 三角関数(続き)、逆三角関数 - 正弦と余弦、2倍角、積、極限

1. $\begin{array}{l}\mathrm{sin}\theta =2\mathrm{sin}\frac{\theta }{2}\mathrm{cos}\frac{\theta }{2}\\ \mathrm{cos}\frac{\theta }{2}=\frac{\mathrm{sin}\theta }{2\mathrm{sin}\frac{\theta }{2}}\\ \mathrm{sin}\frac{\theta }{2}=2\mathrm{sin}\frac{\theta }{{2}^{2}}\mathrm{cos}\frac{\theta }{{2}^{2}}\\ \mathrm{cos}\frac{\theta }{{2}^{2}}=\frac{\mathrm{sin}\frac{\theta }{2}}{2\mathrm{sin}\frac{\theta }{{2}^{2}}}\\ ⋮\\ \mathrm{cos}\frac{\theta }{{2}^{n}}=\frac{\mathrm{sin}\frac{\theta }{{2}^{n-1}}}{2\mathrm{sin}\frac{\theta }{{2}^{n}}}\end{array}$

よって、

$\begin{array}{l}\mathrm{cos}\frac{\theta }{2}\mathrm{cos}\frac{\theta }{{2}^{2}}\mathrm{cos}\frac{\theta }{{2}^{3}}\dots \mathrm{cos}\frac{\theta }{{2}^{n}}\\ =\frac{\mathrm{sin}\theta }{{2}^{n}\mathrm{sin}\frac{\theta }{{2}^{n}}}\\ =\frac{\mathrm{sin}\theta }{\theta }·\frac{\theta }{{2}^{n}\mathrm{sin}\frac{\theta }{{2}^{n}}}\\ =\frac{\mathrm{sin}\theta }{\theta }·\frac{\frac{\theta }{{2}^{n}}}{\mathrm{sin}\frac{\theta }{{2}^{n}}}\end{array}$

ゆえに、

$\prod _{n=1}^{\infty }\mathrm{cos}\frac{\theta }{{2}^{n}}=\frac{\mathrm{sin}\theta }{\theta }$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, product, sin, cos, oo, plot
import matplotlib.pyplot as plt

print('2.')

n, theta = symbols('n, θ')
f = cos(theta / 2 ** n)
p = product(f, (n, 1, oo))

f1 = f.subs({theta: 1})
p1 = product(f1, (n, 1, oo))
for o in [p, p1]:
pprint(o)
print()

p = plot(sin(1),
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

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

def h(m):
return product(f1, (n, 1, m))

ms = range(1, 11)
plt.plot(ms, [h(m) for m in ms])
plt.legend(['∏ cos θ/2^n'])
plt.savefig('sample2.png')


C:\Users\...>py sample2.py
2.
∞
─┬──┬─
│  │     ⎛ -n  ⎞
│  │  cos⎝2  ⋅θ⎠
│  │
n = 1

∞
─┬──┬─
│  │     ⎛ -n⎞
│  │  cos⎝2  ⎠
│  │
n = 1

C:\Users\...>