学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ)
- 参考書籍
解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第3部(積分)、第11章(積分の計算)、4(部分分数)、練習問題1.を取り組んでみる。
よって、
コード(Emacs)
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, solve
print('1.')
x = symbols('x')
cs = symbols(','.join([f'c{i}' for i in range(1, 6)]))
c1, c2, c3, c4, c5 = cs
l = (2 * x + 5) / ((x ** 2 + 1) ** 2 * (x - 3))
r = (c1 + c2 * x) / (x ** 2 + 1) + (c3 + c4 * x) / \
(x ** 2 + 1) ** 2 + c5 / (x - 3)
s = solve(l - r, cs, dict=True)
for t in [l, r, s]:
pprint(t)
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample1.py
1.
2⋅x + 5
─────────────────
2
⎛ 2 ⎞
(x - 3)⋅⎝x + 1⎠
c₅ c₁ + c₂⋅x c₃ + c₄⋅x
───── + ───────── + ─────────
x - 3 2 2
x + 1 ⎛ 2 ⎞
⎝x + 1⎠
⎡⎧ -33 -11 -13 -11 11⎫⎤
⎢⎨c₁: ────, c₂: ────, c₃: ────, c₄: ────, c₅: ───⎬⎥
⎣⎩ 100 100 10 10 100⎭⎦
$
0 コメント:
コメントを投稿