ax^2+bx+c
=a(x^2+bx/a)+c
=a(x^2+2*b/2a*x+(b/2a)^2-(b/2a)^2)+c
=a(x+b/2a)^2-a*(b/2a)^2+c
=a(x+b/2a)^2+(4ac-b^2)/4a