How this calculator works
Factor the squared coefficient from the quadratic and linear terms. Half the remaining linear coefficient is the shift inside the square. Adding its square inside requires subtracting a times that amount outside. This produces a(x-h)²+k. Practice mode checks your proposed h and k independently, using a relative tolerance of 10^-9 with an absolute tolerance of 10^-9 near zero. Worked results remain visible as immediate feedback. Solving the completed expression equal to zero also reveals real or complex roots.
Formula
h=-b/(2a); k=c-b²/(4a); ax²+bx+c=a(x-h)²+k. Roots: x=h±√(-k/a), with imaginary offsets when -k/a<0.
Worked example
For x²+6x+5, half of 6 is 3 and its square is 9. Thus x²+6x+5=(x+3)²-4, so h=-3, k=-4 and the roots are -5 and -1. For 2x²-8x+3, the result is 2(x-2)²-5.
Advertisement
Frequently asked questions
Why is my h the opposite sign of the bracket constant?
Vertex form uses x-h. A bracket x+3 therefore corresponds to h=-3, not h=3.
Does a negative a prevent square completion?
No. Any non-zero a works. Its sign affects the opening direction and the outside constant adjustment.
Can I practise an equation with no real roots?
Yes. Completing the square still works. A negative value of -k/a produces a conjugate pair of complex roots.