Complete the square
Enter the coefficients from ax² + bx + c = 0. The leading coefficient a must not be zero.
About completing the square
Completing the square rewrites a quadratic expression so that part of it is a perfect square. A standard quadratic has the form ax² + bx + c, where a is not zero. Its completed-square or vertex form is a(x - h)² + k. The values h and k give the vertex of the parabola directly, making the form useful for graphing, optimization, solving equations, and understanding how changes in coefficients move a quadratic curve.
The conversion begins by factoring a from the x terms when the leading coefficient is not one. The coefficient of x inside the parentheses is then halved and squared. Adding and subtracting that square preserves the expression while creating a perfect-square trinomial. Algebraically, h equals -b divided by 2a, and k equals c minus b² divided by 4a. Substituting these values gives a(x - h)² + k without changing the original quadratic.
This calculator applies those canonical formulas directly. It displays the completed-square equation, the vertex, the discriminant, and the roots. The discriminant is b² - 4ac. A positive discriminant produces two distinct real roots, zero produces one repeated real root, and a negative discriminant produces a conjugate pair of complex roots. Showing all these properties together makes it easier to connect standard form, vertex form, and the quadratic formula.
To solve from completed-square form, isolate the squared factor. Starting with a(x - h)² + k = 0, subtract k, divide by a, and take both the positive and negative square roots. Finally add h. This procedure is the conceptual basis for the quadratic formula. If the isolated value is negative, its square root introduces i, the imaginary unit, and the equation has no real x-intercepts even though it still has two complex roots when multiplicity is counted.
Signs deserve careful attention. If h is negative, the factor x - h appears visually as subtraction of a negative number, which is equivalent to addition. Likewise, k may be negative even though the displayed template includes a plus sign. The numerical form remains algebraically correct, and substituting or expanding it recovers the original coefficients. Decimal output is rounded to eight places for readability, while calculations use JavaScript double-precision arithmetic.
Completing the square is useful beyond textbook equation solving. It reveals the maximum or minimum value of a quadratic, supports deriving circle equations, helps evaluate Gaussian integrals, and appears in probability and analytic geometry. Use the calculator to check hand calculations, then expand the result by multiplying the squared binomial and combining constants. That reverse check confirms that the completed-square form and original equation represent exactly the same function.
Completing the square FAQ
Why complete the square?
The method reveals a quadratic's vertex and makes its transformations visible. It also solves equations and provides the derivation behind the quadratic formula.
What are h and k in vertex form?
In a(x - h)² + k, the point (h, k) is the parabola's vertex. The vertical line x = h is its axis of symmetry.
Can the leading coefficient be negative?
Yes, any nonzero real value is valid for a. A negative leading coefficient means the parabola opens downward and its vertex is a maximum.
What happens when the discriminant is negative?
The quadratic has no real roots and does not cross the x-axis. It still has two complex conjugate roots, which the calculator displays using i.
How can I verify the completed-square form?
Expand the squared binomial, multiply by a, and combine the constant terms. The resulting coefficients should match the original a, b, and c exactly.