±

Descartes' Rule of Signs Calculator

Positive Roots · Negative Roots · Complex Pairs · Sign Changes

Enter a polynomial to find all possible combinations of positive, negative, and complex roots using Descartes' Rule of Signs. Full step-by-step sign sequence analysis included.

Quick Examples

Enter as expression (x^3 - 3x + 2) or space-separated coefficients from highest to lowest degree (1 0 -3 2)

What Is Descartes' Rule of Signs?

Descartes' Rule of Signs is a classical theorem in algebra that places an upper bound on the number of positive and negative real roots of a polynomial with real coefficients. Published by René Descartes in his 1637 work La Géométrie, it remains one of the most elegant tools in polynomial analysis — requiring nothing more than counting sign changes in the coefficient sequence.

The rule does not compute the exact roots, but it powerfully constrains how many can exist. Before numerical root-finding algorithms existed, this was indispensable for understanding a polynomial's structure.

The Formal Statement

Let f(x) be a polynomial with real coefficients arranged from highest to lowest degree. Remove all zero coefficients, then count the number of sign changes — transitions from a positive coefficient to a negative one, or vice versa — in the remaining sequence. Call this count V+.

Then the number of positive real roots of f(x) (counted with multiplicity) is either V+ or V+ minus a positive even integer. That is, possible positive root counts are V+, V+−2, V+−4, … down to 1 or 0.

To find the maximum number of negative real roots, apply the same count to f(−x) — the polynomial obtained by substituting −x for x. Replacing x with −x negates all odd-degree coefficients and leaves even-degree coefficients unchanged. The count of sign changes in f(−x) is V−, and possible negative root counts are V−, V−−2, … down to 1 or 0.

Complex Roots Always Come in Pairs

By the Complex Conjugate Root Theorem, any polynomial with real coefficients must have complex non-real roots appearing in conjugate pairs (a+bi paired with a−bi). This means if a degree-n polynomial has p positive real roots and q negative real roots, the remaining n−p−q roots are complex — and that number must be even. So (n−p−q) mod 2 = 0 is a required constraint.

The calculator uses this to enumerate every valid combination: for each candidate p (from V+ down by 2s) and each candidate q (from V− down by 2s), it checks whether n−p−q is a non-negative even integer, and if so, records (p, q, (n−p−q)/2) as one valid root structure.

Step-by-Step Algorithm

  • Step 1: Extract non-zero coefficients of f(x) in descending degree order.
  • Step 2: Scan consecutive pairs — count each sign change (+ to − or − to +). This gives V+.
  • Step 3: Construct f(−x) by negating coefficients of x, x³, x⁵, … (odd-degree terms).
  • Step 4: Count sign changes in f(−x)'s coefficient sequence. This gives V−.
  • Step 5: Enumerate all valid (p, q) pairs and compute complex pairs = (n−p−q)/2.

Limitations of the Rule

Descartes' Rule provides only an upper bound, not an exact count. The polynomial x²+1 has V+ = 0 (no sign changes) and V− = 0, correctly indicating no real roots — but for x³−1, V+ = 1 and V− = 0, giving exactly one positive root (x = 1) and two complex roots. However, for x⁴−5x²+4, V+ = 2 predicts 2 or 0 positive roots — and indeed all four roots (±1, ±2) are real, so it correctly includes the possibility of 2 positive roots.

To determine the exact number of real roots in an interval, Sturm's Theorem provides a complete answer. For exact root values, the quadratic formula (degree 2), cubic formula (degree 3), quartic formula (degree 4), or numerical methods (degree ≥ 5) are needed.

Historical Note

René Descartes (1596–1650) stated this rule in La Géométrie (1637) without a complete proof. A rigorous proof was first given by Carl Friedrich Gauss in 1828. Despite its age, the rule remains in wide use today — in automated theorem provers, computer algebra systems (Mathematica, Maple, SageMath), and as a quick human sanity-check when working with polynomials.

Reference Table — Examples

Polynomial V+ (f(x)) V− (f(−x)) Possible Combinations
x³ − 3x + 221(2,1,0) or (0,1,1)
x⁴ − x³ + x² − x + 140(4,0,0),(2,0,1),(0,0,2)
x⁵ − x⁴ + 3x³ − x + 232(3,2,0),(3,0,1),(1,2,1),(1,0,2)
2x³ + 3x² − 11x − 612(1,2,0) or (1,0,1)
x² + 100(0,0,1)
x⁴ − 5x² + 422(2,2,0),(2,0,1),(0,2,1),(0,0,2)

Frequently Asked Questions

What is Descartes' Rule of Signs?
Descartes' Rule of Signs gives an upper bound on positive and negative real roots of a polynomial. Count sign changes in the coefficient sequence of f(x) for positive roots (V+), and in f(−x) for negative roots (V−). The actual counts equal V+ (or V−) minus a non-negative even integer.
How do you count sign changes in a polynomial?
Write out the non-zero coefficients in order from highest to lowest degree. For each adjacent pair, note whether the sign changes (+ to − or − to +). Count the total number of such transitions. Zero coefficients are completely skipped — they do not break or create sign changes.
What is f(−x) and why does it matter?
f(−x) is obtained by replacing x with −x. Odd-degree terms pick up a negative sign (since (−x)^odd = −x^odd), while even-degree terms remain unchanged. The negative real roots of f(x) correspond exactly to the positive real roots of f(−x), so counting sign changes in f(−x) gives the maximum number of negative real roots of f(x).
How are complex roots determined using Descartes' Rule?
Complex non-real roots come in conjugate pairs. Given p positive roots and q negative roots for a degree-n polynomial, the remaining n−p−q roots must all be complex — and that number must be even. So for each valid (p, q) pair, complex pairs = (n−p−q) / 2. The rule tabulates every valid combination.
Is Descartes' Rule of Signs exact?
No — it gives an upper bound only. The actual number of positive real roots is V+ minus some non-negative even integer. For example, V+ = 3 means 3 or 1 positive roots are possible. To determine the exact number, Sturm's Theorem or numerical root-finding methods are required.
Why must complex roots come in pairs?
For polynomials with real coefficients, the Complex Conjugate Root Theorem guarantees that if a+bi is a root, then a−bi is also a root. This is because taking the complex conjugate of f(a+bi) = 0 gives f(a−bi) = 0, since all coefficients are real and conjugation distributes over addition and multiplication. Therefore complex roots always appear in even numbers.
What is the historical background of Descartes' Rule of Signs?
René Descartes stated this rule in his 1637 work La Géométrie. The original statement lacked a complete proof, which was first provided by Carl Friedrich Gauss in 1828. The rule was revolutionary as one of the first systematic methods for analyzing polynomial roots without computing them — predating modern numerical methods by centuries and still taught in algebra courses worldwide.