## 2019年10月7日月曜日

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

1. $\begin{array}{l}{9}^{x}+{3}^{x}>12\\ {3}^{2x}+{3}^{x}>12\\ {\left({3}^{x}\right)}^{2}+{3}^{x}-12>0\\ \left({3}^{x}+4\right)\left({3}^{x}-3\right)>0\\ 3<{3}^{x}\\ x>1\end{array}$

2. $\begin{array}{l}{4}^{x}-3·{2}^{\left(x+2\right)}+32\ge 0\\ {\left({2}^{x}\right)}^{2}-12·{2}^{x}+32\ge 0\\ \left({2}^{x}-4\right)\left({2}^{x}-8\right)\ge 0\\ 0<{2}^{x}\le 4,8\le {2}^{x}\\ x\le 2,3\le x\end{array}$

3. $\begin{array}{l}{\left({\mathrm{log}}_{10}x\right)}^{2}<{\mathrm{log}}_{10}{x}^{2}\\ {\left({\mathrm{log}}_{10}x\right)}^{2}-2{\mathrm{log}}_{10}x<0\\ \left({\mathrm{log}}_{10}x\right)\left({\mathrm{log}}_{10}x-2\right)<0\\ 0<{\mathrm{log}}_{10}x<2\\ 1

4. ${\mathrm{log}}_{2}x\ge \frac{{\mathrm{log}}_{2}2}{{\mathrm{log}}_{2}x}=\frac{1}{{\mathrm{log}}_{2}x}$

場合分け。

$\begin{array}{l}{\mathrm{log}}_{2}x<0\\ x<1\\ {\left({\mathrm{log}}_{2}x\right)}^{2}\le 1\\ {\left({\mathrm{log}}_{2}x\right)}^{2}-1\le 0\\ -1\le {\mathrm{log}}_{2}x<0\\ \frac{1}{2}\le x<1\\ {\mathrm{log}}_{2}x>0\\ x>1\\ {\left({\mathrm{log}}_{2}x\right)}^{2}-1\ge 0\\ {\mathrm{log}}_{2}x\le -1,1\le {\mathrm{log}}_{2}x\\ 2\le x\end{array}$

よって、求める x の値の範囲は、

$\frac{1}{2}\le x<1,2\le x$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, log
from sympy.solvers.inequalities import reduce_inequalities

print('33.')

x = symbols('x', positive=True)
inequalities = [9 ** x + 3 ** x > 12,
4 ** x - 3 * 2 ** (x + 2) + 32 >= 0,
log(x, 10) ** 2 < log(x ** 2, 10),
log(x, 2) >= log(2, x)]

for i, inequality in enumerate(inequalities, 1):
print(f'({i})')
try:
pprint(reduce_inequalities(inequality, x))
except Exception as err:
print(err)
print()


$./sample33.py 33. (1) 1 < x (2) 3 ≤ x ∨ x ≤ 2 (3) 1 < x ∧ x < 100 (4) (1/2 ≤ x ∧ x < 1) ∨ 2 ≤ x$