What the theorem says
- x² + px + q = (x − x₁)(x − x₂)
where x₁ and x₂ are the roots of the equation. Multiply the right-hand side out and compare term by term, and the two formulas the theorem is known for fall out:
- x₁ + x₂ = −p
- x₁ · x₂ = q
Both live in the same line, which is why this page shows the factorisation rather than the two formulas separately: they are not two claims but one, read off in two places.
Why it holds
Multiply out (x − x₁)(x − x₂):
x² − x₁x − x₂x + x₁x₂ = x² − (x₁ + x₂)x + x₁x₂
Compare with x² + px + q. The number in front of x has to match, so p = −(x₁ + x₂). The term on its own has to match, so q = x₁x₂. That is the entire proof.
That a quadratic with roots x₁ and x₂ can be written as two factors like this is the factor theorem.
Guessing the roots
This is what the formulas are for in practice: for equations with whole-number roots, guessing is faster than calculating.
Ask yourself: which two numbers multiply to q and add to −p?
x² − 7x + 12 = 0 → two numbers with product 12 and sum 7 → 3 and 4.
x² + 2x − 15 = 0 → product −15, sum −2 → 3 and −5.
Product first, sum second. A negative q means the roots have opposite signs, which halves the list before you start.
Worked examples
Example 1. The roots of an equation are 3 and −1. What is the equation?
The sum is 2, so p = −2. The product is −3, so q = −3. The equation is x² − 2x − 3 = 0.
Example 2. One root of x² − 5x + 6 = 0 is 2. What is the other?
The product must be 6, so the other root is 6 / 2 = 3. Check: the sum 2 + 3 = 5 = −p. It holds.
Example 3. What is the sum of the roots of 2x² − 10x + 8 = 0?
Divide by 2 first: x² − 5x + 4 = 0, so the sum is 5. Without dividing it is −b/a, which is the same number.
Common mistakes
- Dropping the minus on the sum. The sum is −p, not p. For x² − 7x + 12 the sum is 7.
- Using the formulas straight on ax² + bx + c. Divide by a first, or use −b/a and c/a.
- Checking only the sum. Two numbers with the right sum can have the wrong product. Both have to hold.
- Expecting the guess to always work. When the roots are irrational there are no whole numbers to find, and the quadratic formula is quicker.
Common questions
Do they hold for higher degrees?
Yes. For a cubic whose x³ coefficient is 1, the sum of the roots is minus the coefficient of the
second-highest term, and
the product of all three is the constant term with its sign flipped. The pattern continues upwards,
with one formula per coefficient.
Do they work when the roots are not real?
Yes, but only if you work with complex numbers. When p and q are real, the sum and the product come out
real even so, because the two roots are then complex conjugates of one another.
Who was Vieta?
François Viète, a sixteenth-century French mathematician, usually Latinised to Vieta. He was among the
first to write equations with letters for the unknowns, which is what made a relationship like this
one visible at all.

