Understanding the completing the square calculator — concept and principle
This calculator completes the square for a quadratic ax² + bx + c, step by step. It gives the vertex form a(x − h)² + k, the vertex, and the solutions of ax² + bx + c = 0 in exact and decimal form. Use it to learn the method, graph a parabola or check homework.
How it is calculated
ax² + bx + c = a(x + p)² + q, with p = b ÷ (2a) and q = c − b² ÷ (4a)
Vertex (h, k) = (−p, q)
To solve ax² + bx + c = 0:
- Divide every term by a.
- Move the constant to the right side.
- Add (b/2a)² to both sides.
- Write the left side as (x + b/2a)² and take square roots.
- With whole-number coefficients the steps are shown as exact fractions. A negative right side means no real solutions.
The principle
The expansion (x + p)² = x² + 2px + p² shows that x² + bx is only missing the constant (b/2)² to be a perfect square. Adding that amount, and balancing it by subtracting or adding it on the other side, turns the quadratic into a square plus a constant. A square is never negative, so the vertex form shows the parabola's turning point directly. Applying the same steps to a general quadratic gives the quadratic formula.
Worked example
Default inputs: a = 2, b = −6, c = 1, i.e. 2x² − 6x + 1.
- Divide by 2: x² − 3x + 1/2 = 0.
- Move the constant: x² − 3x = −1/2.
- Add (−3/2)² = 9/4 to both sides: x² − 3x + 9/4 = 7/4.
- Write as a square: (x − 3/2)² = 7/4, so x = 3/2 ± √(7/4), i.e. x₁ ≈ 0.177124; x₂ ≈ 2.82288.
- Vertex form: 2(x − 3/2)² − 7/2, vertex (3/2, −7/2).
How to read the result
The vertex is the lowest point of the parabola when a > 0 and the highest when a < 0. Here the minimum value −7/2 occurs at x = 3/2, and the graph crosses the x-axis at the two solutions. If the right side in step 4 is negative, the parabola does not reach the x-axis and the roots are complex.
Common mistakes
- Forgetting to divide by a first when a ≠ 1.
- Adding (b/2)² to only one side.
- Using b/2 instead of b/2a after dividing.
- Forgetting the ± when taking the square root.
Frequently asked questions
What is completing the square?
Rewriting a quadratic as a perfect square plus a constant, a(x − h)² + k.
How do I find the vertex from vertex form?
In a(x − h)² + k the vertex is (h, k).
How is it related to the quadratic formula?
The quadratic formula is completing the square done once for a general ax² + bx + c.
Sources: OpenStax, Intermediate Algebra 2e, §9.2 Solve Quadratic Equations by Completing the Square