Vieta's Formulas Calculator
- Vieta's formulas link a quadratic's coefficients to its roots: for a x^2 + b x + c the sum of the roots is -b / a and the product of the roots is c / a. Here -b / a = 5 and c / a = 6.
- The roots themselves are 2 and 3, and indeed 2 and 3 add to 5 and multiply to 6 - a fast way to check a factorisation without solving anything.
- The sum of the squares follows without finding the roots at all: (sum)^2 - 2 x product = 13.
- Vieta's formulas run both ways: given the roots you can rebuild the equation, and given the equation you can test candidate roots by their sum and product before committing to the quadratic formula.
This Vieta's formulas calculator takes the coefficients of a polynomial and returns the sum and product of its roots without solving for the roots themselves. For a quadratic a x^2 + b x + c, Vieta's formulas give sum = -b / a and product = c / a. Enter x^2 - 5x + 6 and the calculator reports a sum of 5 and a product of 6, matching the roots 2 and 3. Enter 2x^2 - 8x + 6 and it reports a sum of 4 and a product of 3, matching the roots 1 and 3. For the cubic x^3 - 6x^2 + 11x - 6, it reports a sum of 6, pairwise products adding to 11, and a product of 6. It also derives related quantities, such as the sum of the squares of the roots from (sum)^2 - 2 x product: 13 for the first quadratic and 14 for the cubic.
The method is the accepted standard because it follows directly from expanding the factored form of a polynomial and comparing coefficients, so the relationships hold for every polynomial of the given degree. For a quadratic, the sum is -b / a and the product is c / a; for a cubic, the product of the roots is -d / a, with the sign alternating by degree. This page shows the formula, step-by-step workings, worked examples and sources, so you can check each result by hand rather than trusting a black box.
Worked examples
Quadratic
(Quadratic (a x^2 + b x + c) · 1 · -5 · 6 · 0)
| Sum of the roots | 5 |
| Product of the roots | 6 |
| The roots themselves | 2 and 3 |
| Sum of the squares of the roots | 13 |
Scaled quadratic
(Quadratic (a x^2 + b x + c) · 2 · -8 · 6 · 0)
| Sum of the roots | 4 |
| Product of the roots | 3 |
| The roots themselves | 1 and 3 |
| Sum of the squares of the roots | 10 |
Cubic
(Cubic (a x^3 + b x^2 + c x + d) · 1 · -6 · 11 · -6)
| Sum of the roots | 6 |
| Sum of pairwise products | 11 |
| Product of the roots | 6 |
| Sum of the squares of the roots | 14 |
How Vieta's formulas work for a quadratic
For a quadratic written as a x^2 + b x + c, Vieta's formulas give two relationships between the coefficients and the roots. The sum of the roots equals -b / a, and the product of the roots equals c / a. This means you can read both values straight off the coefficients without ever solving for the individual roots. A vieta's formulas calculator applies these same relationships, so it is worth seeing where each number comes from.
Take x^2 - 5x + 6. Here a is 1, b is -5 and c is 6. The sum of the roots is -b / a, which is -(-5) / 1 = 5. The product is c / a, which is 6 / 1 = 6. The roots that fit are 2 and 3: they add to 5 and multiply to 6. Because the sum and product are known, the sum of the squares of the roots follows from (sum)^2 - 2 x product. That gives 5^2 - 2 x 6 = 25 - 12 = 13. So the roots 2 and 3 have squares that add to 4 + 9 = 13, matching the formula.
The leading coefficient matters. For 2x^2 - 8x + 6, a is 2, b is -8 and c is 6. The sum is -(-8) / 2 = 4, and the product is 6 / 2 = 3. The roots are 1 and 3, which add to 4 and multiply to 3. Dividing through by the leading coefficient first would give the same answers, but the formulas handle it directly, which is why they are stated with a in the denominator.
The same pattern extends to higher degrees, with signs that alternate. For the cubic x^3 - 6x^2 + 11x - 6, the sum of the roots is 6, the pairwise products add to 11, and the product of the roots is 6. The product of the roots for a cubic is -d / a, and the sign alternates by degree, so the coefficient signs carry meaning. For this cubic the sum of the squares of the roots is 14, again from (sum)^2 - 2 x product of the relevant terms.
The practical point is that sums, products and derived quantities such as the sum of squares can be computed from the coefficients alone. When you do not need the individual roots, Vieta's formulas save the work of solving the equation.
- Quadratic a x^2 + b x + c: sum = -b / a, product = c / a
- x^2 - 5x + 6: sum 5, product 6, roots 2 and 3, sum of squares 13
- 2x^2 - 8x + 6: sum 4, product 3, roots 1 and 3
- Cubic x^3 - 6x^2 + 11x - 6: sum 6, pairwise products 11, product 6, sum of squares 14
- Cubic product of roots = -d / a, with the sign alternating by degree
- Sum of squares of the roots = (sum)^2 - 2 x product
Worked quadratic examples
A worked example makes Vieta's formulas concrete. Take the quadratic x^2 - 5x + 6. Here a = 1, b = -5, and c = 6, so the sum of the roots is -b / a = 5 and the product is c / a = 6. Those two numbers are enough to identify the roots as 2 and 3, since 2 + 3 = 5 and 2 × 3 = 6. You never had to factor or use the quadratic formula to check the relationship between the coefficients and the roots. A vieta's formulas calculator follows exactly this pattern: read a, b, and c, then return -b / a and c / a.
Now take the scaled case 2x^2 - 8x + 6. The leading coefficient is 2, not 1, and that changes the arithmetic. The sum is -b / a = 8 / 2 = 4, and the product is c / a = 6 / 2 = 3. The roots are 1 and 3: they add to 4 and multiply to 3. Notice what happens if you forget to divide by a first. Reading the coefficients directly would suggest a sum of 8 and a product of 6, which is wrong for this polynomial. Always divide by a before reporting either value. The same caution applies to the product of a cubic, which is -d / a, with the sign alternating by degree.
The sum of the squares of the roots follows from (sum)^2 - 2 × product. For x^2 - 5x + 6 that gives 5^2 - 2 × 6 = 25 - 12 = 13. For 2x^2 - 8x + 6 it gives 4^2 - 2 × 3 = 16 - 6 = 10, consistent with the roots 1 and 3, since 1^2 + 3^2 = 10. This identity is a quick way to check that your sum and product are right before you trust them.
The same reasoning extends to higher degrees. For the cubic x^3 - 6x^2 + 11x - 6, the sum of the roots is 6, the pairwise products add to 11, and the product of the roots is 6. The sum of the squares of the roots is 14, again from (sum)^2 - 2 × product. These checks are useful when you use the calculator on a polynomial whose coefficients have a common factor or a sign that looks unusual.
- x^2 - 5x + 6: sum = 5, product = 6, roots 2 and 3, sum of squares 13.
- 2x^2 - 8x + 6: sum = 4, product = 3, roots 1 and 3, sum of squares 10.
- x^3 - 6x^2 + 11x - 6: sum = 6, pairwise products add to 11, product = 6, sum of squares 14.
Vieta's formulas for a cubic
A cubic equation written as a x^3 + b x^2 + c x + d = 0 has three roots, and Vieta's formulas connect those roots to the coefficients without requiring you to solve the equation. For the cubic x^3 - 6x^2 + 11x - 6, the coefficients are a = 1, b = -6, c = 11 and d = -6. Vieta's formulas tell you three things up front: the sum of the roots is 6, the pairwise products add to 11, and the product of the roots is 6. Notice how the product of the roots is -d / a, with the sign alternating by degree: for a quadratic the product is c / a, but for a cubic it is -d / a. Here -d / a = -(-6) / 1 = 6.
The roots of this cubic are 1, 2 and 3, and each Vieta relation can be checked directly against them. The sum is 1 + 2 + 3 = 6, matching the coefficient relation. The pairwise products are 1·2, 1·3 and 2·3, which give 2, 3 and 6; adding those gives 11, matching the second relation. The product of all three roots is 1 · 2 · 3 = 6, matching the third relation. Nothing about these checks requires factoring the polynomial first — you can run them in either direction, from roots to coefficients or from coefficients to the expected root behavior. A vieta's formulas calculator automates exactly this kind of substitution and comparison.
The sum of the squares of the roots is not one of the three basic Vieta relations, but it follows from them. Using (sum)^2 - 2 x product, where the product here means the sum of the pairwise products, you get 6^2 - 2 · 11 = 36 - 22 = 14. Checking against the actual roots: 1^2 + 2^2 + 3^2 = 1 + 4 + 9 = 14. The same identity applied to a quadratic explains the pattern: for x^2 - 5x + 6 the sum of the roots is 5 and the product is 6, with roots 2 and 3, and (sum)^2 - 2 x product gives 25 - 12 = 13, which equals 2^2 + 3^2. For 2x^2 - 8x + 6 the sum is 4 and the product 3, with roots 1 and 3, and the same calculation gives 16 - 6 = 10 = 1 + 9.
The sign pattern is the detail most often missed. For a quadratic a x^2 + b x + c, Vieta's formulas give sum = -b / a and product = c / a. For a cubic, the sum of the roots is -b / a, the pairwise sum is c / a, and the product is -d / a. The alternating signs continue with degree, which is why the cubic product carries a minus sign while the quadratic product does not. When you enter coefficients into a Vieta's formulas calculator, confirm each result against the degree of the polynomial rather than assuming the quadratic pattern carries over unchanged.
One practical note: Vieta's formulas describe the roots as a set, including multiplicity, and they hold for any cubic with the stated coefficients, not only for cubics that factor neatly into whole numbers. The example x^3 - 6x^2 + 11x - 6 is convenient because its roots are 1, 2 and 3, so every relation can be verified by hand, but the coefficient relations themselves are what the formulas assert.
- Sum of roots: 1 + 2 + 3 = 6
- Pairwise products: 1·2 + 1·3 + 2·3 = 2 + 3 + 6 = 11
- Product of roots: 1 · 2 · 3 = 6
- Sum of squares: 6^2 - 2 · 11 = 36 - 22 = 14, and 1^2 + 2^2 + 3^2 = 14
Using Vieta's formulas in practice
A vieta's formulas calculator is most useful when you treat it as a checking tool rather than a replacement for your own work. Take the quadratic x^2 - 5x + 6. Vieta's formulas say the sum of the roots is -b / a and the product is c / a, so here the sum is 5 and the product is 6. If you have factored the expression as (x - 2)(x - 3), you can confirm the factorization without multiplying anything out: the roots 2 and 3 add to 5 and multiply to 6, which matches. The same check works when the leading coefficient is not 1. For 2x^2 - 8x + 6, the sum is 4 and the product is 3, and the roots 1 and 3 satisfy both conditions. If a proposed factorization gives a different sum or product, you know immediately that something is wrong, and you can look for the error before going further.
Vieta's formulas also run in reverse: given the roots, you can build the equation. If you know the roots add to 5 and multiply to 6, a quadratic with those roots is x^2 - 5x + 6 = 0. In general, the sum tells you the coefficient of x (with the sign flipped and divided by a), and the product tells you the constant term (divided by a). This is handy when a problem hands you root information instead of an equation, because you can write down the polynomial directly and skip the step of expanding factors by hand.
The most powerful use is answering questions about symmetric functions of the roots without ever solving the equation. The sum of the squares of the roots follows from (sum)^2 - 2 x product. For x^2 - 5x + 6, that gives 5^2 - 2 x 6 = 13. For the cubic x^3 - 6x^2 + 11x - 6, the sum of the roots is 6, the pairwise products add to 11, and the product is 6, so the sum of squares is 6^2 - 2 x 11 = 14. Notice that neither calculation required finding the individual roots. That is the point of Vieta's formulas: quantities built symmetrically from the roots can be computed straight from the coefficients.
Cubics follow the same pattern, with one detail worth remembering: the product of the roots is -d / a, and the sign alternates by degree. For the cubic above, a is 1 and d is -6, so the product is 6, consistent with the roots 1, 2, and 3. When you use a vieta's formulas calculator, enter the coefficients carefully, especially the signs, and compare the reported sum and product against what you expect from your factorization or your root estimates. Treat the output as a fast cross-check, then confirm the reasoning yourself.
- Check a factorization: for x^2 - 5x + 6, the roots 2 and 3 give sum 5 and product 6, matching Vieta's formulas.
- Build an equation from roots: a sum of 5 and a product of 6 point to x^2 - 5x + 6 = 0.
- Find symmetric functions without solving: the sum of squares is (sum)^2 - 2 x product, giving 13 for x^2 - 5x + 6 and 14 for x^3 - 6x^2 + 11x - 6.
- Watch the signs: for a quadratic, sum = -b / a and product = c / a; for a cubic, the product is -d / a.
FAQs
What are Vieta's formulas?
Vieta's formulas are relations between a polynomial's coefficients and its roots. For a quadratic, the sum of the roots equals -b / a and the product of the roots equals c / a. These formulas let you work with root sums and products directly from the coefficients, without factoring or solving the equation first.
What are the sum and product of the roots of x^2 - 5x + 6?
For x^2 - 5x + 6, the sum of the roots is 5 and the product is 6, since sum = -b / a = 5 / 1 and product = c / a = 6 / 1. The roots themselves are 2 and 3, and they check out: 2 + 3 = 5 and 2 x 3 = 6.
How do I handle a leading coefficient that is not 1?
Divide through by a in the formulas: the sum is -b / a and the product is c / a, so the leading coefficient is never ignored. For example, 2x^2 - 8x + 6 has sum 4 and product 3, since -(-8) / 2 = 4 and 6 / 2 = 3. Always divide by a before reading off the results.
What is Vieta's formula for a cubic's product of roots?
For a cubic, the product of the roots is -d / a. In x^3 - 6x^2 + 11x - 6, the product is 6, because -(-6) / 1 = 6. The sign matters here: the constant term's sign flips in the formula, so check the leading coefficient and the constant term carefully before you trust the result.
Can I get the sum of the squares of the roots without solving?
Yes. Use (sum)^2 - 2 x product, which needs only the coefficients. For x^2 - 5x + 6, the sum is 5 and the product is 6, giving 25 - 12 = 13. For the cubic example, the same approach gives 14. No factoring or root-finding is required to get these values.
How do I build an equation from roots 2 and 3?
Work backward from the sum and product. Roots 2 and 3 give sum 5 and product 6, and those values give x^2 - 5x + 6 directly: the coefficient of x is the negative of the sum and the constant term is the product. So the equation is x^2 - 5x + 6 = 0.