What is completing the square?
Completing the square is an algebraic technique that rewrites a quadratic expression \(ax^2 + bx + c\) as a perfect-square term plus a constant. This form makes it easy to read off the solutions of the equation and to find the vertex of its parabola. This calculator applies the method to any quadratic with \(a \neq 0\) and reports the real roots, the discriminant, and the vertex.
How to use it
Enter the three coefficients \(a\), \(b\), and \(c\) from your equation \(ax^2 + bx + c = 0\). The calculator computes the discriminant \(b^2 - 4ac\). If it is zero or positive, two real roots are shown (they coincide when the discriminant is zero). If it is negative, the equation has no real solutions and the roots are complex.
The formula explained
Starting from \(ax^2 + bx + c = 0\), divide by \(a\) and move the constant: \(x^2 + (b/a)x = -c/a\). Add \((b/2a)^2\) to both sides to complete the square, giving \((x + b/2a)^2 = (b^2 - 4ac)/(4a^2)\). Taking the square root and isolating \(x\) yields $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a},$$ the familiar quadratic formula. The vertex sits at \(x = -b/(2a)\).
Worked example
For \(x^2 - 6x + 5 = 0\), we have \(a = 1\), \(b = -6\), \(c = 5\). The discriminant is $$(-6)^2 - 4 \cdot 1 \cdot 5 = 36 - 20 = 16.$$ Then $$x = \frac{6}{2} \pm \frac{\sqrt{16}}{2} = 3 \pm 2,$$ giving \(x_1 = 5\) and \(x_2 = 1\). The vertex is at \(x = 3\), \(y = 9 - 18 + 5 = -4\).
FAQ
What if the discriminant is negative? The parabola never crosses the x-axis, so there are no real roots; the solutions are complex numbers.
Why does a have to be non-zero? If \(a = 0\) the equation is linear, not quadratic, and completing the square does not apply.
What does the vertex tell me? It is the lowest point of the parabola when \(a > 0\) (a minimum) or the highest point when \(a < 0\) (a maximum).