Completing the Square Calculator
Rewrite a quadratic in vertex form a(x - h)^2 + k with exact fractions, and print the vertex.
Completing the Square Calculator
Rewrite a quadratic in vertex form a(x - h)^2 + k with exact fractions, and print the vertex.
How this page computes
All coefficients are exact rationals, so the square's inner term and the constant can be fractions. The page prints an exact decimal when the denominator allows it and a reduced fraction otherwise.
The calculation runs entirely in this browser tab; nothing is uploaded.
The page rewrites a times x squared plus b times x plus c in the completed-square form a times (x minus h) squared plus k. For 1, minus 4 and 3 it prints (x minus 2) squared minus 1.
The same two values h and k are the vertex, so the rewritten form and the printed vertex always agree. A zero leading coefficient is refused, because there is no square to complete.
How to use the Completing the Square Calculator
Enter a, b and c separated by spaces, then press Run. The first line is the expanded quadratic and the second is the completed-square form.
The last line gives the vertex. A negative h is written as x plus its magnitude, so (x - -2) never appears in the output.
The rule this page applies
Factor a from the first two terms, add and subtract b squared over 4a inside the bracket, and the bracket becomes a perfect square. The leftover constant is k, and the shift is h equals minus b over 2a.
All coefficients are exact rationals, so the square's inner term and the constant can be fractions. The page prints an exact decimal when the denominator allows it and a reduced fraction otherwise.
What to Expect
Best for
- Rewriting a quadratic in vertex form
- Checking a completing-the-square exercise
- Reading the vertex from the rewritten form
Not ideal for
- Solving the quadratic for its roots
- Graphing the parabola
- Quadratics with a zero leading coefficient
What this tool keeps
- The exact coefficients, the vertex form and the vertex
What may need cleanup
- Nothing: the rewritten form is exact
Common errors
- A zero leading coefficient is refused with the reason
- A non-numeric coefficient is refused by name
Example use cases
- Rewrite x^2 - 4x + 3
- Complete the square with a leading coefficient of 2
Sample input
1 -4 3
Sample output
y = x^2 - 4x + 3 y = (x - 2)^2 - 1 vertex = (2, -1)
Who this is for
- Algebra students
- Readers checking a vertex-form exercise
Frequently asked questions
Why does the page print both forms?
The completed-square form and the vertex are the same information written two ways. Printing both lets the reader check that the bracket and the constant really do give the stated vertex.
What if a is 2?
The page factors the 2 out first, so the bracket is a perfect square and the coefficient stays outside it. The result is still exact, with fractions where they are needed.
How is a negative h written?
As x plus the magnitude, so a vertex at minus 2 prints as (x + 2) squared. That is the standard notation and avoids the double negative of x minus minus 2.
Is anything uploaded?
Nothing is uploaded. The numbers are read and the arithmetic runs in this browser tab with JavaScript, and reloading the page discards both the input and the result.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.