学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
微分積分学 (ちくま学芸文庫) (吉田 洋一(著)、筑摩書房)のI.(微分法)、6.(導関数)、問1の解答を求めてみる。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Derivative, Limit, Rational
print('1.')
x, h = symbols('x, h')
fs = [1 - x ** 2,
x ** 3,
x + 1 / x,
x ** 3 - 3 * x ** 2 + 2,
3 * x - x ** 3,
x ** Rational(1, 3)]
for i, f in enumerate(fs, 1):
print(f'({i})')
df = Derivative(f, x, 1)
for o in [df, df.doit()]:
pprint(o)
print()
g = (f.subs({x: x + h}) - f) / h
for d in ['+', '-']:
l = Limit(g, h, 0, dir=d)
for o in [l, l.doit()]:
pprint(o)
print()
p = plot(*fs,
(x, -5, 5),
ylim=(-5, 5),
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))
C:\Users\...>py sample1.py
1.
(1)
d ⎛ 2⎞
──⎝1 - x ⎠
dx
-2⋅x
⎛ 2 2⎞
⎜x - (h + x) ⎟
lim ⎜─────────────⎟
h─→0⁺⎝ h ⎠
-2⋅x
⎛ 2 2⎞
⎜x - (h + x) ⎟
lim ⎜─────────────⎟
h─→0⁻⎝ h ⎠
-2⋅x
(2)
d ⎛ 3⎞
──⎝x ⎠
dx
2
3⋅x
⎛ 3 3⎞
⎜- x + (h + x) ⎟
lim ⎜───────────────⎟
h─→0⁺⎝ h ⎠
2
3⋅x
⎛ 3 3⎞
⎜- x + (h + x) ⎟
lim ⎜───────────────⎟
h─→0⁻⎝ h ⎠
2
3⋅x
(3)
d ⎛ 1⎞
──⎜x + ─⎟
dx⎝ x⎠
1
1 - ──
2
x
⎛ 1 1⎞
⎜h + ───── - ─⎟
⎜ h + x x⎟
lim ⎜─────────────⎟
h─→0⁺⎝ h ⎠
2
x - 1
──────
2
x
⎛ 1 1⎞
⎜h + ───── - ─⎟
⎜ h + x x⎟
lim ⎜─────────────⎟
h─→0⁻⎝ h ⎠
2
x - 1
──────
2
x
(4)
d ⎛ 3 2 ⎞
──⎝x - 3⋅x + 2⎠
dx
2
3⋅x - 6⋅x
⎛ 3 2 3 2⎞
⎜- x + 3⋅x + (h + x) - 3⋅(h + x) ⎟
lim ⎜───────────────────────────────────⎟
h─→0⁺⎝ h ⎠
2
3⋅x - 6⋅x
⎛ 3 2 3 2⎞
⎜- x + 3⋅x + (h + x) - 3⋅(h + x) ⎟
lim ⎜───────────────────────────────────⎟
h─→0⁻⎝ h ⎠
2
3⋅x - 6⋅x
(5)
d ⎛ 3 ⎞
──⎝- x + 3⋅x⎠
dx
2
3 - 3⋅x
⎛ 3 3⎞
⎜3⋅h + x - (h + x) ⎟
lim ⎜───────────────────⎟
h─→0⁺⎝ h ⎠
2
3 - 3⋅x
⎛ 3 3⎞
⎜3⋅h + x - (h + x) ⎟
lim ⎜───────────────────⎟
h─→0⁻⎝ h ⎠
2
3 - 3⋅x
(6)
d ⎛3 ___⎞
──⎝╲╱ x ⎠
dx
1
──────
2/3
3⋅x
⎛ 3 ___ 3 _______⎞
⎜- ╲╱ x + ╲╱ h + x ⎟
lim ⎜───────────────────⎟
h─→0⁺⎝ h ⎠
1
──────
2/3
3⋅x
⎛ 3 ___ 3 _______⎞
⎜- ╲╱ x + ╲╱ h + x ⎟
lim ⎜───────────────────⎟
h─→0⁻⎝ h ⎠
1
──────
2/3
3⋅x
c:\Users\...>
0 コメント:
コメントを投稿