## 2019年6月14日金曜日

### 数学 - Python - 解析学 - 微分法 - 微分法の諸公式(定数倍、和、積、商、合成関数、有理数を指数とする累乗)

1. $3{\left(2{x}^{2}-2x+1\right)}^{2}\left(4x-2\right)$

2. $\begin{array}{l}10{\left({x}^{2}+1\right)}^{9}2x{\left(2x-5\right)}^{4}+{\left({x}^{2}+1\right)}^{10}·4{\left(2x-5\right)}^{3}·2\\ ={\left({x}^{2}+1\right)}^{9}{\left(2x-5\right)}^{3}\left(20x\left(2x-5\right)+\left({x}^{2}+1\right)8\right)\\ ={\left({x}^{2}+1\right)}^{9}{\left(2x-5\right)}^{3}4\left(5x\left(2x-5\right)+\left({x}^{2}+1\right)2\right)\\ =4{\left({x}^{2}+1\right)}^{9}{\left(2x-5\right)}^{3}\left(12{x}^{2}-25x+2\right)\end{array}$

3. $\begin{array}{l}\frac{\left(2x-2\right)\left({x}^{2}+x+2\right)-\left({x}^{2}-2x+6\right)\left(2x+1\right)}{{\left({x}^{2}+x+2\right)}^{2}}\\ =\frac{3{x}^{2}+\left(2-10\right)x-10}{{\left({x}^{2}+x+2\right)}^{2}}\\ =\frac{3{x}^{2}-8x-10}{{\left({x}^{2}+x+2\right)}^{2}}\end{array}$

4. $\begin{array}{l}\frac{3{\left(3x+2\right)}^{2}3{\left(2x-1\right)}^{2}-{\left(3x+2\right)}^{3}·2\left(2x-1\right)·2}{{\left(2x-1\right)}^{4}}\\ =\frac{9{\left(3x+2\right)}^{2}\left(2x-1\right)-{\left(3x+2\right)}^{3}·4}{{\left(2x-1\right)}^{3}}\\ =\frac{{\left(3x+2\right)}^{2}\left(18x-9-12x-8\right)}{{\left(2x-1\right)}^{3}}\\ =\frac{{\left(3x+2\right)}^{2}\left(6x-17\right)}{{\left(2x-1\right)}^{3}}\end{array}$

5. $\begin{array}{l}\frac{3}{2}{\left({x}^{2}+2x\right)}^{\frac{1}{2}}\left(2x+2\right)\\ =3{\left({x}^{2}+2x\right)}^{\frac{1}{2}}\left(x+1\right)\end{array}$

6. $\begin{array}{l}\frac{d}{\mathrm{dx}}x{\left(2{x}^{2}-1\right)}^{-\frac{1}{2}}\\ ={\left(2{x}^{2}-1\right)}^{-\frac{1}{2}}+x\left(-\frac{1}{2}\right){\left(2{x}^{2}-1\right)}^{-\frac{3}{2}}4x\\ ={\left(2{x}^{2}-1\right)}^{-\frac{1}{2}}-2{x}^{2}{\left(2{x}^{2}-1\right)}^{-\frac{3}{2}}\\ ={\left(2{x}^{2}-1\right)}^{-\frac{3}{2}}\left(2{x}^{2}-1-2{x}^{2}\right)\\ =-{\left(2{x}^{2}-1\right)}^{-\frac{3}{2}}\end{array}$

コード

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()


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\...>