Mathematics
Linear and quadratic equation calculator
Enter the coefficients of ax² + bx + c = 0 and get the roots, the discriminant, the vertex of the parabola and the factored form.
How these equations are solved
A first-degree equation, bx + c = 0, always has exactly one solution when b is not zero: x = −c/b. The two edge cases are instructive. If b and c are both zero the equality holds for any x and the equation is called indeterminate; if b is zero but c is not, no value satisfies it and the equation is impossible.
For the second degree the quadratic formula is x = (−b ± √Δ) / 2a, where Δ = b² − 4ac is the discriminant. The sign of Δ decides everything: positive gives two distinct real roots, zero a repeated root, negative two complex conjugate roots of the form p ± qi. On a graph the reading is immediate: Δ counts the intersections between the parabola y = ax² + bx + c and the x-axis.
Other useful information sits around the roots. Viète's relations say that the sum of the roots is −b/a and their product c/a: they make an excellent hand check on a result. The vertex of the parabola lies at x = −b/2a, exactly halfway between the two roots when those are real, and its y-value says whether the parabola touches, crosses or misses the axis. When the roots are real you can write the factored form a(x − x₁)(x − x₂), which is the same equation reread as a product of factors.
A worked example: x² − 3x + 2 = 0. The discriminant is 9 − 8 = 1, positive, so there are two real roots: x = (3 ± 1) / 2, that is 1 and 2. Their sum is 3, which matches −b/a, and their product is 2, which is c/a. The vertex is at x = 1.5 with a y-value of −0.25, and the factored form is (x − 1)(x − 2).
Common mistakes
- Forgetting the minus sign in front of b in the quadratic formula: it is the most frequent slip when b is already negative, because the two signs cancel.
- Computing the discriminant as b² − 4c, leaving out the coefficient a: the correct formula is b² − 4ac.
- Concluding that an equation has no solutions when the discriminant is negative: it has no real ones, but it does have two complex conjugates.
- Dividing by a without checking that it is not zero: with a equal to zero the equation is linear and the quadratic formula does not apply.
- Writing the factored form as a(x + x₁)(x + x₂): the signs of the roots must be flipped, because the factors are (x − x₁) and (x − x₂).
Frequently asked questions
What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / 2a, valid when a is not zero. The quantity under the root is the discriminant Δ, and its sign determines how many solutions there are and of what kind.
What does the discriminant tell you?
Δ = b² − 4ac gives the number of real solutions: positive means two distinct ones, zero means a single one counted twice, negative means none that are real but two complex conjugates. Geometrically it counts where the parabola crosses the x-axis.
What happens if the coefficient a is zero?
The equation is no longer quadratic but linear, bx + c = 0, and the solution is x = −c/b. The calculator recognises the case on its own and switches to the right formula instead of dividing by zero.
How do you find the vertex of the parabola?
The x-coordinate of the vertex is x = −b/2a, and the y-coordinate follows by substituting that value into the equation. When the roots are real the vertex sits exactly halfway between them, because the parabola is symmetric about that vertical line.
What are Viète's relations?
They link the coefficients to the roots without solving the equation: the sum of the roots is −b/a and their product is c/a. They are a quick way to check a result, or to reconstruct an equation from its solutions.
How this calculation works
First degree: from bx + c = 0 it follows that x = −c/b. Second degree: Δ = b² − 4ac and x = (−b ± √Δ) / 2a. With Δ < 0 the roots are (−b / 2a) ± (√(−Δ) / 2a)i. The vertex sits at x = −b/2a, with the y-value found by substitution. The sum and product of the roots are −b/a and c/a. To avoid the loss of precision when −b and √Δ nearly cancel, the calculator takes one root from the formula and the other from the product c/a.