Completing the Square Calculator
Convert any quadratic to vertex form. Find h, k, and the vertex with step-by-step algebra. Free online math tool.
Completing the Square Calculator
Background.
Completing the square is the algebraic process of rewriting a quadratic expression from standard form ax² + bx + c into vertex form a(x − h)² + k. This transformation reveals the vertex of the parabola, the axis of symmetry, and whether the quadratic opens upward or downward. A calculator that automates this process is indispensable for students graphing parabolas, engineers optimizing quadratic cost functions, and physicists analyzing projectile trajectories. The vertex form immediately identifies the maximum or minimum value of the quadratic without requiring calculus or root-finding algorithms.
High school algebra students and introductory calculus learners are the primary search audience for this tool. In the United States, the Common Core State Standards for Mathematics require students to complete the square to derive the quadratic formula and to identify key features of parabolas from their equations. College algebra and precalculus courses extend this skill to finding circles, ellipses, and hyperbolas in standard position by completing the square in multiple variables. Physics students encounter the method when converting the kinematic equation for vertical position, y = y₀ + v₀t − ½gt², into a form that reveals the time and height of maximum ascent.
The historical origins of completing the square trace back to Al-Khwarizmi's Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala (circa 820 CE), where geometric figures were literally cut and rearranged to form perfect squares. The modern symbolic treatment emerged during the sixteenth century with the development of algebraic notation by François Viète and later René Descartes. Today, completing the square is taught as a foundational skill before the quadratic formula because the formula itself is derived by applying the method to the general equation ax² + bx + c = 0. Understanding the derivation deepens student comprehension of why the discriminant b² − 4ac governs the nature of the roots.
In optimization and operations research, completing the square provides a direct path to the extremum of a quadratic objective function. A production cost model such as C(q) = 2q² − 24q + 100 can be rewritten as 2(q − 6)² + 28, revealing immediately that the minimum cost is 28 when the quantity q equals 6. This is faster than computing derivatives for users who have not studied calculus, and it reinforces the connection between algebraic structure and geometric meaning. The calculator serves this audience by delivering h and k instantly, along with the vertex coordinates that define the optimal operating point. In portfolio theory, the variance of a two-asset portfolio is a quadratic function of the weight allocated to each asset, and completing the square identifies the minimum-variance portfolio weight without requiring numerical optimization software.
Signal processing and control theory also rely on completing the square, albeit in more advanced forms. In state-space control design, the algebraic Riccati equation is solved by completing the square in matrix variables, producing the linear-quadratic regulator that stabilizes aircraft and robotic systems. In probability theory, completing the square in the exponent converts general Gaussian densities into standard normal form, a step essential for computing cumulative probabilities and Bayesian posterior distributions. While the calculator handles only the scalar case, the conceptual foundation is identical: isolating a perfect square reveals the structure of the solution and simplifies integration over infinite domains.
Computer graphics and computational geometry use completing the square to find the center and radius of a circle from its general equation x² + y² + Dx + Ey + F = 0. Grouping x terms and y terms separately and completing the square in each variable converts the equation to standard form, revealing the center (−D/2, −E/2) and radius √(D²/4 + E²/4 − F). This is the same algebraic technique the calculator performs on a single variable, extended to two dimensions. Game engines and CAD software execute millions of these conversions per second when rendering curves and detecting collisions.
What is completing the square calculator?
Completing the square is an algebraic technique that rewrites a quadratic polynomial ax² + bx + c as a perfect square trinomial plus a constant correction term. The goal is to identify a value h such that ax² + bx can be expressed as a(x − h)² minus some compensating amount. When the correction is combined with the original constant c, the result is the vertex form a(x − h)² + k. The parameter h represents the x-coordinate of the parabola's vertex, and k represents the y-coordinate. The method applies exclusively to quadratic expressions, meaning the coefficient a must be non-zero. If a = 0, the expression is linear and has no vertex in the sense of a parabola. The sign of a determines whether the vertex is a minimum (a > 0) or a maximum (a < 0). The range of validity is all real coefficients, and the output coordinates h and k are always real numbers because they involve only addition, subtraction, multiplication, and division of real inputs. Geometrically, the vertex form reveals the horizontal and vertical translations needed to map the basic parabola y = x² onto the given quadratic through a very simple rigid geometric transformation.
How to use this calculator.
- Enter the coefficient a, the leading coefficient of the quadratic term.
- Enter the coefficient b, the linear coefficient.
- Enter the constant term c.
- Verify that a is non-zero; the calculator will reject a = 0.
- Review the h output, which is the x-coordinate of the vertex.
- Review the k output, which is the y-coordinate and the maximum or minimum value.
- Use the vertex coordinates to sketch the parabola or write the equation in vertex form.
The formula.
The derivation begins with the standard quadratic expression ax² + bx + c. Factor a out of the first two terms: a(x² + (b/a)x) + c. Inside the parentheses, take half of the linear coefficient and square it: (b/(2a))² = b²/(4a²). Add and subtract this quantity inside the parentheses to create a perfect square trinomial: a[ x² + (b/a)x + b²/(4a²) − b²/(4a²) ] + c. The first three terms inside the brackets form (x + b/(2a))². Distributing the subtraction yields: a(x + b/(2a))² − a·b²/(4a²) + c = a(x + b/(2a))² − b²/(4a) + c. Rewriting the linear term as −(−b/(2a)) gives the canonical vertex form: a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a). An alternative expression for k combines the terms over a common denominator: k = (4ac − b²)/(4a). This form makes explicit the relationship between the vertex y-coordinate and the discriminant b² − 4ac. When the discriminant is zero, k = c − b²/(4a) = 0 if and only if the quadratic is a perfect square and the vertex lies on the x-axis. The formulas for h and k are linear and rational functions of the coefficients, respectively. Dimensional analysis confirms consistency: if x has units of metres, then b/a has units of metres, so h has units of metres. The term b²/(4a) has units of metres squared divided by metres, yielding metres, which matches the units of c and therefore k. This dimensional homogeneity is necessary for the equation to be physically meaningful in applied contexts such as projectile motion. Geometrically, h represents the horizontal displacement of the parabola's axis of symmetry from the y-axis, and k represents the vertical displacement of the vertex from the x-axis. When a > 0, the parabola opens upward and k is the global minimum; when a < 0, it opens downward and k is the global maximum. The calculator computes these values directly from the coefficients without requiring the user to perform the multi-step algebraic manipulation manually.
A worked example.
Consider the quadratic expression x² − 8x + 12. To complete the square, the calculator first identifies half of the linear coefficient: −8/2 = −4. It then squares this value: (−4)² = 16. The expression is rewritten by adding and subtracting 16: x² − 8x + 16 − 16 + 12 = (x − 4)² − 4. Comparing with vertex form a(x − h)² + k, the calculator extracts h = 4 and k = −4. The vertex of the parabola is at (4, −4). Because a = 1 is positive, this vertex is a minimum. The parabola intersects the x-axis where (x − 4)² = 4, which gives x = 4 ± 2, or x = 2 and x = 6. These roots are symmetric about the axis x = 4, confirming that the vertex lies midway between them. A student could use this result to sketch the parabola in two seconds without solving the quadratic formula or plotting points.
Frequently asked questions.
What is the difference between standard form and vertex form?
Why must a be non-zero?
Can completing the square be used to derive the quadratic formula?
What does the sign of a tell me about the vertex?
How do I find the axis of symmetry from the output?
What if the quadratic has no real roots?
Is there a matrix version of completing the square?
Can I use this calculator for equations in two variables?
Why does k equal (4ac − b²)/(4a)?
References& sources.
- [1]Stewart, J. (2015). Calculus: Early Transcendentals, 8th ed. Cengage Learning. ISBN 978-1285741550.
- [2]Sullivan, M. (2018). Algebra & Trigonometry, 10th ed. Pearson. ISBN 978-0134685985.
- [3]NCTM (2014). "Principles to Actions: Ensuring Mathematical Success for All." National Council of Teachers of Mathematics.
- [4]Al-Khwarizmi, M. (c. 820). Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala. (English translation: The Algebra of Mohammed ben Musa, Rosen, F., 1831).
- [5]Axler, S. (2015). Linear Algebra Done Right, 3rd ed. Springer. ISBN 978-3319110790.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled