How this instrument works
Completing the square rewrites ax² + bx + c as a(x + p)² + q by hunting for the exact square hiding inside the expression. Divide the x-term's coefficient by twice a to get p = b ⁄ 2a, then correct the constant by subtracting a times p squared from c to get q = c − b² ⁄ 4a. Nothing new enters the equation — the transformation repackages the same three numbers into a form where the squared term carries all the curvature and q sits alone as the leftover.
The name is literal: al-Khwarizmi's ninth-century algebra solved quadratics by drawing an actual square of side x, attaching rectangles worth bx along two edges, and adding a small corner square to complete a larger one — geometry that predates the symbolic notation used to write it today. Run that same completion on the general ax² + bx + c and set the result to zero; solving a(x + p)² + q = 0 for x by isolating the square and taking a root is precisely how the quadratic formula is derived.
The value of q by itself tells you where the parabola sits relative to the x-axis without solving anything further: if a and q share a sign the parabola never crosses zero and both roots are complex, if q is exactly zero the vertex sits on the axis and there is one repeated real root, and if they differ in sign two real roots straddle the vertex at x = −p. Only a = 0 breaks the method, since then there is no square left to complete.
- Enter the quadratic's coefficients in a (coefficient of x²), b (coefficient of x), and c (constant) — for 2x² + 8x + 3 that means a = 2, b = 8, c = 3.
- Read p, in a(x + p)² + q — this is the number that slides inside the parenthesis alongside x.
- Read q, in a(x + p)² + q — this is the constant left over once the square is complete, and it also doubles as the parabola's minimum or maximum value.
- Check the answer by expanding a(x + p)² + q back out; it should reproduce the original a, b, and c exactly.
- Keep a away from zero — the sheet flags a = 0, since a linear expression has no square left to complete.
Worked example — completing 2x² + 8x + 3
Take a = 2, b = 8, c = 3. The shift is p = b ⁄ 2a = 8 ⁄ 4 = 2, and the leftover constant is q = c − b² ⁄ 4a = 3 − 64 ⁄ 8 = 3 − 8 = −5. The sheet reports p = 2.0 and q = −5.0, so 2x² + 8x + 3 becomes 2(x + 2)² − 5.
Expanding checks the answer without any new arithmetic: 2(x + 2)² − 5 = 2(x² + 4x + 4) − 5 = 2x² + 8x + 8 − 5 = 2x² + 8x + 3, matching the starting expression term for term. The vertex form also hands over the parabola's lowest point directly — it sits at (−p, q) = (−2, −5), the minimum value 2x² + 8x + 3 can ever take, reached exactly at x = −2.
Questions
Why does completing the square use b ⁄ 2a specifically?
Because a(x + p)² expands to ax² + 2apx + ap², and matching the x-coefficient to b forces 2ap = b, so p = b ⁄ 2a. Once p is fixed, the constant ap² is subtracted back off c to keep the two expressions identical, which is exactly the q = c − b² ⁄ 4a this sheet computes.
How does completing the square lead to the quadratic formula?
Setting a(x + p)² + q = 0 and solving for x reproduces the quadratic formula step by step: x = −p ± √(−q ⁄ a). Substitute p = b ⁄ 2a and q = c − b² ⁄ 4a into that expression and simplify, and the familiar x = (−b ± √(b² − 4ac)) ⁄ 2a falls out — completing the square is the derivation, not a separate shortcut.
What do p and q represent on the parabola's graph?
They locate the vertex. The graph of a(x + p)² + q turns at (−p, q) — for the worked example 2x² + 8x + 3, that vertex sits at (−2, −5), the lowest point the curve reaches since a = 2 is positive and the parabola opens upward.
What is the most common mistake when completing the square?
Forgetting to factor a out of the x² and x terms before halving the coefficient. Squaring b ⁄ 2 instead of dividing by 2a first, or skipping the extra division by a inside q's b² ⁄ 4a term, is the slip that quietly moves the vertex. Whenever a is not 1, both p and q must carry that a in their denominators.
Does completing the square still work when there are no real roots?
Yes — p and q exist for any a, b, and c as long as a is not zero, whether or not the roots are real. If q and a share the same sign, a(x + p)² + q never reaches zero for real x, meaning the roots form a complex-conjugate pair, but the vertex form itself is unaffected either way.
Why can't a be zero in this calculator?
Because a = 0 removes the x² term entirely, leaving only bx + c — a straight line with no square to complete and no vertex to locate. The sheet flags a = 0 rather than returning a meaningless p and q for what is no longer a quadratic.