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.
 A: You are right, there's something missing, but we can fix the argument by restricting the domain.

*

*First and foremost, $f(x)<0$ for $x>4\lor x<-2$ and $f(x)\ge 0$ for $-2\le x\le 4$, therefore for the purpose of finding the maximum value we only need to consider $-2\le x\le 4$. For those values of $x$, we have that $x+2\ge 0$ and $4-x\ge 0$, therefore the discussion carries on correctly.


*The final step is missing: we have proved that, for $-2\le x\le4$, $$\sqrt{\frac13 f(x)}=GM(x)\le AM(x)=3$$ We still need to prove that there is some $x\in [-2,4]$ for which $AM(x)=GM(x)$. As we know, this is the case if and only if $a(x)=b(x)$, which is fortunately for $x=1\in [-2,4]$.
A: Technically, as you mentioned, you cannot directly use AM-GM in this case. But we can just use the inequality $$(a+b)^2 \geq 4ab$$ instead. This inequality holds for any real numbers $a$ and $b$, since
\begin{align*}
(a+b)^2 &= a^2 + 2ab + b^2 \\
&= (a^2 - 2ab + b^2) + 4ab \\
&= (a-b)^2 + 4ab \\
&\geq 0 + 4ab \\
&= 4ab.
\end{align*}
A: It is a high-school result that the extremum of a quadratic polynomial with two real roots $\alpha,\beta$ is attained at $$\xi=\frac{\alpha+\beta}2.$$
Furhermore, this extremum is a maximum if the leading coefficient is negative, a minimum if the  leading coefficient is positive.
Here,  $\alpha=-2,\;\beta=4$ and the leading coefficient is negative. Hence, we'll have a maximum, attained at $\xi=1$, and you obtain
$$M=f(1)=3\cdot 9=27.$$
A: $(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$
