Descartes' Rule of Signs Calculator
Find the possible number of positive and negative real roots of any polynomial. Step-by-step sign changes shown.
Enter a polynomial's coefficients from highest to lowest degree (use 0 for any missing term). The calculator counts sign changes in f(x) and f(−x) to bound the possible number of positive and negative real roots, showing every step.
Use 0 for any missing terms.
What is Descartes' Rule of Signs?
Descartes' Rule of Signs is a quick way to narrow down how many positive and negative real roots a polynomial could have, just by counting how many times the signs of its coefficients switch — without solving the polynomial at all.
The rule doesn’t pin down the exact number of positive real roots on its own; instead, it gives the maximum possible count, with the true count being that maximum or any number less than it by a multiple of 2. This “or fewer by an even number” clause exists because complex roots always come in conjugate pairs for polynomials with real coefficients — every pair of complex roots that “hides” reduces the real root count by exactly 2. The rule was published by René Descartes in 1637, as part of the same landmark work (La Géométrie) that introduced the Cartesian coordinate system, though the version taught today has been refined and made fully rigorous since then.
Counting sign changes
A “sign change” happens between two consecutive nonzero coefficients (reading the polynomial from highest degree to lowest) whenever they have opposite signs. Coefficients that are exactly zero are simply skipped over — they don’t count as a sign change in either direction, and they don’t reset the comparison; the next nonzero coefficient after a zero is still compared to the last nonzero one before it.
Here the zero x² coefficient is dropped entirely before counting, leaving four nonzero signs (+, −, +, −) with three changes between consecutive pairs.
Finding negative real roots: substituting f(−x)
To bound the negative real roots, the same sign-counting process is applied, but to f(−x) instead of f(x). Substituting −x for x flips the sign of every term with an odd exponent, while terms with even exponents (including the constant term, which is degree 0) stay unchanged.
This is the step that’s easiest to get wrong by hand: it’s tempting to flip signs based on a term’s position in the list (every other term) rather than its actual degree, and those two only agree when the polynomial’s overall degree happens to be even. For an odd-degree polynomial, flipping by position instead of by degree gets every single sign backwards.
To see why, consider a degree-5 polynomial written from highest to lowest degree: the first term (index 0 in a list) has degree 5 — odd — so it should flip. But “flip every other term starting from the first” would instead flip the second term (index 1, which has degree 4 — even, and should NOT flip). The two rules only coincide when the leading term’s degree is even to begin with, which happens exactly when the whole polynomial’s degree is even.
Step-by-step process
- Write the polynomial in standard form, highest degree to lowest, including a zero coefficient placeholder for any missing power.
- List the signs of the nonzero coefficients in f(x), and count the changes between consecutive signs. This is the maximum possible count of positive real roots.
- Build f(−x) by flipping the sign of every term whose degree is odd, leaving even-degree terms (including the constant) unchanged.
- List the signs of the nonzero coefficients in f(−x), and count the changes. This is the maximum possible count of negative real roots.
- List the possible counts for each, stepping down by 2 from the maximum until reaching 0 or 1.
- Combine with the polynomial’s degree to work out how many complex (non-real) roots accompany each combination, since positive roots + negative roots + complex roots (in conjugate pairs) must always add up to the total degree.
Worked example
Apply Descartes’ Rule to f(x) = x⁵ − 3x⁴ + 2x² + x − 5.
Positive roots: the nonzero coefficient signs are +, −, +, +, −, giving sign changes at (+→−), (−→+), and (+→−): 3 sign changes. Possible positive real root counts: 3 or 1.
Negative roots: build f(−x) by flipping the sign of every odd-degree term (degrees 5, 3, 1 in this polynomial — note the x³ term has coefficient 0, so there’s nothing to flip there):
Nonzero signs: −, −, +, −, −, giving 2 sign changes (at −→+ and +→−). Possible negative real root counts: 2 or 0.
| Positive roots | Negative roots | Complex pairs |
|---|---|---|
| 3 | 2 | 0 |
| 3 | 0 | 1 |
| 1 | 2 | 1 |
| 1 | 0 | 2 |
Since the polynomial has degree 5, every valid row must sum to 5 once each complex pair is counted twice: 3+2+0×2=5, 3+0+1×2=5, 1+2+1×2=5, 1+0+2×2=5 — all four combinations check out arithmetically, and Descartes’ Rule alone can’t say which one actually occurs without further work (like graphing, numerical root-finding, or the rational root theorem for any rational candidates).
Worked example: an even-degree polynomial
Apply Descartes’ Rule to g(x) = x⁴ − 5x² + 4.
Positive roots: nonzero coefficient signs are +, −, +, giving 2 sign changes (+→− and −→+). Possible positive real root counts: 2 or 0.
Negative roots: since every nonzero term here has an even degree (4, 2, and 0), f(−x) has exactly the same coefficients as f(x) — no signs flip at all: g(−x) = x⁴ − 5x² + 4, again with 2 sign changes. Possible negative real root counts: 2 or 0.
This polynomial actually factors as (x²−1)(x²−4) = (x−1)(x+1)(x−2)(x+2), giving four real roots: 1, −1, 2, −2 — two positive and two negative, which matches the “2 positive, 2 negative” row from the possible combinations, with 0 complex pairs. This example is a useful contrast to the odd-degree case above, since here f(x) and f(−x) happen to have identical sign patterns — a coincidence specific to polynomials built entirely from even powers, not a general rule.
Checking your answer
Descartes’ Rule can’t be “checked” the way a direct calculation can, since it only narrows down possibilities rather than computing an exact answer — but its output can be cross-checked for internal consistency. Every row in the positive/negative/complex-pairs combination table must have its three values add up to exactly the polynomial’s degree, once complex pairs are counted twice each (since each pair contributes two roots). If a claimed combination doesn’t sum correctly, something was miscounted upstream.
A second sanity check: if a specific real root is already known or suspected (for instance, by testing small integer candidates via the rational root theorem, or by evaluating the polynomial at a couple of points and looking for a sign change), it should be consistent with being positive or negative according to which of Descartes’ predicted counts is later confirmed to be the actual one.
Why the actual count can be lower than the maximum
The “or fewer by an even number” clause is the rule’s most misunderstood part. A polynomial with 3 sign changes doesn’t necessarily have 3 positive real roots — it might have exactly 3, or exactly 1, but never 2 or 0, since going from 3 down to a valid lower count always happens in steps of 2 (each step corresponding to a complex conjugate pair “hiding” two roots that would otherwise have been real and positive).
This is why the rule produces a maximum bound and a short list of possible counts, not a single definitive answer — pinning down the exact count from among the possibilities requires additional tools beyond sign-counting alone.
Common mistakes to avoid
Flipping signs by position instead of by degree when building f(−x). As covered above, this only coincidentally gives the right answer when the polynomial’s degree is even — for odd-degree polynomials it flips every sign backwards. The safest approach is to explicitly track each term’s actual exponent, not just count “every other one.”
Counting a zero coefficient as a sign change. Zero is neither positive nor negative, so a missing term is simply skipped when counting changes — it doesn’t create a change on its own, and the comparison continues across it to the next nonzero term.
Forgetting that the possible-root list steps down by 2, not by 1. A count of 4 sign changes means 4, 2, or 0 possible positive roots — never 3 or 1. Stepping down by the wrong amount produces a possible-root list that doesn’t actually correspond to any real combination of real and complex roots.
Treating the maximum sign-change count as the guaranteed actual count. Descartes’ Rule narrows the possibilities; it doesn’t solve the polynomial. Confirming which specific count from the list is correct requires either finding the roots directly or using supplementary information, such as evaluating the polynomial at a few points to look for sign changes that confirm at least one real root’s approximate location.
Applying the rule to a polynomial with complex coefficients. Descartes’ Rule of Signs is specifically a statement about polynomials with real coefficients — the whole notion of “sign” doesn’t extend to complex numbers in the way the rule requires. Any polynomial with a complex coefficient anywhere is simply outside the rule’s scope, regardless of how the rest of its coefficients look.
Real-world applications
Quickly ruling out root-finding approaches. Before running a numerical root-finder on a polynomial, Descartes’ Rule gives a fast sanity check on how many real roots to expect, which helps confirm whether a numerical method found all of them or missed some.
Engineering and control systems: stability analysis. In control theory, the number of roots of a system’s characteristic polynomial with positive real parts often determines system stability. Descartes’ Rule (and its extensions) offers a fast preliminary check before more detailed stability analysis techniques are applied.
Teaching root-finding strategy. Because the rule requires no actual root-solving, it’s commonly used as an early step in a broader root-finding strategy: narrow down how many positive and negative real roots to expect first, then combine that with the rational root theorem and numerical methods to actually locate them.
Verifying computational root-finding results. After a computer algebra system or numerical solver reports a polynomial’s roots, Descartes’ Rule provides an independent, easy-to-compute cross-check: if the solver reports a number of positive real roots that isn’t on the rule’s possible list, something has gone wrong either in the solver’s setup or in its output.
Complex-root polynomials in signal processing. Filter design and other signal-processing work often involves polynomials whose root locations (relative to a stability boundary) determine system behavior. A quick sign-count via Descartes’ Rule can flag, before any detailed root computation, whether a filter’s characteristic polynomial is even in the right ballpark of real-vs-complex root composition for the intended design.