Quadratic equation solver
Enter the coefficients a, b and c and the solver applies the quadratic formula. It reports real or complex roots, the discriminant and the vertex of the parabola, and writes out each step. If a is 0 the equation is solved as a linear one.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Write your equation as ax² + bx + c = 0, moving every term to the left side.
- Enter a, b and c, using 0 for a missing term and a minus sign for negative values.
- Read the roots, the discriminant, the vertex and the steps.
How it works
The discriminant is D = b² − 4ac. The roots follow from x = (−b ± √D) ÷ 2a. When D is negative the roots are complex: the real part is −b ÷ 2a and the imaginary part is √(−D) ÷ 2|a|. For real roots the calculator uses a form that avoids cancelling two nearly equal numbers, so a very small root is not lost to rounding.
The graph of y = ax² + bx + c is a parabola whose vertex is at x = −b ÷ 2a. The y-intercept is c.
Worked examples
- x² − 3x + 2 = 0. D = 9 − 8 = 1, so x = (3 ± 1) ÷ 2, giving x₁ = 1 and x₂ = 2. The vertex is (1.5; −0.25).
- x² + 2x + 1 = 0. D = 0 and the repeated root is x = −1.
- x² + 2x + 5 = 0. D = −16, so the roots are −1 ± 2i.
Common mistakes
- Forgetting to move everything to one side. For x² = 4x − 3, first rewrite it as x² − 4x + 3 = 0.
- Dropping the sign of b. The formula uses −b, so b = −3 gives +3.
- Dividing by 2 instead of 2a when a is not 1.
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0 with a not equal to 0, the roots are x = (−b ± √(b² − 4ac)) ÷ 2a. The part under the root, D = b² − 4ac, is called the discriminant.
What does the discriminant tell me?
If D is positive there are two real roots, if D is zero there is one repeated root, and if D is negative there are two complex roots with no real solution. The parabola crosses the x-axis twice, touches it once or misses it.
What are complex roots?
When D is negative the square root is imaginary, so the roots are re ± im·i, where i is the square root of −1. For x² + 2x + 5 = 0 they are −1 + 2i and −1 − 2i, always a conjugate pair.
What happens when a is 0?
The x² term disappears and the equation becomes bx + c = 0, which has the single root x = −c ÷ b. If b is also 0 there is either no solution or every number is one, depending on c.