Loading [MathJax]/jax/output/CommonHTML/jax.js

2019年3月21日木曜日

学習環境

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



    1. sinx=sin0+(cos0)x-12!(sin0)x2-13!(cos0)x3+15!x5+R7(x)=x-13!x3+15!x5+R7(x)

      剰余項の評価。

      |R7(x)||x|77!

      よって、

      sinxx=1-13!x2+15!x4+R7(x)x|R7(x)x||x|67!

      ゆえに、

      10sinxxdx=[x-13·3!x3+15·5!x5]10+10R7(x)xdx

      かつ

      10|R7(x)x|dx10x67!dx=[x77·7!]10=17·7!

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

      [x-13·3!x3+15·5!x5]10=1-13·3!+15·5!=3·5·5!-5·5·4+33·5·5!=1800-100+31800=17031800=0.946

コード

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')

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

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

Si(1)

0.946083070367183


C:\Users\...>

0 コメント:

コメントを投稿