Đáp án:
$\begin{array}{l}
A = - {x^2} + 6x - 4\\
= - \left( {{x^2} - 6x + 9} \right) + 9 - 4\\
= - {\left( {x - 3} \right)^2} + 5\\
Do:{\left( {x - 3} \right)^2} \ge 0\forall x\\
\Rightarrow - {\left( {x - 3} \right)^2} \le 0\forall x\\
\Rightarrow - {\left( {x - 3} \right)^2} + 5 \le 5\forall x\\
\Rightarrow GTLN:A = 5 \Leftrightarrow x = 3\\
B = \frac{{2018}}{{{x^2} + 2x + 6}}\\
Do:{x^2} + 2x + 6\\
= {x^2} + 2x + 1 + 5\\
= {\left( {x + 1} \right)^2} + 5 \ge 5\forall x\\
\Rightarrow \frac{1}{{{x^2} + 2x + 6}} \le \frac{1}{5}\\
\Rightarrow \frac{{2018}}{{{x^2} + 2x + 6}} \le \frac{{2018}}{5}\\
\Rightarrow GTLN:B = \frac{{2018}}{5} \Leftrightarrow x = - 1
\end{array}$