# Descartes' rules of signs

Hard to believe that I don't remember seeing Descartes' rules of signs before -- you'd think this is impossible given the time I spent on those kinds of things in middle school. Anyways, it says:

If the terms of a single-variable polynomial with real coefficients are ordered by descending variable exponent, then the number of positive roots of the polynomial is either equal to the number of sign differences between consecutive nonzero coefficients, or is less than it by an even number. Multiple roots of the same value are counted separately.

Proof:

By induction on the number of positive roots. All zero coefficients are ignored here. The base case is a polynomial $$f(x)$$ without any positive root. Clearly the first and last cofficients must have the same sign, as otherwise $$f(x)$$ has a positive root between $$0$$ and $$\infty$$. So the base case is resolved.

Now, let $$g(x)=f(x)(x-a)$$ with $$a>0$$. It is not hard to observe that the number of sign changes increases at least $$1$$, with parity altered.
Q.E.D.