学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第4部(級数)、第14章(テイラーの公式)、8(一意性定理)の練習問題7の解答を求めてみる。
x の 絶対値が1以下のとき、
よって、 帰納法により、
ゆえに、
以上より、
(証明終)
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Limit
import random
print('7.')
x = symbols('x')
k = 10
n = 20
coefficients = [random.randrange(-10, 11) for _ in range(n + 1)]
terms = [coefficients[i] * x ** i for i in range(n + 1)]
s = sum(terms)
t = sum(terms[:k + 1])
u = sum([coefficients[i] * x ** (k + 1) for i in range(k + 1, n + 1)])
for o in [s, t, u]:
pprint(o)
print()
print(abs((s - t).subs({x: 0.1})) <= u.subs({x: 0.1}))
p = plot(s, t, (x, -1, 1),
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('sample7.png')
入出力結果(cmd(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample7.py
7.
20 19 18 16 13 12 11 10 9 7
4⋅x + 7⋅x + 9⋅x + 9⋅x + 4⋅x + 4⋅x - x + 10⋅x - 8⋅x - 10⋅x -
6 4 3 2
2⋅x + 4⋅x + 2⋅x + 2⋅x - 2⋅x - 5
10 9 7 6 4 3 2
10⋅x - 8⋅x - 10⋅x - 2⋅x + 4⋅x + 2⋅x + 2⋅x - 2⋅x - 5
11
36⋅x
True
C:\Users\...>
0 コメント:
コメントを投稿