✖

Vieta’s formulas

Vieta’s formulas (also called Vieta’s relations) link the roots (that is, the solutions) of a quadratic equation to its coefficients, that is, to the numbers in front of x2 and x and the number without an x. You can read off the sum and product of the roots without having to solve the equation. For an equation whose leading coefficient (the coefficient of x2) is 1,

x2+px+q=0,

its roots x1 and x2 satisfy

x1+x2=−p,x1⋅x2=q

For a general equation ax2 + bx + c = 0 (where a ≠ 0) we just divide everything by the coefficient a:

x1+x2=−ba,x1⋅x2=ca

Solving in your head

Let’s try it on the equation

x2−5x+6=0.

Here p = −5 and q = 6. So we are looking for two numbers with sum −p = 5 and product 6. The sum and the product are both positive, so both numbers are positive. We can split 6 into either 1 · 6 or 2 · 3, and only the second pair adds up to 5. The roots are x1 = 2 and x2 = 3, and we did not need the discriminant at all.

Watch the sign. The most common mistake is to look for numbers with sum −5 because the equation says “minus five”. But the sum of the roots is the negative of p. If you looked for a pair with sum −5 and product 6, you would arrive at −2 and −3, but those are the roots of a completely different equation, x2 + 5x + 6 = 0. Substitute −2 into the original equation: (−2)2 − 5 · (−2) + 6 = 20, which is not zero.

The graph of y=x^2-5x+6 crosses the x-axis at the roots 2 and 3; the dashed blue line is the axis of symmetry of the parabola The graph of y=x^2-5x+6 crosses the x-axis at the roots 2 and 3; the dashed blue line is the axis of symmetry of the parabola

The graph reveals one more detail. A parabola is symmetrical, so its turning point lies exactly halfway between the roots, at x=x1+x22=−p2. Here that is 52.

How did we get there?

If x1 and x2 are the roots of ax2 + bx + c = 0, its left-hand side can be written as a product:

ax2+bx+c=a(x−x1)(x−x2).

Why? Both sides have the same a in front of x2, and both are zero for x = x1 and for x = x2. If you subtract one from the other, the x2 terms cancel and what is left is an expression of the form kx + l that is zero at two different points. That is only possible if it is zero everywhere, so the two sides are equal. Now we expand the brackets:

a(x−x1)(x−x2)=a(x2−x1x−x2x+x1x2)

From the middle two terms we take out the common factor x and multiply a into the brackets:

a(x−x1)(x−x2)=a(x2−(x1+x2)x+x1x2)

a(x−x1)(x−x2)=ax2−a(x1+x2)x+ax1x2

Now we compare this with the left-hand side ax2 + bx + c. The equality holds for every x, so the coefficients of x must be equal, and so must the constant terms (the numbers without an x):

b=−a(x1+x2),c=ax1x2.

Divide both equalities by a and there you have Vieta’s formulas. For a = 1 we have b = p and c = q, which is the simpler version from the introduction.

You get the same result if you add and multiply the roots using the formula x1,2=−b±D2a. The square roots of the discriminant cancel when we add, and when we multiply we get a difference of two squares. You can find the whole calculation in the article on the discriminant.

What Vieta’s formulas are good for

Solving in your head works with negative roots too. Solve x2 + x − 12 = 0. We are looking for numbers with product −12 and sum −1. The product is negative, so one number is positive and the other negative. Of the pairs 1 · 12, 2 · 6 and 3 · 4, only the last one has a difference of 1, and for the sum to come out as −1 the 4 must be the negative one. The roots are x1 = 3 and x2 = −4.

If the coefficient of x2 is a number other than 1, we first divide the equation. We divide the equation 2x2 − 6x − 8 = 0 by 2 and get x2 − 3x − 4 = 0. The numbers with sum 3 and product −4 are 4 and −1.

It works best for equations with integer roots, like those you find in school exercises. If no pair comes to mind within a minute, reach for the discriminant; the roots may well involve a square root.

Checking a result. Did you get the roots 2 and 13 for 3x2 − 7x + 2 = 0 using the discriminant? Checking takes two seconds: the sum 2+13=73 should equal −ba=73 and the product 23 should equal ca=23. It does.

Factorising. The relationship ax2 + bx + c = a(x − x1)(x − x2) immediately factorises a quadratic expression into a product. From the roots 3 and −4 the brackets are (x − 3) and (x + 4):

x2+x−12=(x−3)(x+4),

2x2−6x−8=2(x−4)(x+1).

You will use this when cancelling algebraic fractions and when factorising polynomials.

Building an equation from known roots. Suppose we want a quadratic equation with roots −2 and 5. The sum of the roots is 3, so p = −3, and the product is −10, so q = −10. The equation we want is

x2−3x−10=0.

Any multiple of it, for example 2x2 − 6x − 20 = 0, has the same roots.

Expressions in the roots without solving the equation

A popular problem: the equation x2 − 4x + 1 = 0 has roots x1 and x2. Without solving it, work out x12+x22.

From Vieta’s formulas we know that x1 + x2 = 4 and x1 · x2 = 1. We need to express the sum of squares using only the sum and product of the roots. The formula for the square of a sum, (x1+x2)2=x12+2x1x2+x22, helps, and we rearrange it to get

x12+x22=(x1+x2)2−2x1x2

Substituting:

x12+x22=42−2⋅1=14

We can handle the sum of the reciprocals in the same way. We put the fractions over a common denominator:

1x1+1x2=x2+x1x1x2=41=4

It could also be done directly, since the discriminant gives the roots 2±3, but that route is longer and mistakes creep in more easily.

Repeated and complex roots

The formulas also hold when the equation has just one repeated root. The equation x2 − 6x + 9 = 0 has the root x1 = x2 = 3, and indeed 3 + 3 = 6 = −p and 3 · 3 = 9 = q.

A negative discriminant does not matter either; the roots are then simply complex. The equation x2 + 2x + 5 = 0 has the roots −1 + 2i and −1 − 2i. Their sum is −2 and their product is (−1)2 − (2i)2 = 1 + 4 = 5, exactly as the formulas say.

Similar formulas exist for equations of higher degree. For a cubic equation x3 + px2 + qx + r = 0, the sum of the three roots is −p and their product is −r.

The formulas are named after François Viète, a 16th-century French lawyer and mathematician who was one of the first to use letters instead of specific numbers in equations.

Chapters: Quadratic equations, The discriminant, Vieta’s formulas, Quadratic equations with a parameter, Quadratic equations with complex solutions