Skip to content
LoveToCalc

Theorem — what does that mean?

Vieta's formulas

The roots and the coefficients are linked without you solving anything. The sum is minus p, the product is q.

In Swedish: Vietas formler

x²+px+q=(x−x₁)(x−x₂)

x
Variable
p
Coefficient of x
q
Constant term
x₁
First root
x₂
Second root

What the theorem says

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:

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

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.

Last reviewed October 6, 2026 ·How pages are reviewed

PolynomialsAll formulas