Loading [MathJax]/jax/output/HTML-CSS/jax.js

2019年6月14日金曜日

学習環境

解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第4章(微分法)、4.1(微分法の諸公式)、問題1の解答を求めてみる。



    1. 3(2x2-2x+1)2(4x-2)

    2. 10(x2+1)92x(2x-5)4+(x2+1)10·4(2x-5)3·2=(x2+1)9(2x-5)3(20x(2x-5)+(x2+1)8)=(x2+1)9(2x-5)34(5x(2x-5)+(x2+1)2)=4(x2+1)9(2x-5)3(12x2-25x+2)

    3. (2x-2)(x2+x+2)-(x2-2x+6)(2x+1)(x2+x+2)2=3x2+(2-10)x-10(x2+x+2)2=3x2-8x-10(x2+x+2)2

    4. 3(3x+2)23(2x-1)2-(3x+2)3·2(2x-1)·2(2x-1)4=9(3x+2)2(2x-1)-(3x+2)3·4(2x-1)3=(3x+2)2(18x-9-12x-8)(2x-1)3=(3x+2)2(6x-17)(2x-1)3

    5. 32(x2+2x)12(2x+2)=3(x2+2x)12(x+1)

    6. ddxx(2x2-1)-12=(2x2-1)-12+x(-12)(2x2-1)-324x=(2x2-1)-12-2x2(2x2-1)-32=(2x2-1)-32(2x2-1-2x2)=-(2x2-1)-32

コード

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 コメント:

コメントを投稿