学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
微分積分学 (ちくま学芸文庫) (吉田 洋一(著)、筑摩書房)のⅡ.(微分法の公式)、3.(有理関数とその導関数)、問1の解答を求めてみる。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, Derivative, plot
print('1.')
x, a, n = symbols('x, a, n', real=True)
fs = [x ** 3 - 3 * x,
x ** 4 - 6 * x ** 2 + 3,
1 / (1 + 2 * a * x + x ** 2),
x ** n / (1 - x ** n)]
for i, f in enumerate(fs, 1):
print(f'({i})')
d = Derivative(f, x, 1)
for o in [d, d.doit()]:
pprint(o.factor())
print()
p = plot(*[f.subs({a: 2, n: 3}) for f in fs],
ylim=(-10, 10),
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('sample1.png')
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
$ ./sample1.py
1.
(1)
d ⎛ 3 ⎞
──⎝x - 3⋅x⎠
dx
3⋅(x - 1)⋅(x + 1)
(2)
d ⎛ 4 2 ⎞
──⎝x - 6⋅x + 3⎠
dx
⎛ 2 ⎞
4⋅x⋅⎝x - 3⎠
(3)
∂ ⎛ 1 ⎞
──⎜──────────────⎟
∂x⎜ 2 ⎟
⎝2⋅a⋅x + x + 1⎠
-2⋅(a + x)
─────────────────
2
⎛ 2 ⎞
⎝2⋅a⋅x + x + 1⎠
(4)
⎛ n ⎞
∂ ⎜ x ⎟
──⎜──────⎟
∂x⎜ n⎟
⎝1 - x ⎠
n
n⋅x
───────────
2
⎛ n ⎞
x⋅⎝x - 1⎠
$
0 コメント:
コメントを投稿