## 2020年6月30日火曜日

### 数学 - Python - 代数学 - 不等式 - 2次不等式 - 不等式の解、因数分解、判別式

1. $x<-\frac{3}{2},1

2. $x<-\frac{5}{3},4

3. $\begin{array}{l}\left(x-4\right)\left(x+1\right)\ge 0\\ x\le -1,4\le x\end{array}$

4. $\begin{array}{l}\left(x-6\right)\left(x+4\right)<0\\ -4

5. $\begin{array}{l}2{x}^{2}-x-6<0\\ \left(x-2\right)\left(2x+3\right)<0\\ -\frac{3}{2}

6. $\begin{array}{l}3{x}^{2}+x-10>0\\ \left(3x-5\right)\left(x+2\right)>0\\ x<-2,\frac{5}{3}

7. $\begin{array}{l}{\left(x+4\right)}^{2}>0\\ \text{ℝ}\\left\{-4\right\}\end{array}$

8. $\begin{array}{l}{x}^{2}\le 0\\ x=0\end{array}$

9. $\begin{array}{l}\frac{D}{4}=9-20<0\\ \varphi \end{array}$

10. $\begin{array}{l}{\left(2x+3\right)}^{2}-{4}^{2}\le 0\\ \left(2x+3+4\right)\left(2x+3-4\right)\le 0\\ \left(2x+7\right)\left(2x-1\right)\le 0\\ -\frac{7}{2}\le x\le \frac{1}{2}\end{array}$

11. $\begin{array}{l}10{x}^{2}-5x+2>0\\ D=25-80<0\\ \text{ℝ}\end{array}$

12. $\begin{array}{l}3{x}^{2}-4x-3<0\\ 3{x}^{2}-4x-3=0\\ x=\frac{2±\sqrt{13}}{3}\\ \frac{2-\sqrt{13}}{3}

13. $\begin{array}{l}{x}^{2}+2x-35\ge 0\\ \left(x+7\right)\left(x-5\right)\ge 0\\ x<-7,5

14. $\begin{array}{l}{x}^{2}-3x+2+{x}^{2}-6x+8<12x-30\\ 2{x}^{2}-21x+40<0\\ \left(x-8\right)\left(2x-5\right)<0\\ \frac{5}{2}

コード

#!/usr/bin/env python3
from sympy import pprint
from sympy.solvers.inequalities import solve_univariate_inequality
from sympy.abc import x

print('6.')

exprs = [(x - 1) * (2 * x + 3) > 0,
(4 - x) * (3 + 5 * x) < 0,
x ** 2 - 3 * x - 4 >= 0,
x ** 2 - 2 * x - 24 < 0,
x + 6 - 2 * x ** 2 > 0,
10 - 3 * x ** 2 < x,
x ** 2 + 8 * x + 16 > 0,
-2 * x ** 2 >= 0,
4 * x ** 2 + 6 * x + 5 < 0,
(2 * x + 3) ** 2 <= 16,
5 * x - 10 * x ** 2 < 2,
4 * x > 3 * (x ** 2 - 1),
2 * x ** 2 + 3 * x - 10 >= x ** 2 + x + 25,
(x - 1) * (x - 2) + (x - 2) * (x - 4) < 6 * (2 * x - 5)]

for i, expr in enumerate(exprs, 1):
print(f'({i})')
pprint(solve_univariate_inequality(expr, x))


% ./sample6.py
6.
(1)
(-∞ < x ∧ x < -3/2) ∨ (1 < x ∧ x < ∞)
(2)
(-∞ < x ∧ x < -3/5) ∨ (4 < x ∧ x < ∞)
(3)
(4 ≤ x ∧ x < ∞) ∨ (x ≤ -1 ∧ -∞ < x)
(4)
-4 < x ∧ x < 6
(5)
-3/2 < x ∧ x < 2
(6)
(-∞ < x ∧ x < -2) ∨ (5/3 < x ∧ x < ∞)
(7)
x > -∞ ∧ x < ∞ ∧ x ≠ -4
(8)
x = 0
(9)
False
(10)
-7/2 ≤ x ∧ x ≤ 1/2
(11)
-∞ < x ∧ x < ∞
(12)
2   √13   2   √13
x < ─ + ─── ∧ ─ - ─── < x
3    3    3    3
(13)
(5 ≤ x ∧ x < ∞) ∨ (x ≤ -7 ∧ -∞ < x)
(14)
5/2 < x ∧ x < 8
%