学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第4章(微分法)、4.1(微分法の諸公式)、問題1の解答を求めてみる。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, Derivative, Rational, sqrt
print('1.')
x = symbols('x')
fs = [(2 * x ** 2 - 2 * x + 1) ** 3,
(x ** 2 + 1) ** 10 * (2 * x - 5) ** 4,
(x ** 2 - 2 * x + 6) / (x ** 2 + x + 2),
(3 * x + 2) ** 3 / (2 * x - 1) ** 2,
(x ** 2 + 2 * x) ** Rational(3, 2),
x / sqrt(2 * x ** 2 - 1)]
gs = [3 * (2 * x ** 2 - 2 * x + 1) ** 2 * (4 * x - 2),
4 * (x ** 2 + 1) ** 9 * (2 * x - 5) ** 3 * (12 * x ** 2 - 25 * x + 2),
(3 * x ** 2 - 8 * x - 10) / (x ** 2 + x + 2) ** 2,
(3 * x + 2) ** 2 * (6 * x - 17) / (2 * x - 1) ** 3,
3 * (x ** 2 + 2 * x) ** Rational(1, 2) * (x + 1),
-(2 * x ** 2 - 1) ** Rational(-3, 2)]
for i, (f, g) in enumerate(zip(fs, gs), 1):
print(f'({i})')
f1 = Derivative(f, x, 1)
for o in [f1.doit().factor(), g.factor(), f1.doit().factor() == g.factor()]:
pprint(o)
print()
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample1.py
1.
(1)
2
⎛ 2 ⎞
6⋅(2⋅x - 1)⋅⎝2⋅x - 2⋅x + 1⎠
2
⎛ 2 ⎞
6⋅(2⋅x - 1)⋅⎝2⋅x - 2⋅x + 1⎠
True
(2)
9
3 ⎛ 2 ⎞
4⋅(x - 2)⋅(2⋅x - 5) ⋅(12⋅x - 1)⋅⎝x + 1⎠
9
3 ⎛ 2 ⎞
4⋅(x - 2)⋅(2⋅x - 5) ⋅(12⋅x - 1)⋅⎝x + 1⎠
True
(3)
2
3⋅x - 8⋅x - 10
───────────────
2
⎛ 2 ⎞
⎝x + x + 2⎠
2
3⋅x - 8⋅x - 10
───────────────
2
⎛ 2 ⎞
⎝x + x + 2⎠
True
(4)
2
(3⋅x + 2) ⋅(6⋅x - 17)
─────────────────────
3
(2⋅x - 1)
2
(3⋅x + 2) ⋅(6⋅x - 17)
─────────────────────
3
(2⋅x - 1)
True
(5)
___________
3⋅╲╱ x⋅(x + 2) ⋅(x + 1)
___________
3⋅╲╱ x⋅(x + 2) ⋅(x + 1)
True
(6)
-1
─────────────
3/2
⎛ 2 ⎞
⎝2⋅x - 1⎠
-1
─────────────
3/2
⎛ 2 ⎞
⎝2⋅x - 1⎠
True
C:\Users\...>
0 コメント:
コメントを投稿