## 2019年3月21日木曜日

### 数学 - Python - 解析学 - 級数 - テイラーの公式 - 三角関数(正弦、積分、近似値(小数第3位まで))

1. $\begin{array}{}\mathrm{sin}x\\ =\mathrm{sin}0+\left(\mathrm{cos}0\right)x-\frac{1}{2!}\left(\mathrm{sin}0\right){x}^{2}-\frac{1}{3!}\left(\mathrm{cos}0\right){x}^{3}+\frac{1}{5!}{x}^{5}+{R}_{7}\left(x\right)\\ =x-\frac{1}{3!}{x}^{3}+\frac{1}{5!}{x}^{5}+{R}_{7}\left(x\right)\end{array}$

剰余項の評価。

$\left|{R}_{7}\left(x\right)\right|\le \frac{{\left|x\right|}^{7}}{7!}$

よって、

$\begin{array}{}\frac{\mathrm{sin}x}{x}=1-\frac{1}{3!}{x}^{2}+\frac{1}{5!}{x}^{4}+\frac{{R}_{7}\left(x\right)}{x}\\ \left|\frac{{R}_{7}\left(x\right)}{x}\right|\le \frac{{\left|x\right|}^{6}}{7!}\end{array}$

ゆえに、

$\begin{array}{}{\int }_{0}^{1}\frac{\mathrm{sin}x}{x}\mathrm{dx}\\ ={\left[x-\frac{1}{3·3!}{x}^{3}+\frac{1}{5·5!}{x}^{5}\right]}_{0}^{1}+\underset{0}{\overset{1}{\int }}\frac{{R}_{7}\left(x\right)}{x}\mathrm{dx}\end{array}$

かつ

$\begin{array}{}\underset{0}{\overset{1}{\int }}\left|\frac{{R}_{7}\left(x\right)}{x}\right|\mathrm{dx}\\ \le \underset{0}{\overset{1}{\int }}\frac{{x}^{6}}{7!}\mathrm{dx}\\ ={\left[\frac{{x}^{7}}{7·7!}\right]}_{0}^{1}\\ =\frac{1}{7·7!}\end{array}$

よって、求める積分の小数第3位までの値は、

$\begin{array}{}{\left[x-\frac{1}{3·3!}{x}^{3}+\frac{1}{5·5!}{x}^{5}\right]}_{0}^{1}\\ =1-\frac{1}{3·3!}+\frac{1}{5·5!}\\ =\frac{3·5·5!-5·5·4+3}{3·5·5!}\\ =\frac{1800-100+3}{1800}\\ =\frac{1703}{1800}\\ =0.946\dots \end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Rational, sin, Integral, plot

print('11-(a).')

x = symbols('x')
f = sin(x) / x
i = Integral(f, (x, 0, 1))

for o in [i, i.doit(), float(i.doit())]:
pprint(o)
print()

p = plot(sin(x), x, f, show=False, legend=True)
colors = ['red', 'green', 'blue']
for s, color in zip(p, colors):
s.line_color = color
p.show()
p.save('sample11.png')


C:\Users\...>py -3 sample11.py
11-(a).
1
⌠
⎮ sin(x)
⎮ ────── dx
⎮   x
⌡
0

Si(1)

0.946083070367183

C:\Users\...>