2018年10月13日土曜日

学習環境

数学読本〈1〉数・式の計算/方程式/不等式 (松坂 和夫(著)、岩波書店)の第2章(文字と記号の活躍 - 式の計算)、2.3(分数式の演算と分数式)、分数式の演算の問19.を取り組んでみる。



    1. a c - b c + a b - a c + b c - a b a b c = 0

    2. x - 1 x 2 - 1 = 1 x + 1

    3. x + 2 - 4 x - 2 = 1

    4. x - 1 - 2 x x + 1 x - 1 = - x - 1 x + 1 x - 1 = - 1 x - 1

    5. x 2 + 3 x + 2 - 2 x x + 1 - 3 x 2 + 4 x x + 1 = x 2 + x + 2 x + 1 - 3 x 2 + 4 x x + 1 = x 3 + x 2 + 2 x - 3 x 2 - 4 x x + 1 = x 3 - 2 x 2 + 2 x - 4 x x + 1 = x - 2 x 2 + 2 x x + 1

    6. x 2 - x - 2 - x 2 + x - 1 + x 2 + x + 3 x + 1 x 2 - x + 1 = x 2 + x x + 1 x 2 - x + 1 = x x 2 - x + 1

    7. 1 x - 1 x - 2 + 2 2 x + 1 x - 1 - 3 2 x + 1 x - 2 = 2 x + 1 + 2 x - 4 - 3 x + 3 x - 1 x - 2 2 x + 1 = x x - 1 x - 2 2 x + 1

    8. 1 x x + 1 + - x - 3 + x + 2 x + 2 x + 3 = 1 x x + 1 - 1 x + 2 x + 3 = x 2 + 5 x + 6 - x 2 - x x x + 1 x + 2 x + 3 = 2 2 x + 3 x x + 1 x + 2 x + 3

    9. 2 a a 2 - 1 + 2 a a 2 + 1 + 4 a 3 a 4 + 1 = 4 a 3 a 4 - 1 + 4 a 3 a 4 + 1 = 8 a 7 a 8 - 1 = 8 a 7 a + 1 a - 1 a 2 + 1 a 4 + 1

    10. x + 2 + x x x + 1 x + 2 + 1 x + 2 x + 3 = 2 x x + 2 + 1 x + 2 x + 3 = 2 x + 6 + x x x + 2 x + 3 = 3 x x + 3

    11. - a b - c - b c - a - c a - b a - b b - c c - a = 0

    12. - b - c b + 1 - c - a a + 1 a - b b - c c - a a + 1 b + 1 = - b 2 - b + b c + c - c a - c + a 2 + a a - b b - c c - a a + 1 b + 1 = - b 2 - b + b c + a 2 - c a + a a - b b - c c - a a + 1 b + 1 = a + b a - b + 1 - c a - b a - b b - c c - a a + 1 b + 1 = a + b - c + 1 b - c c - a a + 1 b + 1

      残りの計算。

      a + b - c + 1 c + 1 - a + 1 b + 1 b - c c - a a + 1 b + 1 c + 1

      分子の計算。

      - c 2 + a + b c + a + b + 1 - a b - a - b - 1 = - c 2 + a + b c - a b = - c 2 - a + b c + a b = - c - a c - b = b - c c - a

      よって求める計算結果は

      1 a + 1 b + 1 c + 1

コード(Emacs)

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, gcd, lcm

print('19.')

a, b, c, x = symbols('a, b, c, x')

ts = [(a - b) / (a * b) + (b - c) / (b * c) + (c - a) / (c * a),
      x / (x ** 2 - 1) - 1 / (x ** 2 - 1),
      (x + 2) / (x - 2) + 4 / (2 - x),
      1 / (x + 1) - 2 * x / (x ** 2 - 1),
      x + 2 - 2 * x / (x + 1) - (3 * x ** 2 + 4) / (x * (x + 1)),
      (x - 2) / (x ** 2 - x + 1) - 1 /
      (x + 1) + (x ** 2 + x + 3) / (x ** 3 + 1),
      1 / (x ** 2 - 3 * x + 2) + 2 / (2 * x ** 2 - x - 1) -
      3 / (2 * x ** 2 - 3 * x - 2),
      1 / x - 1 / (x + 1) - 1 / (x + 2) + 1 / (x + 3),
      1 / (a - 1) + 1 / (a + 1) + 2 * a /
      (a ** 2 + 1) + 4 * a ** 3 / (a ** 4 + 1),
      1 / (x * (x + 1)) + 1 / ((x + 1) * (x + 2)) + 1 / ((x + 2) * (x + 3)),
      a / ((a - b) * (a - c)) + b /
      ((b - c) * (b - a)) + c / ((c - a) * (c - b)),
      1 / ((a - b) * (a - c) * (a + 1)) + 1 / ((b - c) * (b - a) * (b + 1)) + 1 / ((c - a) * (c - b) * (c + 1))]

for i, t in enumerate(ts, 1):
    print(f'({i})')
    pprint(t.factor())
    print()

入出力結果(Terminal, Jupyter(IPython))

$ ./sample19.py
19.
(1)
0

(2)
  1  
─────
x + 1

(3)
1

(4)
 -1  
─────
x - 1

(5)
        ⎛ 2    ⎞
(x - 2)⋅⎝x  + 2⎠
────────────────
   x⋅(x + 1)    

(6)
    x     
──────────
 2        
x  - x + 1

(7)
            x            
─────────────────────────
(x - 2)⋅(x - 1)⋅(2⋅x + 1)

(8)
       2⋅(2⋅x + 3)       
─────────────────────────
x⋅(x + 1)⋅(x + 2)⋅(x + 3)

(9)
                  7              
               8⋅a               
─────────────────────────────────
                ⎛ 2    ⎞ ⎛ 4    ⎞
(a - 1)⋅(a + 1)⋅⎝a  + 1⎠⋅⎝a  + 1⎠

(10)
    3    
─────────
x⋅(x + 3)

(11)
0

(12)
           1           
───────────────────────
(a + 1)⋅(b + 1)⋅(c + 1)

$

0 コメント:

コメントを投稿

関連コンテンツ