## 2019年9月25日水曜日

### 数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 対数関数の性質 - 底の変換公式 - 底の累乗、真数の累乗、等式の証明

1. $\begin{array}{l}{\mathrm{log}}_{{a}^{p}}{b}^{p}\\ =\frac{{\mathrm{log}}_{a}{b}^{p}}{{\mathrm{log}}_{a}{a}^{p}}\\ =\frac{p{\mathrm{log}}_{a}b}{p{\mathrm{log}}_{a}a}\\ ={\mathrm{log}}_{a}b\end{array}$

（証明終）

2. $\begin{array}{l}{a}^{{\mathrm{log}}_{c}b}\\ ={\left({c}^{{\mathrm{log}}_{c}a}\right)}^{{\mathrm{log}}_{c}b}\\ ={c}^{\left({\mathrm{log}}_{c}a\right)\left({\mathrm{log}}_{c}b\right)}\\ ={\left({c}^{{\mathrm{log}}_{c}b}\right)}^{{\mathrm{log}}_{c}a}\\ ={b}^{{\mathrm{log}}_{c}a}\end{array}$

（証明終）

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, log, Rational
from unittest import TestCase, main

print('25.')

class MyTestCase(TestCase):
def setUp(self):
pass

def tearDown(self):
pass

def test(self):
a = 2
b = 3
c = 4
p = 5
spam = [(log(b ** p, a ** p), log(b, a)),
(a ** log(b, c), b ** log(a, c))]
for s, t in spam:
self.assertEqual(s.simplify(), t.simplify())

if __name__ == '__main__':
main()


$./sample25.py 25. . ---------------------------------------------------------------------- Ran 1 test in 0.214s OK$