## 2019年10月10日木曜日

### 数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 対数関数の性質 - いくつかの例題および問題の補充 - 大小、不等式

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

また、仮定より、

$\begin{array}{l}1

よって、

$\begin{array}{l}{\left({\mathrm{log}}_{a}b\right)}^{2}-{\mathrm{log}}_{a}{b}^{2}<0\\ {\left({\mathrm{log}}_{a}b\right)}^{2}<{\mathrm{log}}_{a}{b}^{2}\end{array}$

また、

${\mathrm{log}}_{a}\left({\mathrm{log}}_{a}b\right)<0$

よって、

${\mathrm{log}}_{a}\left({\mathrm{log}}_{a}b\right)<{\left({\mathrm{log}}_{a}b\right)}^{2}<{\mathrm{log}}_{a}{b}^{2}$

コード

Python 3

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

print('36.')

a = 2
b = 3
fs = [log(log(b, a), a), log(b, a) ** 2, log(b ** 2, a), log(log(b, a), a)]

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

def tearDown(self):
pass

def test_symbol(self):
self.assertTrue(fs[0] < fs[1] < fs[2])

x = symbols('x')
p = plot(*fs, log(x, a), log(x, Rational(1, 2)), log(x, 1),
(x, 0.1, 10),
legend=True,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

for s, color in zip(p, colors):
s.line_color = color

p.show()
p.save(f'sample36.png')

if __name__ == '__main__':
main()


$./sample36.py 36. . ---------------------------------------------------------------------- Ran 1 test in 0.008s OK$