学習環境
- Surface、Surface ペン(端末)
 - Windows 10 Pro (OS)
 - Nebo(Windows アプリ)
 - iPad Pro 10.5 + Apple Pencil
 - MyScript Nebo - MyScript(iPad アプリ(iOS))
 - 参考書籍
 
解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第4部(級数)、第14章(テイラーの公式)、8(一意性定理)の練習問題13の解答を求めてみる。
対数関数について。
よって近似多項式はテイラー多項式にほかならない。
逆正接関数について。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, plot, log, atan
print('13.')
x = symbols('x')
fs = [(log(1 + x), (x, 0.1, 2)),
      (sum([(-1) ** (n - 1) * x ** n / n
            for n in range(1, 6)]),
       (x, 0.1, 2)),
      (atan(x), (x, -2, 2)),
      (sum([(-1) ** (n - 1) * x ** (2 * n - 1) / (2 * n - 1)
            for n in range(1, 6)]),
       (x, -2, 2))]
for f in fs:
    pprint(f)
    print()
p = plot(*fs,
         ylim=(-2, 2),
         legend=True,
         show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']
for o, color in zip(p, colors):
    o.line_color = color
p.show()
p.save('sample13.png')
入出力結果(cmd(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample13.py 13. (log(x + 1), (x, 0.1, 2)) ⎛ 5 4 3 2 ⎞ ⎜x x x x ⎟ ⎜── - ── + ── - ── + x, (x, 0.1, 2)⎟ ⎝5 4 3 2 ⎠ (atan(x), (x, -2, 2)) ⎛ 9 7 5 3 ⎞ ⎜x x x x ⎟ ⎜── - ── + ── - ── + x, (x, -2, 2)⎟ ⎝9 7 5 3 ⎠ C:\Users\...>
0 コメント:
コメントを投稿