学習環境
微分積分学 (ちくま学芸文庫) (吉田 洋一(著)、筑摩書房)のⅡ.(微分法の公式)、5.(無理関数の導関数)、問1の解答を求めてみる。
ddx3√(1+x+x2)2=23(1+x+x2)-13(1+2x)
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, root, Derivative, Rational, plot
print('1.')
x = symbols('x')
fs = [x ** -Rational(4, 3),
root((1 + x + x ** 2) ** 2, 3)]
for i, f in enumerate(fs, 1):
d = Derivative(f, x, 1)
for o in [f'({i})', d, d.doit()]:
pprint(o)
print()
p = plot((fs[0], (x, 0.1, 5)),
(fs[1], (x, -5, 5)),
ylim=(0, 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 ⎛ 1 ⎞
──⎜────⎟
dx⎜ 4/3⎟
⎝x ⎠
-4
──────
7/3
3⋅x
(2)
⎛ _______________⎞
⎜ ╱ 2 ⎟
d ⎜3 ╱ ⎛ 2 ⎞ ⎟
──⎝╲╱ ⎝x + x + 1⎠ ⎠
dx
_______________
╱ 2
3 ╱ ⎛ 2 ⎞
(4⋅x + 2)⋅╲╱ ⎝x + x + 1⎠
─────────────────────────────
⎛ 2 ⎞
3⋅⎝x + x + 1⎠
$
0 コメント:
コメントを投稿