学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- 数式入力ソフト(TeX, MathML): MathType
- MathML対応ブラウザ: Firefox、Safari
- MathML非対応ブラウザ(Internet Explorer, Google Chrome...)用JavaScript Library: MathJax
- 参考書籍
解析入門〈2〉(松坂 和夫(著)、岩波書店)の第6章(関数の近似、テイラーの定理)、6.1(テイラーの定理)、問題3.を取り組んでみる。
Pn−1(x)=f(0)+f'(0)x+f''(0)2!x20<c<1f(1)=Pn−1(1)+f'''(c)3!(1−0)3=f''''(c)6f3(c)6=1f3(c)=6−1<d<0f(−1)=Pn−1+f'''(d)3!(−1−0)3=−f'''(d)6−f'''(d)6=−1f'''(d)=6f'''(c)+f(d)=12
コード(Emacs)
Python 3
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from sympy import pprint, symbols, sin, pi, Derivative, solve x = symbols('x') f = sin(pi / 2 * x) for x0 in [-1, 0, 1]: print(f.subs({x: x0}) == x0) f3 = Derivative(f, x, 3).doit() pprint(solve(f3 - 6, x, dict=True))
入出力結果(Terminal, IPython)
$ ./sample3.py True True True ⎡⎧ ⎛-48 ⎞⎫ ⎧ ⎛-48 ⎞⎫⎤ ⎢⎪ 2⋅acos⎜────⎟⎪ ⎪ 2⋅acos⎜────⎟⎪⎥ ⎢⎪ ⎜ 3 ⎟⎪ ⎪ ⎜ 3 ⎟⎪⎥ ⎢⎨ ⎝ π ⎠⎬ ⎨ ⎝ π ⎠⎬⎥ ⎢⎪x: ────────────⎪, ⎪x: 4 - ────────────⎪⎥ ⎢⎪ π ⎪ ⎪ π ⎪⎥ ⎣⎩ ⎭ ⎩ ⎭⎦ $
0 コメント:
コメントを投稿