Polynomials

Study Sheet

Polynomials

Vieta, Newton, roots of unity, interpolation, integer polynomials

Working With Roots You Never Find

Tip
Vieta and Newton's identities

For xne1xn1+e2xn2x^n - e_1x^{n-1} + e_2x^{n-2} - \cdots, the eke_k are the elementary symmetric functions of the roots, and the power sums obey pk=e1pk1e2pk2+±kekp_k = e_1p_{k-1} - e_2p_{k-2} + \cdots \pm ke_k.

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

So ri2=e122e2\sum r_i^2 = e_1^2 - 2e_2 always (=4= 4 for x42x2+3x^4 - 2x^2 + 3, whose roots are complex), and any symmetric expression in the roots is a polynomial in the coefficients. The reverse direction — given p1,p2,p3p_1, p_2, p_3, recover e1,e2,e3e_1, e_2, e_3 and hence the roots — solves systems like x+y+z=6x + y + z = 6, x2+y2+z2=14x^2 + y^2 + z^2 = 14, x3+y3+z3=36x^3 + y^3 + z^3 = 36.

Tip
Roots of unity and the filter

k=0n1ωjk=n\sum_{k=0}^{n-1}\omega^{jk} = n if njn \mid j, else 00. Hence kr(n)ak=1njωjrP(ωj)\sum_{k \equiv r\,(n)}a_k = \tfrac1n\sum_j\omega^{-jr}P(\omega^j).

The filter extracts every nnth coefficient of a polynomial (or generating function): the number of subsets of {1..N}\{1..N\} with size divisible by 33, the sum of (n3k)\binom{n}{3k}, the coefficient sums of (1+x+x2)n(1 + x + x^2)^n at spacing 33. Also xn1=(xωk)x^n - 1 = \prod(x - \omega^k) gives k=1n1(1ωk)=n\prod_{k=1}^{n-1}(1 - \omega^k) = n and the trig products sinkπn=n2n1\prod\sin\tfrac{k\pi}{n} = \tfrac{n}{2^{n-1}}.

Tip
Integer polynomials and interpolation

For PZ[x]P \in \mathbb Z[x]: abP(a)P(b)a - b \mid P(a) - P(b). Lagrange: the degree-<n<n polynomial through nn points is iyijixxjxixj\sum_iy_i\prod_{j\ne i}\tfrac{x - x_j}{x_i - x_j}. Finite differences: a degree-dd polynomial has constant ddth differences.

The divisibility fact kills "find an integer polynomial with P(1)=2P(1) = 2, P(4)=7P(4) = 7" (353 \nmid 5). Interpolation with consecutive integer nodes is fastest by finite differences (P(0),P(1),P(2)=1,2,5P(0), P(1), P(2) = 1, 2, 5 gives second difference 22, so P(3)=10P(3) = 10). Chebyshev polynomials Tn(cosθ)=cosnθT_n(\cos\theta) = \cos n\theta handle "polynomial bounded by 11 on [1,1][-1,1]" extremal problems.

Side note
The remainder trick

To find x100mod(x21)x^{100} \bmod (x^2 - 1), do not divide: write x100=Q(x)(x21)+ax+bx^{100} = Q(x)(x^2 - 1) + ax + b and plug in the roots x=±1x = \pm1 of the divisor to get two equations for a,ba, b. For a repeated root, differentiate first. Remainders modulo a polynomial are found by evaluating, never by long division.

Try it
Try it: Newton in reverse

Real x,yx, y satisfy x+y=5x + y = 5 and x3+y3=35x^3 + y^3 = 35. Find xyxy.

x3+y3=(x+y)33xy(x+y)x^3 + y^3 = (x+y)^3 - 3xy(x+y): 35=12515xy35 = 125 - 15xy, so xy=6xy = 6 — and indeed {x,y}={2,3}\{x, y\} = \{2, 3\}.

Proofs & Why It Matters

Tip
Proof: Newton's identity for p2p_2 and the general pattern

p2=e122e2p_2 = e_1^2 - 2e_2, and in general pke1pk1+e2pk2+(1)kkek=0p_k - e_1p_{k-1} + e_2p_{k-2} - \cdots + (-1)^kke_k = 0.

e12=(ri)2=ri2+2i<jrirj=p2+2e2e_1^2 = (\sum r_i)^2 = \sum r_i^2 + 2\sum_{i<j}r_ir_j = p_2 + 2e_2 — rearrange. For the general identity, expand i(1rit)=(1)kektk\prod_i(1 - r_it) = \sum(-1)^ke_kt^k, take the logarithmic derivative, and compare coefficients of tk1t^{k-1} with iri1rit=kpktk1-\sum_i\tfrac{r_i}{1 - r_it} = -\sum_kp_kt^{k-1}. \blacksquare Significance: the generating-function proof is a template — many Putnam identities are "compare coefficients after a log-derivative."

Tip
Proof: the roots-of-unity filter

For P(x)=akxkP(x) = \sum a_kx^k and ω=e2πi/n\omega = e^{2\pi i/n}: nkak=1nj=0n1P(ωj)\sum_{n\mid k}a_k = \tfrac1n\sum_{j=0}^{n-1}P(\omega^j).

1njP(ωj)=kak1njωjk\tfrac1n\sum_jP(\omega^j) = \sum_ka_k\cdot\tfrac1n\sum_j\omega^{jk}, and the inner average is 11 when nkn \mid k (every term is 11) and 00 otherwise (a geometric series with ratio ωk1\omega^k \ne 1 summing to ωkn1ωk1=0\tfrac{\omega^{kn} - 1}{\omega^k - 1} = 0). \blacksquare Significance: this is the discrete Fourier transform in its simplest form; shifting by ωjr\omega^{-jr} picks out the residue class rr. It is how one counts subsets by size mod nn — a Putnam favorite.

Going Deeper: Worked Problems

Example
Worked: subsets by size mod 3

How many subsets of a 1010-element set have size divisible by 33?

Step 1 — the answer is 3k(10k)\sum_{3\mid k}\binom{10}{k}, the filter applied to P(x)=(1+x)10P(x) = (1 + x)^{10}.

Step 2 — 13[P(1)+P(ω)+P(ω2)]\tfrac13\left[P(1) + P(\omega) + P(\omega^2)\right] with ω=e2πi/3\omega = e^{2\pi i/3}: P(1)=1024P(1) = 1024; 1+ω=ω2=eiπ/31 + \omega = -\omega^2 = e^{i\pi/3}, so P(ω)=e10iπ/3=e2iπ/3P(\omega) = e^{10i\pi/3} = e^{-2i\pi/3}; similarly P(ω2)=e2iπ/3P(\omega^2) = e^{2i\pi/3}.

Step 3 — P(ω)+P(ω2)=2cos2π3=1P(\omega) + P(\omega^2) = 2\cos\tfrac{2\pi}{3} = -1.

Step 4 — total 102413=341\tfrac{1024 - 1}{3} = 341. Check: (100)+(103)+(106)+(109)=1+120+210+10=341\binom{10}{0} + \binom{10}{3} + \binom{10}{6} + \binom{10}{9} = 1 + 120 + 210 + 10 = 341 ✓.

Example
Worked: a polynomial determined by its values at integers

A polynomial PP of degree nn satisfies P(k)=kk+1P(k) = \dfrac{k}{k+1} for k=0,1,,nk = 0, 1, \ldots, n. Find P(n+1)P(n + 1).

Step 1 — consider Q(x)=(x+1)P(x)xQ(x) = (x + 1)P(x) - x, degree n+1n + 1, vanishing at x=0,1,,nx = 0, 1, \ldots, n: so Q(x)=cx(x1)(xn)Q(x) = c\,x(x-1)\cdots(x-n).

Step 2 — evaluate at x=1x = -1: Q(1)=0P(1)+1=1=c(1)(2)(n1)=c(1)n+1(n+1)!Q(-1) = 0\cdot P(-1) + 1 = 1 = c(-1)(-2)\cdots(-n-1) = c(-1)^{n+1}(n+1)!, giving c=(1)n+1(n+1)!c = \tfrac{(-1)^{n+1}}{(n+1)!}.

Step 3 — at x=n+1x = n + 1: Q(n+1)=c(n+1)!=(1)n+1Q(n+1) = c(n+1)! = (-1)^{n+1}, so (n+2)P(n+1)(n+1)=(1)n+1(n+2)P(n+1) - (n+1) = (-1)^{n+1} and P(n+1)=n+1+(1)n+1n+2P(n+1) = \dfrac{n + 1 + (-1)^{n+1}}{n + 2} — equal to 11 for odd nn and nn+2\tfrac{n}{n+2} for even nn. The auxiliary polynomial with known roots is THE technique for "values at consecutive integers."

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: (x4)=x+4-(x-4)=-x+4. Run it backwards to factor.

Tip
Degree and end behaviour
deg(fg)=degf+degg;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.