I know how to complete the square with positive $x$ coefficients but how do you complete the square with negative $x$ coefficients?
For example: \begin{align*} f(x) & = x^2 + 6x + 11 \\ & = (x^2 + 6x) + 11 \\ & = (x^2 + 6x + \mathbf{9}) + 11 - \mathbf{9} \\ & = (x+3)^2 + 2. \end{align*} For positive you would add 9 inside the parenthesis and subtract 9 outside. However, I get the wrong answer when I do it with a negative coefficient. Do you do the same thing when there is a negative coefficient in front of $x^2$ or is it the other way around? (subtract inside parenthesis and add outside of parenthesis).
Here is an example of a negative coefficient: $f(x) = -3x^2 + 5x + 1.$ I tried to solve this and entered in my answer online but it was wrong.