Vieta’s Formulas

Vieta’s formulas connect the roots of a polynomial to its coefficients; for a quadratic equation x2 + px + q = 0 with roots x1 and x2, they state x1 + x2 = −p and x1 · x2 = q. In brief: for x2 − 7x + 12 = 0, the sum of the roots is 7 and the product is 12, so the roots are 3 and 4. For ax2 + bx + c = 0 the formulas are x1 + x2 = −b/a and x1x2 = c/a.

The formulas allow you to find roots by inspection, to check solutions, to build an equation with given roots and to compute expressions in the roots without solving the equation. They are named after François Viète. This guide shows the formulas, proves them, solves typical problems and extends them to cubic equations.

What are Vieta’s formulas for a quadratic?

If ax2 + bx + c = 0 has roots x1 and x2, then:

For a = 1 the equation is x2 − (x1 + x2)x + x1x2 = 0, i.e., x2 − Sx + P = 0, where S is the sum and P is the product. The formulas also hold for complex roots and for a double root, which is counted twice.

Why do the formulas hold?

Write the polynomial in factored form: ax2 + bx + c = a(x − x1)(x − x2) = a(x2 − (x1 + x2)x + x1x2). Comparing coefficients of x gives b = −a(x1 + x2), and comparing the constant terms gives c = a x1x2. Dividing by a gives the formulas. A second check uses the quadratic formula: the sum of (−b + √D)/(2a) and (−b − √D)/(2a) is −b/a, because the roots cancel.

How do you use the formulas?

Example 1: finding roots by inspection

x2 − 9x + 20 = 0. Look for two numbers with sum 9 and product 20: 4 and 5. The roots are 4 and 5.

Example 2: checking a solution

After solving 2x2 − 7x + 3 = 0 and getting 3 and 1/2, check: sum 3.5 = 7/2 ✓, product 1.5 = 3/2 ✓.

Example 3: building an equation

Find the equation with roots 2 + √3 and 2 − √3. The sum is 4 and the product is 4 − 3 = 1. So x2 − 4x + 1 = 0.

Example 4: finding the other root

One root of x2 − 5x + k = 0 is 2. Then the other root is 5 − 2 = 3 by the sum, and k = 2 · 3 = 6.

Example 5: a condition on the roots

For which m does x2 − 6x + m = 0 have a root equal to twice the other? Let the roots be t and 2t. Sum: 3t = 6, so t = 2. Product: m = 2t2 = 8. Check: x2 − 6x + 8 = (x − 2)(x − 4) ✓.

Example 6: signs of the roots

Without solving x2 + 5x − 6 = 0, the product −6 < 0 means the roots have opposite signs. Since the sum is −5 < 0, the negative root has a larger absolute value. The roots are −6 and 1. If the product is positive and the sum is positive, both roots are positive (when real).

How do you compute expressions in the roots?

Many expressions can be written using S = x1 + x2 and P = x1x2.

Example: for x2 − 5x + 3 = 0, S = 5 and P = 3. Then x12 + x22 = 25 − 6 = 19, and 1/x1 + 1/x2 = 5/3. And x13 + x23 = 125 − 45 = 80. These are found without computing the irrational roots (5 ± √13)/2.

What are Vieta’s formulas for a cubic?

For ax3 + bx2 + cx + d = 0 with roots x1, x2, x3: the sum is x1 + x2 + x3 = −b/a; the sum of pairwise products is x1x2 + x1x3 + x2x3 = c/a; and the product is x1x2x3 = −d/a. For x3 − 6x2 + 11x − 6, the roots 1, 2, 3 have sum 6, pair sum 2 + 3 + 6 = 11 and product 6 ✓. In general, for degree n, the coefficients are, up to sign, the elementary symmetric sums of the roots.

Sum and product table

Quadratic equations with their root sum S and root product P
Equation S = −b/a P = c/a Roots
x2 − 7x + 12 = 07123, 4
x2 + 5x + 6 = 0−56−2, −3
x2 − x − 6 = 01−63, −2
2x2 − 7x + 3 = 07/23/23, 1/2
x2 − 4x + 1 = 0412 ± √3
x2 − 6x + 9 = 0693, 3

Where do the formulas come from?

François Viète, a French mathematician of the sixteenth century, introduced the systematic use of letters for both unknowns and known quantities and described relations between roots and coefficients of polynomials. The relations as we know them, including negative and complex roots, were stated fully by Albert Girard in the early seventeenth century, which is why they are called Vieta–Girard formulas in some texts. The relations for general degree were proved with the development of the theory of equations.

Where are they used today?

Vieta’s formulas are used to check solutions, in problems with parameters and in the theory of equations. In control engineering, the sum and product of the roots of a characteristic polynomial give the damping and natural frequency of a system. In coding and number theory, symmetric sums of roots appear in the study of recurrence relations.

Which mistakes are common?

Wrong sign for the sum

The sum is −b/a. For x2 − 7x + 12 the sum is +7.

Ignoring a when a ≠ 1

For 2x2 − 7x + 3, the product is 3/2, not 3.

Forgetting that the roots must exist

The formulas apply to complex roots too, but if you need real roots, check D ≥ 0 first.

Wrong formula for the sum of squares

x12 + x22 = S2 − 2P, not S2.