Quadratic Equation Calculator
This quadratic equation calculator puts your equation in standard form, checks the discriminant, then solves by factoring when it can and with the quadratic formula when it must, giving exact and decimal roots.
Worked example
Step-by-step solution
Step 1 / 4
Identify a, b and c
The equation is already in standard form.
Step 2 / 4
Compute the discriminant
49 is a perfect square, so the quadratic factors.
Step 3 / 4
Factor the trinomial
Use −6 and 1, which multiply to ac = −6 and add to b = −5.
Step 4 / 4
Set each factor to zero
A product is zero only when a factor is zero.
Answer
x = −1/2 or x = 3 (−0.5 and 3)
How to use the Quadratic Equation Calculator
- Type the equation, for example 2x² − 5x − 3 = 0 (use ^ for powers: 2x^2).
- Press Solve it. The calculator rewrites it as ax² + bx + c = 0 and reads off a, b and c.
- Follow the discriminant step to see how many real roots there are.
- Use the exact roots for homework and the decimals to check a graph.
The quadratic formula and the discriminant
Every quadratic equation ax² + bx + c = 0 with a ≠ 0 can be solved with the quadratic formula. The expression under the square root, b² − 4ac, is the discriminant: positive means two real roots, zero means one repeated root, and negative means two complex roots.
When the discriminant is a perfect square the quadratic factors over the integers, and factoring is usually the faster method taught in class. The calculator uses factoring in that case and the formula otherwise.
Quadratic formula vs factoring vs completing the square
All three methods give the same roots, so the choice is about speed. Compute the discriminant first. For 2x² − 7x + 3 = 0 it is 49 − 24 = 25, a positive perfect square, so the roots are rational and factoring is fastest: (2x − 1)(x − 3) = 0 gives x = 1/2 and x = 3. For 4x² − 12x + 9 = 0 the discriminant is 144 − 144 = 0, which signals a perfect square: (2x − 3)² = 0 has the single repeated root x = 3/2.
When the discriminant is positive but not a perfect square, the roots are irrational and factoring over the integers fails. Completing the square is neat when a = 1 and b is even: x² + 6x + 2 = 0 becomes (x + 3)² = 7, so x = −3 ± √7. In every other case, and always when the discriminant is negative, use the quadratic formula. For 2x² + 2x + 5 = 0 the discriminant is 4 − 40 = −36, so x = (−2 ± 6i)/4 = −1/2 ± (3/2)i.
Quadratic formula calculator: three worked examples
Leading coefficient not 1: in 3x² + 5x − 2 = 0, a = 3, b = 5 and c = −2. The discriminant is 25 − 4 · 3 · (−2) = 49, and the denominator is 2a = 6, not 2. The roots are (−5 + 7)/6 = 1/3 and (−5 − 7)/6 = −2. Two rational roots mean the quadratic also factors, as (3x − 1)(x + 2).
Fraction coefficients: for ½x² − (3/2)x − 1 = 0, multiply every term by 2 first to get x² − 3x − 2 = 0. Clearing fractions does not change the roots. Now a = 1, b = −3, c = −2, the discriminant is 9 + 8 = 17, and x = (3 ± √17)/2. Keep that exact form for homework; the decimals x ≈ 3.562 and x ≈ −0.562 show where the parabola crosses the x-axis.
No real roots: for x² − 4x + 13 = 0 the discriminant is 16 − 52 = −36. The square root of −36 is 6i, so x = (4 ± 6i)/2 = 2 ± 3i. Read this result as "the parabola never touches the x-axis". Its vertex is at (2, 9), above the axis, and the graph opens upward.
Check your roots by substitution
Put each root back into the original equation, not into a rearranged copy. For 3x² + 5x − 2 = 0 and x = −2: 3 · 4 + 5 · (−2) − 2 = 12 − 10 − 2 = 0. For x = 1/3: 3 · (1/9) + 5/3 − 2 = 1/3 + 5/3 − 2 = 0. Both sides agree, so both roots are right.
A faster check uses the sum and product of the roots. The two roots must add to −b/a and multiply to c/a. Here 1/3 + (−2) = −5/3, which equals −b/a, and (1/3)(−2) = −2/3, which equals c/a. The same check works for complex roots: 2 + 3i and 2 − 3i add to 4 and multiply to 4 + 9 = 13, matching x² − 4x + 13 = 0.
Common mistakes with the quadratic formula
The most common mistake is a sign error in the discriminant. When c is negative, −4ac becomes positive: for 3x² + 5x − 2 = 0 it is 25 + 24 = 49, not 25 − 24 = 1. When b is negative, b² is still positive and −b is positive: in x² − 3x − 2 = 0, b² = 9 and −b = 3. The second mistake is dividing only part of the numerator. The whole expression −b ± √(b² − 4ac) sits over 2a, so (−5 ± 7)/6 is correct and −5 ± 7/6 is not.
Other slips are dropping the ± and reporting one root, and reading a, b and c before the equation equals zero. Rewrite x² = 3x + 10 as x² − 3x − 10 = 0 first; then a = 1, b = −3, c = −10 and the roots are 5 and −2. Finally, never divide both sides by x. Doing that to x² = 5x gives only x = 5 and loses the root x = 0.
Frequently asked questions
When should I factor instead of using the quadratic formula?
Factor when the discriminant b² − 4ac is a perfect square; the roots are then rational. Otherwise use the quadratic formula, which always works.
Can the calculator give complex roots?
Yes. When the discriminant is negative the roots are written as a ± bi, for example x² + 2x + 5 = 0 has roots −1 ± 2i.
Does the equation have to equal zero?
No. Enter it in any form, such as x² = 3x + 10; the first step moves every term to one side.
Related calculators
Have a different kind of math problem? Try the free math solver. Use the subject menu for physics and chemistry.