Completing the Square Calculator
Completing the square is a method for rewriting any quadratic expression from standard form (ax squared plus bx plus c) into vertex form (a(x minus h) squared plus k). The vertex form immediately reveals the vertex of the parabola at coordinates (h, k): h is the axis of symmetry and k is the minimum value of the function if a is positive or the maximum if a is negative. This technique underpins the derivation of the quadratic formula, the analysis of conic sections, and techniques in calculus such as integration of rational functions. It is also the most systematic way to solve a quadratic equation when factoring is not obvious: once you have the vertex form you simply isolate x and take the square root of both sides. This calculator accepts the three coefficients a, b and c of a quadratic in the form ax squared plus bx plus c, rewrites it in vertex form, identifies the vertex and the discriminant, and solves for the roots if they exist. It also shows each intermediate step. The defaults use a=1, b=-6, c=5, the quadratic x squared minus 6x plus 5, which factors as (x minus 1)(x minus 5) and has roots x=1 and x=5.
How it works
For ax squared plus bx plus c, the vertex h equals minus b divided by 2a. Vertex k equals c minus b squared divided by 4a. These give the vertex form a(x minus h) squared plus k. The discriminant is b squared minus 4ac. If the discriminant is positive there are two real roots given by the quadratic formula: x = (minus b plus or minus the square root of the discriminant) divided by 2a. If zero, one repeated root. If negative, no real roots. Each step is built up from the intermediate values and displayed below the result card.
Worked example
Quadratic: x squared minus 6x plus 5 (a=1, b=-6, c=5). h = -(-6)/(2 times 1) = 6/2 = 3. k = 5 - (-6) squared/(4 times 1) = 5 - 36/4 = 5 - 9 = -4. Vertex form: (x - 3) squared - 4. Discriminant: (-6) squared - 4(1)(5) = 36 - 20 = 16. Roots: (6 plus or minus 4)/2, giving x = 5 and x = 1. These match the defaults pre-filled above.
Related calculators
- Cross Multiplication: solve proportions a/b = c/d for any unknown.
- Binomial Expansion: expand (a+b) to the power n with Pascal's triangle coefficients.
- Change of Base Calculator: evaluate a logarithm in any base.
- Percent Error Calculator: percentage deviation from a true value.
- Spring Rate Calculator: From Force and Travel or Coil Geometry.
- Sum and Difference Identities Calculator: free sum and difference identities calculator.