2019年4月12日金曜日

学習環境

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



    1. 置換積分法。

      t = x 2 dt dx = 2 x x = 0 , t = 1 x = 0.1 , t = 0.01 0 0.1 e - x 2 dx = 1 2 0 0.01 e - t t dt e - t = 1 + R 1 t R 1 t e - 0 t = t

      よって、

      e - t t = 1 t + R 1 t t R 1 t t t

      ゆえに、

      1 2 0 0.01 e - t t dt = t 0 0.01 + 1 2 0 0.01 R 1 t dt t 0 0.01 R 1 t t dt 1 2 0 0.01 t dt = 1 3 t t 0 0.01 = 1 3 · 1 0 - 2 · 1 0 - 1 < 1 0 - 3

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

      t 0 0.01 = 1 0 - 2 = 0.1

コード

Python 3

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

print('11-(e).')

x = symbols('x')
f = exp(-x ** 2)
If = Integral(f, (x, 0, 0.1))
y = Rational(1, 10)

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

f = exp(-x) / (2 * x ** Rational(1, 2))
g = 1 / (2 * x ** Rational(1, 2))
p = plot(f, g,
         (x, 0, 0.015),
         ylim=(0, 20),
         show=False, legend=False)
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 sample11.py
11-(e).
0.1        
 ⌠         
 ⎮     2   
 ⎮   -x    
 ⎮  ℯ    dx
 ⌡         
 0         

0.0562314580091424⋅√π

0.09966766429033636

0.1


C:\Users\...>

0 コメント:

コメントを投稿