<s>[INST] Find the maximum value of $(x+2) \cdot (12-3x)$ , x is a Real number Question:- Find the maximum value of $(x+2) \cdot (12-3x)$. $x$ is a Real number.
The solution given in the textbook applies AM-GM to solve this
$$3 \cdot (x+2) \cdot (4-x)$$
Now, $x+2 = a$ and $4-x = b$
$a+b=6$
Objective to maximize $3 \cdot a \cdot b$
by AM-GM inequality,
$$\frac{a+b}{2} \geq \sqrt{ab}$$
$$a \cdot b \leq 9$$
Therefore $3 \cdot a \cdot b \leq 27$
But is the solution correct? as we know that while applying AM-GM, the terms should be positive real but $a$ and $b$ are not positive for every $x$ as Real number , if I am correct the range of $(-\infty,-2)$ to $(4, \infty)$ should be given for $a$ and $b$ to be both positive and then apply AM-GM, please suggest if some other way is possible too to solve this.
 [/INST] $(c+x)·(d-x) = \left({c+d\over2}+\left(x+{c-d\over2}\right)\right)·\left({c+d\over2}-\left(x+{c-d\over2}\right)\right) ≤ \left({c+d\over2}\right)^2 $
Above identity is always true, thus no need to check where x is.
$3·(2+x)·(4-x) ≤ 3·\left({2+4\over2}\right)^2 = 3^3 = 27$
</s>