Vieta's Formulas: Answering Without Solving
The coefficients of a polynomial already tell you the sum and product of its roots, so many interview questions about roots can be answered without ever finding the roots themselves.
An interviewer gives you and asks for the sum of the squares of the roots. The instinct is to solve the quadratic, get and , then compute . That works fine here because the roots are clean integers — but change the coefficients slightly and the roots become ugly irrational numbers, and "just solve it" turns into a mess of nested radicals. Vieta's formulas let you skip solving entirely: the coefficients themselves already encode the sum and product of the roots.
The formulas, one symbol at a time
For a quadratic with roots :
In plain English: the sum of the roots is minus the linear coefficient over the leading coefficient, and the product of the roots is the constant term over the leading coefficient — no need to know what the individual roots are. For a cubic with roots , the pattern extends: , the sum of pairwise products , and . Each coefficient, in order, gives you the next symmetric combination of the roots.
Worked example 1: sum of squares without solving
For : and . The sum of squares can be built from these using the identity — a rearrangement of . Plugging in: , matching the direct calculation above but generalizing instantly to coefficients that don't factor nicely, like , where the roots involve but the sum of squares is still exactly.
Worked example 2: reconstructing a cubic from its roots
An interviewer asks for a cubic with roots . Rather than expanding term by term, use Vieta's in reverse: sum , pairwise sum , product . For a monic cubic , that gives . Multiplying out the original factored form to check confirms the same polynomial — but Vieta's got there by reading off three sums instead of multiplying three binomials.
For any polynomial, the coefficients directly encode the sum, pairwise-sum, and product of the roots (with alternating signs by degree). Any question asking for a symmetric function of the roots — one unchanged by permuting them, like a sum or a sum of squares — can usually be answered from Vieta's alone, without solving.
If a question asks for something that treats the roots asymmetrically (like "the largest root" or "the positive root minus the negative root"), Vieta's alone won't get you there — you need at least partial information about which root is which.
Related concepts
Practice in interviews
Further reading
- Engel, Problem-Solving Strategies, ch. 1