## 2019年3月24日日曜日

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

1. 置換積分法。

$\begin{array}{}t={x}^{2}\\ \frac{\mathrm{dt}}{\mathrm{dx}}=2x\\ x=0,t=0\\ x=1,t=1\\ x=\sqrt{t}\\ {\int }_{0}^{1}\mathrm{sin}{x}^{2}\mathrm{dy}\\ =\frac{1}{2}\underset{0}{\overset{1}{\int }}\frac{\mathrm{sin}t}{\sqrt{t}}\mathrm{dt}\end{array}$

テイラー の公式。

$\begin{array}{}\mathrm{sin}t\\ =t-\frac{{t}^{3}}{3!}+{R}_{5}\left(t\right)\\ \left|{R}_{5}\left(t\right)\right|\le \frac{{\left|t\right|}^{5}}{5!}\end{array}$

よって、

$\begin{array}{}\frac{\mathrm{sin}t}{\sqrt{t}}\\ ={t}^{\frac{1}{2}}-\frac{{t}^{\left(\frac{5}{2}\right)}}{3!}+\frac{{R}_{5}\left(t\right)}{\sqrt{t}}\\ \left|\frac{{R}_{5}\left(t\right)}{\sqrt{t}}\right|\le \frac{{\left|t\right|}^{\left(\frac{9}{2}\right)}}{5!}\end{array}$

ゆえに、

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

かつ

$\begin{array}{}\frac{1}{2}\underset{0}{\overset{1}{\int }}\left|\frac{{R}_{5}\left(t\right)}{\sqrt{t}}\right|\mathrm{dt}\\ \le \frac{1}{2}\underset{0}{\overset{1}{\int }}\frac{1}{5!}{t}^{\left(\frac{9}{2}\right)}\mathrm{dt}\\ =\frac{1}{2}{\left[\frac{2}{11·5!}{t}^{\frac{15}{2}}\right]}_{0}^{1}\\ =\frac{1}{11·5!}\\ <\frac{1}{1000}\end{array}$

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

$\begin{array}{}\frac{1}{3}-\frac{1}{7·3!}+\frac{1}{11·5!}\\ =\frac{1}{3}-\frac{1}{7·3!}+\frac{1}{11·5!}\\ =\frac{7·11·5!-3·11·5·4+21}{3·7·11·5!}\\ =\frac{9240-660+21}{27720}\\ =\frac{8601}{27720}\\ =0.310...\end{array}$

コード

Python 3

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

print('11-(c).')

x = symbols('x')
f = sin(x ** 2)
i = Integral(f, (x, 0, 1))
g = Rational(1, 3) * x ** Rational(3, 2) - Rational(1, 7) * \
1 / factorial(3) * x ** Rational(7, 2)

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

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


C:\Users\...>py -3 sample11.py
11-(c).
1
⌠
⎮    ⎛ 2⎞
⎮ sin⎝x ⎠ dx
⌡
0

⎛√2⎞
3⋅√2⋅√π⋅fresnels⎜──⎟⋅Γ(3/4)
⎝√π⎠
───────────────────────────
8⋅Γ(7/4)

0.3102683017233811

7/2    3/2
x      x
- ──── + ────
42     3

C:\Users\...>