Given
color(white)("XXX")y=color(magneta)((x-3)^2)-2x^2-x-2XXXy=(x−3)2−2x2−x−2
Expanding
color(white)("XXX")y=color(magenta)(x^2-6x+9)-2x^2-x-2XXXy=x2−6x+9−2x2−x−2
and simplifying
color(white)("XXX")y=-x^2-7x+7XXXy=−x2−7x+7
We would like to convert this into vertex form: y=color(green)m(x-color(red)a)^2+color(blue)by=m(x−a)2+b
with vertex at (color(red)a,color(blue)b)(a,b)
First extract the color(green)mm factor from the first 2 terms
color(white)("XXX")y=color(green)(""(-1))(x^2+7x)+7XXXy=(−1)(x2+7x)+7
Complete the square
color(white)("XXX")y=color(green)(""(-1))(x^2+7xcolor(brown)(+(7/2)^2))+7color(brown)(-color(green)(""(-1))(7/2)^2)XXXy=(−1)(x2+7x+(72)2)+7−(−1)(72)2
color(white)("XXX")y=color(green)(""(-1))(x+7/2)^2+7+49/4XXXy=(−1)(x+72)2+7+494
color(white)("XXX")y=color(green)(""(-1))(x-color(red)(""(-7/2)))^2+color(blue)(77/4)XXXy=(−1)(x−(−72))2+774
which is the vertex form with vertex at (color(red)(-7/2),color(blue)(77/4))=(color(red)(-3 1/2),color(blue)(19 1/4))(−72,774)=(−312,1914)