\(xy\left(x-2\right)\left(y+6\right)+12x^2-24x+3y^2+18y+2045.\)
\(=\left(x^2-2x\right)\left(y^2+6y\right)+12\left(x^2-2x\right)+3\left(y^2+6y\right)+2045\)
\(=\left[\left(x^2-2x\right)\left(y^2+6y\right)+3\left(y^2+6y\right)\right]+12\left(x^2-2x+3\right)+2009.\)
\(=\left(x^2-2x+3\right)\left(y^2+6x\right)+12\left(x^2-2x+3\right)+2009\)
\(=\left(x^2-2x+3\right)\left(y^2+6x+12\right)+2009\)
\(=\left[\left(x-1\right)^2+2\right]\left[\left(y+3\right)^2+3\right]+2009\)
Ta có: \(\left(x-1\right)^2\ge0\forall x\Leftrightarrow\left(x-1\right)^2+2\ge2\)
\(\left(y+3\right)^2\ge0\forall y\Leftrightarrow\left(y+3\right)^2+3\ge3\)
Suy ra \(B=\left[\left(x-1\right)^2+2\right]\left[\left(y+3\right)^2+3\right]+2009\ge2.3+2009=2015\)
Vậy GTNN của B=2015 khi x=1, y=-3.