2019年3月27日水曜日

学習環境

解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第4部(級数)、第14章(テイラーの公式)、3(三角関数)の練習問題11-(f)の解答を求めてみる。



    1. 置換積分法。

      t = x 2 dt dx = 2 x x = 0 , t = 0 x = 1 , t = 1 0 1 sin x 2 x 2 dx = 1 2 0 1 sin t t · 1 x dx = 1 2 0 1 sin t t 3 2 dt

      テイラー の公式。

      sin t = t - 1 3 ! t 3 + 1 5 ! t 5 + R 7 t R 7 t t 7 7 !

      よって、

      sin t t 3 2 = t - 1 2 - 1 3 ! t 3 2 + 1 5 ! t 7 2 + R 7 t t 3 2 R 7 t t 3 2 t 11 2 7 !

      ゆえに、

      0 1 sin x 2 x 2 dx = 1 2 2 t 1 2 - 2 5 · 3 ! t 5 2 + 2 9 · 5 ! t 9 2 0 1 + 1 2 0 1 R 7 t t 3 2 dt

      かつ

      1 2 0 1 R 7 t t 3 2 dt 1 2 0 1 t 11 2 7 ! dt = 1 2 · 1 7 ! · 2 13 · t 13 2 0 1 = 1 13 · 7 !

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

      1 2 2 t 1 2 - 2 5 · 3 ! t 5 2 + 2 9 · 5 ! t 9 2 0 1 = 1 - 1 5 · 3 ! + 1 9 · 5 ! = 5 · 9 · 5 ! - 9 · 5 · 4 + 5 5 · 9 · 5 ! = 9 · 5 ! - 9 · 4 + 1 9 · 5 ! = 1080 - 36 + 1 1080 = 1045 1080 = 0.967

コード

Python 3

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

print('11-(f).')

x = symbols('x')
f = sin(x ** 2) / x ** 2
i = Integral(f, (x, 0, 1))
g = Rational(1, 2) * (x ** -Rational(1, 2) -
                      1 / factorial(3) * x ** Rational(3, 2) +
                      1 / factorial(5) * 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')

入出力結果(cmd(コマンドプロンプト)、Terminal、Jupyter(IPython))

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

                                ⎛√2⎞       
                  √2⋅√π⋅fresnelc⎜──⎟⋅Γ(1/4)
  sin(1)⋅Γ(1/4)                 ⎝√π⎠       
- ───────────── + ─────────────────────────
     4⋅Γ(5/4)              4⋅Γ(5/4)        

0.9675774909926477

 7/2    3/2       
x      x       1  
──── - ──── + ────
240     12    2⋅√x


C:\Users\...>

0 コメント:

コメントを投稿