Quadratic Equation Solver guide
Sum and Product of Roots (Vieta's Formulas)
For ax² + bx + c = 0, the two roots add up to −b ÷ a and multiply to c ÷ a. These are Vieta's formulas. For x² − 2x − 15 = 0 the roots are 5 and −3: they sum to 2, which is −(−2) ÷ 1, and multiply to −15, which is −15 ÷ 1.
The two relationships
For any quadratic ax² + bx + c = 0 with roots p and q:
p + q = −b ÷ a
p × q = c ÷ a
These are known as Vieta's formulas, and they hold whether the roots are rational, irrational or complex.
Checking with our example
For x² − 2x − 15 = 0, the roots are 5 and −3.
Sum: 5 + (−3) = 2. And −b ÷ a = −(−2) ÷ 1 = 2. Matches.
Product: 5 × (−3) = −15. And c ÷ a = −15 ÷ 1 = −15. Matches.
Both check out, which is a strong signal the roots are right.
Use it to check your answers
This is the most practical use of Vieta, and it is faster than substituting back into the original equation.
After solving any quadratic, add your two roots and see whether you get −b ÷ a. Multiply them and see whether you get c ÷ a.
It takes about five seconds and catches sign errors particularly well, because a flipped sign will almost always break the sum.
The calculator on this page gives you the roots and the original coefficients together, so this check is easy to run against it.
Building an equation from its roots
The relationships also run backwards, which is useful when a question gives you roots and asks for the equation.
If you want roots of 4 and −7: their sum is −3 and their product is −28.
With a = 1, that means −b = −3 so b = 3, and c = −28.
The equation is x² + 3x − 28 = 0.
You can check by factoring: (x + 7)(x − 4) = 0, giving roots of −7 and 4. Correct.
Where it is genuinely powerful
Vieta comes into its own when a question asks about the roots without asking you to find them.
"The roots of x² − 6x + 4 = 0 are p and q. Find p² + q²."
Solving for p and q gives irrational numbers and a messy calculation. But there is an identity: p² + q² = (p + q)² − 2pq.
From Vieta, p + q = 6 and pq = 4. So p² + q² = 36 − 8 = 28.
No surds, no square roots, no mess. Recognising when a question can be answered this way is worth a lot of time in an exam.
Why the formulas work
If p and q are the roots, the equation can be written as a(x − p)(x − q) = 0.
Expanding gives a(x² − (p + q)x + pq) = ax² − a(p + q)x + apq.
Comparing with ax² + bx + c: the x coefficient tells you b = −a(p + q), so p + q = −b ÷ a. The constant tells you c = apq, so pq = c ÷ a.
That is the whole derivation, and it is worth working through once — it makes both formulas obvious rather than arbitrary.