Quant Memo
Core

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 x27x+10=0x^2 - 7x + 10 = 0 and asks for the sum of the squares of the roots. The instinct is to solve the quadratic, get x=2x = 2 and x=5x = 5, then compute 22+52=292^2 + 5^2 = 29. 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 ax2+bx+c=0ax^2 + bx + c = 0 with roots r1,r2r_1, r_2:

r1+r2=ba,r1r2=ca.r_1 + r_2 = -\frac{b}{a}, \qquad r_1 r_2 = \frac{c}{a} .

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 ax3+bx2+cx+d=0ax^3+bx^2+cx+d=0 with roots r1,r2,r3r_1,r_2,r_3, the pattern extends: r1+r2+r3=b/ar_1+r_2+r_3 = -b/a, the sum of pairwise products r1r2+r1r3+r2r3=c/ar_1r_2+r_1r_3+r_2r_3 = c/a, and r1r2r3=d/ar_1r_2r_3 = -d/a. Each coefficient, in order, gives you the next symmetric combination of the roots.

Worked example 1: sum of squares without solving

For x27x+10=0x^2 - 7x + 10 = 0: r1+r2=7r_1+r_2 = 7 and r1r2=10r_1 r_2 = 10. The sum of squares can be built from these using the identity r12+r22=(r1+r2)22r1r2r_1^2+r_2^2 = (r_1+r_2)^2 - 2r_1r_2 — a rearrangement of (r1+r2)2=r12+2r1r2+r22(r_1+r_2)^2 = r_1^2+2r_1r_2+r_2^2. Plugging in: 722(10)=4920=297^2 - 2(10) = 49 - 20 = 29, matching the direct calculation above but generalizing instantly to coefficients that don't factor nicely, like x27x+11=0x^2 - 7x + 11 = 0, where the roots involve 5\sqrt{5} but the sum of squares is still 722(11)=277^2 - 2(11) = 27 exactly.

Worked example 2: reconstructing a cubic from its roots

An interviewer asks for a cubic with roots 2,1,32, -1, 3. Rather than expanding (x2)(x+1)(x3)(x-2)(x+1)(x-3) term by term, use Vieta's in reverse: sum =2+(1)+3=4= 2+(-1)+3=4, pairwise sum =(2)(1)+(2)(3)+(1)(3)=2+63=1= (2)(-1)+(2)(3)+(-1)(3) = -2+6-3=1, product =(2)(1)(3)=6= (2)(-1)(3) = -6. For a monic cubic x3(sum)x2+(pairwise sum)x(product)x^3 - (\text{sum})x^2 + (\text{pairwise sum})x - (\text{product}), that gives x34x2+x+6x^3 - 4x^2 + x + 6. 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.

ax² + bx + c = 0 coefficients only Vieta r1+r2 = -b/a r1·r2 = c/a no square roots, no quadratic formula needed skip straight from coefficients to root relationships
Vieta's formulas are a shortcut directly from a polynomial's coefficients to symmetric facts about its roots, bypassing the need to solve for the roots themselves.

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
ShareTwitterLinkedIn