Let $x$ be a real number such that $x^2 + 7x + 12 \le 0.$ Find the largest possible value of $x^2 + 5x + 6.$

I gave up on this problem. The solution stated that once you factor the quadratic in the function (x+4)(x+3) and, you get -4<= x <= -3. Then you complete the square on x^2 + 5x + 6 to get \[x^2 + 5x + 6 = \left( x + \frac{5}{2} \right)^2 - \frac{1}{4}.\] Since the function decreased as it approaches -inf and increased as it approaches inf, the largest possible value of $x^2 + 5x + 6$ on the interval $-4 \le x \le -3$ occurs at $x = -4,$ which is $(-4)^2 + 5 \cdot (-4) + 6 = \boxed{2}.$

If the function increases when x increases, then why is the answer -4?

Coolmonkey Jun 6, 2024