Math Core

Module 1.1 · Algebra

Advanced Vieta's formulas

On the AIME you are rarely asked to find the roots of a polynomial. Instead you get a cubic or quartic with ugly roots and a question about some symmetric combination of them. Vieta's formulas, Newton's sums and a few evaluation tricks let you answer without ever solving the equation.

Vieta's formulas for any degree

If P(x)=anxn+an−1xn−1+⋯+a0P(x) = a_n x^n + a_{n-1}x^{n-1} + \dots + a_0 has roots r1,r2,…,rnr_1, r_2, \dots, r_n (counted with multiplicity), then

P(x)=an(x−r1)(x−r2)⋯(x−rn).P(x) = a_n (x - r_1)(x - r_2)\cdots(x - r_n).

Expanding the right side and matching coefficients gives the elementary symmetric sums:

e1=∑ri=−an−1an,e2=∑i<jrirj=an−2an,e3=∑i<j<krirjrk=−an−3an,e_1 = \sum r_i = -\frac{a_{n-1}}{a_n}, \qquad e_2 = \sum_{i<j} r_i r_j = \frac{a_{n-2}}{a_n}, \qquad e_3 = \sum_{i<j<k} r_i r_j r_k = -\frac{a_{n-3}}{a_n},

and so on with alternating signs, ending with r1r2⋯rn=(−1)na0anr_1 r_2 \cdots r_n = (-1)^n \dfrac{a_0}{a_n}.

For a monic cubic x3+bx2+cx+dx^3 + bx^2 + cx + d with roots r,s,tr, s, t this is the familiar

r+s+t=−b,rs+st+tr=c,rst=−d.r + s + t = -b, \qquad rs + st + tr = c, \qquad rst = -d.

The real power comes from a theorem: every symmetric polynomial in the roots can be written in terms of e1,e2,…,ene_1, e_2, \dots, e_n. So any symmetric expression is computable from the coefficients alone. Your job is to find the rewrite quickly.

Some rewrites to know cold (for three roots):

ExpressionIn terms of e1,e2,e3e_1, e_2, e_3
r2+s2+t2r^2 + s^2 + t^2e12−2e2e_1^2 - 2e_2
1r+1s+1t\dfrac{1}{r} + \dfrac{1}{s} + \dfrac{1}{t}e2e3\dfrac{e_2}{e_3}
(r+s)(s+t)(t+r)(r+s)(s+t)(t+r)e1e2−e3e_1 e_2 - e_3
r2s2+s2t2+t2r2r^2 s^2 + s^2 t^2 + t^2 r^2e22−2e1e3e_2^2 - 2e_1 e_3
r3+s3+t3r^3 + s^3 + t^3e13−3e1e2+3e3e_1^3 - 3e_1 e_2 + 3e_3

For (r+s)(s+t)(t+r)(r+s)(s+t)(t+r), notice r+s=e1−tr + s = e_1 - t, so the product is (e1−r)(e1−s)(e1−t)(e_1 - r)(e_1 - s)(e_1 - t). That is the polynomial (x−r)(x−s)(x−t)(x - r)(x - s)(x - t) evaluated at x=e1x = e_1, which leads to the next big idea.

Newton's sums

Let pk=r1k+r2k+⋯+rnkp_k = r_1^k + r_2^k + \dots + r_n^k be the kkth power sum. Each root satisfies the polynomial, so for a monic cubic x3−e1x2+e2x−e3x^3 - e_1x^2 + e_2x - e_3 you have r3=e1r2−e2r+e3r^3 = e_1r^2 - e_2r + e_3. Multiply by rk−3r^{k-3} and add over all three roots:

Newton's sums for a cubic

If r,s,tr, s, t are the roots of x3−e1x2+e2x−e3x^3 - e_1x^2 + e_2x - e_3 and pk=rk+sk+tkp_k = r^k + s^k + t^k, then

p1=e1,p2=e1p1−2e2,p3=e1p2−e2p1+3e3,p_1 = e_1, \qquad p_2 = e_1p_1 - 2e_2, \qquad p_3 = e_1p_2 - e_2p_1 + 3e_3,

and for k≥4k \ge 4,

pk=e1pk−1−e2pk−2+e3pk−3.p_k = e_1 p_{k-1} - e_2 p_{k-2} + e_3 p_{k-3}.

The first few formulas have the "extra" terms 2e22e_2 and 3e33e_3 because p0=3p_0 = 3, not 11. From k=4k = 4 on it is a clean linear recursion, and the same idea works for any degree.

Common mistake

Watch the signs. Vieta's formulas alternate: for x3+bx2+cx+dx^3 + bx^2 + cx + d, the root sum is −b-b and the product is −d-d. Before using Newton's sums, rewrite the polynomial as x3−e1x2+e2x−e3x^3 - e_1x^2 + e_2x - e_3 and read off e1,e2,e3e_1, e_2, e_3 with their signs. Also divide through by the leading coefficient first if the polynomial isn't monic.

Evaluating the polynomial

If P(x)=an(x−r1)⋯(x−rn)P(x) = a_n(x - r_1)\cdots(x - r_n), then plugging in a number cc gives a product over the roots for free:

(c−r1)(c−r2)⋯(c−rn)=P(c)an.(c - r_1)(c - r_2)\cdots(c - r_n) = \frac{P(c)}{a_n}.

Two consequences show up constantly.

  • Products like ∏(ri2+1)\prod (r_i^2 + 1). Factor r2+1=(r−i)(r+i)r^2 + 1 = (r - i)(r + i). Then ∏(ri−i)(ri+i)\prod (r_i - i)(r_i + i) is P(i)P(−i)P(i)P(-i) up to sign, and since PP has real coefficients, P(−i)=P(i)‾P(-i) = \overline{P(i)}. So the product is ∣P(i)∣2|P(i)|^2 when PP is monic.
  • Sums like ∑1c−ri\sum \dfrac{1}{c - r_i}. Take the logarithmic derivative of P(x)=an∏(x−ri)P(x) = a_n \prod (x - r_i):
P′(x)P(x)=1x−r1+1x−r2+⋯+1x−rn.\frac{P'(x)}{P(x)} = \frac{1}{x - r_1} + \frac{1}{x - r_2} + \dots + \frac{1}{x - r_n}.

So ∑1c−ri=P′(c)P(c)\displaystyle\sum \frac{1}{c - r_i} = \frac{P'(c)}{P(c)}. (If you haven't seen derivatives: for a polynomial, P′(x)P'(x) is found by the rule that xkx^k becomes kxk−1kx^{k-1}.)

Tip

When a question mentions r+sr + s, s+ts + t, t+rt + r (or "the sum of the other two roots"), replace r+sr + s by e1−te_1 - t. The expression usually becomes a function of a single root, and then an evaluation trick finishes it.

Worked examples

Worked example: Newton's sums

Let r,s,tr, s, t be the roots of x3−4x2+2x−7=0x^3 - 4x^2 + 2x - 7 = 0. Find r3+s3+t3r^3 + s^3 + t^3.

Here e1=4e_1 = 4, e2=2e_2 = 2, e3=7e_3 = 7. Then

p1=4,p2=e1p1−2e2=16−4=12,p3=e1p2−e2p1+3e3=48−8+21=61.\begin{aligned} p_1 &= 4, \\ p_2 &= e_1p_1 - 2e_2 = 16 - 4 = 12, \\ p_3 &= e_1p_2 - e_2p_1 + 3e_3 = 48 - 8 + 21 = 61. \end{aligned}

The answer is 6161.

Worked example: Roots in geometric progression

The roots of x3−14x2+kx−64=0x^3 - 14x^2 + kx - 64 = 0 are three real numbers in geometric progression. Find kk.

Write the roots as mq,m,mq\dfrac{m}{q}, m, mq. Their product is m3=64m^3 = 64, so m=4m = 4 is a root. Plug it in: 64−224+4k−64=064 - 224 + 4k - 64 = 0, so k=56k = 56.

Check: the other two roots satisfy 4q+4q=14−4=10\dfrac{4}{q} + 4q = 14 - 4 = 10, so q=2q = 2 and the roots are 2,4,82, 4, 8. Indeed 2⋅4+4⋅8+8⋅2=562 \cdot 4 + 4 \cdot 8 + 8 \cdot 2 = 56.

Worked example: A product by evaluation

Let r,s,tr, s, t be the roots of P(x)=x3−3x2+5x−1P(x) = x^3 - 3x^2 + 5x - 1. Find (r2+4)(s2+4)(t2+4)(r^2 + 4)(s^2 + 4)(t^2 + 4).

Since r2+4=(r−2i)(r+2i)r^2 + 4 = (r - 2i)(r + 2i),

∏(r2+4)=∏(2i−r)⋅∏(−2i−r)=P(2i) P(−2i)=∣P(2i)∣2.\prod (r^2 + 4) = \prod (2i - r) \cdot \prod(-2i - r) = P(2i)\,P(-2i) = |P(2i)|^2.

(Each product of three factors (c−r)(c - r) equals P(c)P(c) because PP is monic.) Compute P(2i)=−8i+12+10i−1=11+2iP(2i) = -8i + 12 + 10i - 1 = 11 + 2i. So the answer is 112+22=12511^2 + 2^2 = 125.

Worked example: The logarithmic derivative

Let r,s,tr, s, t be the roots of P(x)=x3−2x2−5x+7P(x) = x^3 - 2x^2 - 5x + 7. Find 13−r+13−s+13−t\dfrac{1}{3 - r} + \dfrac{1}{3 - s} + \dfrac{1}{3 - t}.

The sum is P′(3)P(3)\dfrac{P'(3)}{P(3)}. Here P(3)=27−18−15+7=1P(3) = 27 - 18 - 15 + 7 = 1 and P′(x)=3x2−4x−5P'(x) = 3x^2 - 4x - 5, so P′(3)=27−12−5=10P'(3) = 27 - 12 - 5 = 10. The answer is 1010.

Without derivatives you could combine the fractions: the numerator is ∑(3−s)(3−t)\sum (3 - s)(3 - t) and the denominator is P(3)P(3), and you would get the same 1010 after more work.

Practice

Practice 1

Let a,b,ca, b, c be the roots of x3−9x2+14x−3=0x^3 - 9x^2 + 14x - 3 = 0. Find a2+b2+c2a^2 + b^2 + c^2.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Let r,s,tr, s, t be the roots of x3−5x2+3x−1=0x^3 - 5x^2 + 3x - 1 = 0. Find r3+s3+t3r^3 + s^3 + t^3.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Let a,b,ca, b, c be the roots of x3−12x2+44x−45=0x^3 - 12x^2 + 44x - 45 = 0. Find (a+b)(b+c)(c+a)(a + b)(b + c)(c + a).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

The roots of x3−15x2+kx−105=0x^3 - 15x^2 + kx - 105 = 0 are three real numbers in arithmetic progression. Find kk.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Let r,s,tr, s, t be the roots of P(x)=x3−2x2+9x−20P(x) = x^3 - 2x^2 + 9x - 20. Find (r2+1)(s2+1)(t2+1)(r^2 + 1)(s^2 + 1)(t^2 + 1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Let r,s,tr, s, t be the roots of x3−6x2+11x−5=0x^3 - 6x^2 + 11x - 5 = 0. Then

14−r+14−s+14−t=mn,\frac{1}{4 - r} + \frac{1}{4 - s} + \frac{1}{4 - t} = \frac{m}{n},

where mm and nn are relatively prime positive integers. Find m+nm + n.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Let a,b,ca, b, c be the roots of x3−3x+1=0x^3 - 3x + 1 = 0. Find a6+b6+c6a^6 + b^6 + c^6.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Let r,s,tr, s, t be the roots of x3−6x2+3x+1=0x^3 - 6x^2 + 3x + 1 = 0. Then

1r+s+1s+t+1t+r=mn,\frac{1}{r + s} + \frac{1}{s + t} + \frac{1}{t + r} = \frac{m}{n},

where mm and nn are relatively prime positive integers. Find m+nm + n.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Real contest practice