Polynomials

Study Sheet

Polynomials

Newton and the roots-of-unity filter

Symmetric Functions of Roots

Tip
Newton's identities

Power sums pk=∑rikp_k = \sum r_i^k come from the Vieta sums eje_j: p1=e1p_1 = e_1, p2=e1p1−2e2p_2 = e_1p_1 - 2e_2, p3=e1p2−e2p1+3e3p_3 = e_1p_2 - e_2p_1 + 3e_3.

In plain terms. You can compute the sum of the kkth powers of the roots step by step from the coefficients — without ever finding the roots.

Example. If roots sum to e1=3e_1 = 3 and pair-sum to e2=1e_2 = 1, then p2=∑ri2=3⋅3−2⋅1=7p_2 = \sum r_i^2 = 3\cdot 3 - 2\cdot 1 = 7.

Reminder — Vieta's formulas:  r1+r2=−ba,r1r2=car_1+r_2=-\frac{b}{a},\qquad r_1 r_2=\frac{c}{a}

Why they hold. Each root satisfies its polynomial. For a cubic x3−e1x2+e2x−e3x^3 - e_1x^2 + e_2x - e_3, every root has r3=e1r2−e2r+e3r^3 = e_1r^2 - e_2r + e_3; multiply by rk−3r^{k-3} and add over the three roots to get pk=e1pk−1−e2pk−2+e3pk−3p_k = e_1p_{k-1} - e_2p_{k-2} + e_3p_{k-3} for k≥3k \ge 3 (with p0=3p_0 = 3, which is where the 3e33e_3 in p3p_3 comes from). So the power sums obey the same linear recurrence as the polynomial, and each is computed from the previous three.

Example
Worked: a fifth power sum

The roots of x3−x−1=0x^3 - x - 1 = 0 are aa, bb, cc. Find a5+b5+c5a^5 + b^5 + c^5.

Spotting it. Each root satisfies r3=r+1r^3 = r + 1, so the power sums satisfy pk=pk−2+pk−3p_k = p_{k-2} + p_{k-3}.

Step 1. p0=3p_0 = 3, p1=e1=0p_1 = e_1 = 0, p2=e12−2e2=0−2(−1)=2p_2 = e_1^2 - 2e_2 = 0 - 2(-1) = 2.

Step 2. p3=p1+p0=3p_3 = p_1 + p_0 = 3, p4=p2+p1=2p_4 = p_2 + p_1 = 2, p5=p3+p2=5p_5 = p_3 + p_2 = 5. The answer is 55.

Example
Worked: power sums without a polynomial

Real numbers aa, bb, cc satisfy a+b+c=3a + b + c = 3, a2+b2+c2=5a^2 + b^2 + c^2 = 5 and a3+b3+c3=7a^3 + b^3 + c^3 = 7. Find a4+b4+c4a^4 + b^4 + c^4.

Spotting it. Three power sums determine the three elementary symmetric sums, which determine every other power sum. Run Newton forwards to recover e2e_2 and e3e_3, then once more.

Step 1. p2=e1p1−2e2p_2 = e_1p_1 - 2e_2: 5=9−2e25 = 9 - 2e_2, so e2=2e_2 = 2.

Step 2. p3=e1p2−e2p1+3e3p_3 = e_1p_2 - e_2p_1 + 3e_3: 7=15−6+3e37 = 15 - 6 + 3e_3, so e3=−23e_3 = -\tfrac23.

Step 3. p4=e1p3−e2p2+e3p1=21−10−2=9p_4 = e_1p_3 - e_2p_2 + e_3p_1 = 21 - 10 - 2 = 9.

Side note
Where it goes wrong

Dropping the coefficient in p2p_2. It is p2=e12−2e2p_2 = e_1^2 - 2e_2, because (a+b+c)2(a + b + c)^2 contains each cross product twice; writing e12−e2e_1^2 - e_2 in the second worked example gives e2=4e_2 = 4 and a wrong p4p_4. And keep the signs of the cubic straight: for x3+px2+qx+rx^3 + px^2 + qx + r, e1=−pe_1 = -p, e2=qe_2 = q, e3=−re_3 = -r.

Try it
Try it: fourth powers of two roots

The roots of x2−3x+1=0x^2 - 3x + 1 = 0 are rr and ss. Find r4+s4r^4 + s^4.

Show the answer

r2+s2=9−2=7r^2 + s^2 = 9 - 2 = 7, and r4+s4=(r2+s2)2−2(rs)2=49−2=47r^4 + s^4 = (r^2 + s^2)^2 - 2(rs)^2 = 49 - 2 = 47.

The Roots of Unity Filter

Concept
Extracting every nth coefficient

To sum the coefficients of x0,xn,x2n,…x^0, x^n, x^{2n},\dots in PP, average PP over the nnth roots of unity: 1n∑jP(ωj)\tfrac1n\sum_{j} P(\omega^j).

In plain terms. Plugging the symmetric roots of unity in and averaging cancels every term except the ones whose exponent is a multiple of nn.

Example. (n0)+(n3)+(n6)+⋯=13(2n+2cos⁡nπ3)\dbinom n0+\dbinom n3+\dbinom n6+\cdots = \tfrac13\big(2^n + 2\cos\tfrac{n\pi}{3}\big) via the cube roots of unity.

Why it works. Plug ωj\omega^j into P(x)=∑akxkP(x) = \sum a_kx^k and average over j=0,…,n−1j = 0, \dots, n - 1. The coefficient aka_k gets multiplied by 1n∑jωjk\tfrac1n\sum_j \omega^{jk}. When n∣kn \mid k every term is 11 and the average is 11; otherwise it is the average of a full set of rotated roots of unity, which is 00. To pick out the indices k≡r(modn)k \equiv r \pmod n instead, average ω−jrP(ωj)\omega^{-jr}P(\omega^j).

Example
Worked: sizes divisible by 3
1120°240°60°
The cube roots of unity at 0∘,120∘,240∘0^\circ, 120^\circ, 240^\circ; adding 1 and ω\omega lands on the unit circle at 60∘60^\circ, the point −ω2-\omega^2.

Let NN be the number of subsets of {1,2,…,12}\{1, 2, \dots, 12\} whose size is a multiple of 33. Find the remainder when NN is divided by 10001000.

Spotting it. N=∑3∣k(12k)N = \sum_{3 \mid k}\binom{12}{k}: every third coefficient of (1+x)12(1 + x)^{12}.

Step 1. N=13[212+(1+ω)12+(1+ω2)12]N = \tfrac13\left[2^{12} + (1 + \omega)^{12} + (1 + \omega^2)^{12}\right].

Step 2. 1+ω=−ω21 + \omega = -\omega^2 is a unit complex number at 60∘60^\circ, so its 1212th power is at 720∘720^\circ: (1+ω)12=1(1 + \omega)^{12} = 1, and likewise (1+ω2)12=1(1 + \omega^2)^{12} = 1.

Step 3. N=4096+23=1366N = \tfrac{4096 + 2}{3} = 1366, and the remainder is 366366.

Example
Worked: subsets with sum divisible by 3

How many subsets of {1,2,…,9}\{1, 2, \dots, 9\} (including the empty set) have a sum divisible by 33?

Spotting it. Encode each element kk as a factor 1+xk1 + x^k: the coefficient of xsx^s in F(x)=∏k=19(1+xk)F(x) = \prod_{k=1}^{9}(1 + x^k) counts subsets with sum ss. Filter the exponents divisible by 33.

Step 1. Mod 33 the elements are three 00s, three 11s and three 22s, so at a cube root of unity ω\omega: F(ω)=(1+1)3(1+ω)3(1+ω2)3F(\omega) = (1 + 1)^3(1 + \omega)^3(1 + \omega^2)^3.

Step 2. (1+ω)(1+ω2)=1+ω+ω2+ω3=0+1=1(1 + \omega)(1 + \omega^2) = 1 + \omega + \omega^2 + \omega^3 = 0 + 1 = 1, so F(ω)=8F(\omega) = 8; likewise F(ω2)=8F(\omega^2) = 8. And F(1)=29=512F(1) = 2^9 = 512.

Step 3. The count is 13(512+8+8)=176\tfrac13(512 + 8 + 8) = 176.

Side note
Where it goes wrong

Filtering the wrong residue class. The plain average keeps the exponents ≡0(modn)\equiv 0 \pmod n. For subsets of {1,…,12}\{1, \dots, 12\} with size ≡1(mod3)\equiv 1 \pmod 3 you must average ω−j(1+ωj)12\omega^{-j}(1 + \omega^j)^{12}: that gives 13(4096+ω2+ω)=40953=1365\tfrac13\left(4096 + \omega^2 + \omega\right) = \tfrac{4095}{3} = 1365, not 13661366. The three residue classes must add to 40964096, and 1366+1365+13651366 + 1365 + 1365 does.

Try it
Try it: every fourth coefficient

Compute (100)+(104)+(108)\dbinom{10}{0} + \dbinom{10}{4} + \dbinom{10}{8} using the fourth roots of unity.

Show the answer

Average (1+x)10(1 + x)^{10} over x=1,i,−1,−ix = 1, i, -1, -i: 14[210+(1+i)10+0+(1−i)10]\tfrac14\left[2^{10} + (1 + i)^{10} + 0 + (1 - i)^{10}\right]. Since (1+i)2=2i(1 + i)^2 = 2i, (1+i)10=(2i)5=32i(1 + i)^{10} = (2i)^5 = 32i and (1−i)10=−32i(1 - i)^{10} = -32i. The sum is 10244=256\tfrac{1024}{4} = 256. Check: 1+210+45=2561 + 210 + 45 = 256 ✓

Roots, Factors and Clever Evaluations

Tip
The factor and remainder theorems, used backwards

p(a)=0  ⟺  (x−a)∣pp(a) = 0 \iff (x-a) \mid p; the remainder of pp on division by x−ax - a is p(a)p(a).

AIME problems rarely give the polynomial outright — they give conditions. "The polynomial pp of degree 44 satisfies p(k)=k2p(k) = k^2 for k=1,2,3,4k = 1,2,3,4" is really "p(x)−x2p(x) - x^2 has roots 1,2,3,41,2,3,4", so p(x)=x2+c(x−1)(x−2)(x−3)(x−4)p(x) = x^2 + c(x-1)(x-2)(x-3)(x-4) and one more condition pins cc. Subtracting the pattern the values follow is the move.

Tip
Evaluation tricks

Set x=1x = 1 to sum the coefficients; x=−1x = -1 for the alternating sum; p(1)+p(−1)2\tfrac{p(1) + p(-1)}2 for the even-index coefficients.

These convert "the sum of the coefficients of (2x−3)10(2x-3)^{10}" into (2−3)10=1(2-3)^{10} = 1 with no expansion. The roots-of-unity filter is the general form: averaging pp over the nn-th roots of unity keeps only the coefficients whose index is divisible by nn.

Example
Worked: build the polynomial from conditions

A monic cubic pp satisfies p(1)=p(2)=p(3)=0p(1) = p(2) = p(3) = 0 and p(0)=−6p(0) = -6. Find p(4)p(4).

Step 1 — the roots give p(x)=a(x−1)(x−2)(x−3)p(x) = a(x-1)(x-2)(x-3).

Step 2 — p(0)=a(−1)(−2)(−3)=−6a=−6p(0) = a(-1)(-2)(-3) = -6a = -6, so a=1a = 1 (consistent with monic).

Step 3 — p(4)=(3)(2)(1)=6p(4) = (3)(2)(1) = 6.

Try it
Try it: sum of coefficients

What is the sum of the coefficients of (3x−2)5(3x - 2)^5?

Show the answer

Set x=1x = 1: (3−2)5=1(3-2)^5 = 1.

Example
Worked: subtract the pattern

A monic polynomial pp of degree 44 satisfies p(k)=k2p(k) = k^2 for k=1,2,3,4k = 1, 2, 3, 4. Find p(5)p(5).

Spotting it. The values follow the pattern k2k^2, so p(x)−x2p(x) - x^2 has roots 1,2,3,41, 2, 3, 4.

Step 1. p(x)−x2p(x) - x^2 has degree 44 and leading coefficient 11 (the x2x^2 does not touch the x4x^4 term), so p(x)−x2=(x−1)(x−2)(x−3)(x−4)p(x) - x^2 = (x - 1)(x - 2)(x - 3)(x - 4).

Step 2. p(5)=25+4⋅3⋅2⋅1=49p(5) = 25 + 4 \cdot 3 \cdot 2 \cdot 1 = 49.

Example
Worked: the even-power coefficients

Find the sum of the coefficients of the even powers of xx in (1+2x)6(1 + 2x)^6.

Spotting it. p(1)p(1) adds all the coefficients and p(−1)p(-1) adds them with alternating signs, so their average keeps only the even powers.

Step 1. p(1)=36=729p(1) = 3^6 = 729 and p(−1)=(−1)6=1p(-1) = (-1)^6 = 1.

Step 2. The even-power coefficients add to 729+12=365\tfrac{729 + 1}{2} = 365.

Side note
Where it goes wrong

Forgetting the leading coefficient when you subtract the pattern. If the polynomial in the first worked example were only said to have degree 44 (not monic), then p(x)−x2=c(x−1)(x−2)(x−3)(x−4)p(x) - x^2 = c(x - 1)(x - 2)(x - 3)(x - 4) with cc unknown, and one more condition is needed; assuming c=1c = 1 silently gives 4949 whether or not it is true. Count the unknowns against the conditions.

Formulas, Proofs & Tips

Tip
The distributive property
a(b+c)=ab+aca(b+c)=ab+ac

What it means. Multiplying a sum multiplies each piece of it.

Example. 3(x+2)=3x+63(x+2)=3x+6.

Why it works. a(b+c)a(b+c) is b+cb+c added aa times. Regrouping those copies gives bb added aa times plus cc added aa times, i.e. ab+acab+ac. It is also the area of an a×(b+c)a\times(b+c) rectangle split into two.

Tip. Distribute the sign too: −(x−4)=−x+4-(x-4)=-x+4. Run it backwards to factor.

Tip
Degree and end behaviour
deg⁡(fg)=deg⁡f+deg⁡g;leading term controls the ends\deg(fg)=\deg f+\deg g;\qquad \text{leading term controls the ends}

What it means. The highest-power term decides what the graph does far left and far right.

Example. −2x3+⋯-2x^3+\cdots rises to the left and falls to the right (odd degree, negative lead).

Why it works. For very large ∣x∣|x|, xnx^{n} dwarfs every lower power, so the leading term dominates the sum. Multiplying polynomials multiplies their leading terms, adding the exponents.

Tip. Even degree: both ends go the same way. Odd degree: opposite ways. A positive leading coefficient sends the right end up.