## 2020年8月7日金曜日

### 数学 - Python - 代数学 - 不等式 - 不等式の証明、平方、式の変形、展開、差

1. $AB-xy$
$=\frac{ax+by}{a+b}·\frac{bx+ay}{a+b}-xy$
$=\frac{ab{x}^{2}+\left({a}^{2}+{b}^{2}\right)xy+ab{y}^{2}}{{\left(a+b\right)}^{2}}-xy$
$=\frac{ab{x}^{2}+\left({a}^{2}+{b}^{2}-{\left(a+b\right)}^{2}\right)xy+ab{y}^{2}}{{\left(a+b\right)}^{2}}$
$=\frac{ab{x}^{2}-2abxy+ab{y}^{2}}{{\left(a+b\right)}^{2}}$
$=\frac{ab\left({x}^{2}-2xy+{y}^{2}\right)}{{\left(a+b\right)}^{2}}$
$=\frac{ab{\left(x-y\right)}^{2}}{{\left(a+b\right)}^{2}}$
$\ge 0$

よって、

$AB\ge xy$

（証明終）

2. $\left({A}^{2}+{B}^{2}\right)-\left({x}^{2}+{y}^{2}\right)$
$={\left(\frac{ax+by}{a+b}\right)}^{2}+{\left(\frac{bx+ay}{a+b}\right)}^{2}-{x}^{2}-{y}^{2}$
$=\frac{\left({a}^{2}+{b}^{2}\right){x}^{2}+4abxy+\left({a}^{2}+{b}^{2}\right){y}^{2}}{{\left(a+b\right)}^{2}}-{x}^{2}-{y}^{2}$
$=\frac{\left({a}^{2}+{b}^{2}-{\left(a+b\right)}^{2}\right){x}^{2}+4abxy+\left({a}^{2}+{b}^{2}-{\left(a+b\right)}^{2}\right){y}^{2}}{{\left(a+b\right)}^{2}}$
$=\frac{-2ab{x}^{2}+4abxy-2ab{y}^{2}}{{\left(a+b\right)}^{2}}$
$=\frac{-2ab{\left(x-y\right)}^{2}}{{\left(a+b\right)}^{2}}$
$\le 0$

よって、

${x}^{2}+{y}^{2}\ge {A}^{2}+{B}^{2}$

コード

#!/usr/bin/env python3
from sympy.plotting import plot3d
from sympy.abc import x, y

print('16.')

a = 2
b = 3
A = (a * x + b * y) / (a + b)
B = (b * x + a * y) / (a + b)

p = plot3d(A * B, x * y, show=False)
p.xlabel = x
p.ylabel = y
p.save('sample16_1.png')
p = plot3d(x ** 2 + y ** 2, A ** 2 + B ** 2, show=False)
p.save('sample16_2.png')
p.show()


% ./sample16.py
16.
%