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)
Sign Sequence of f(x) — Positive Root Analysis
Non-zero coefficients in descending degree order. Orange circles mark sign changes.
f(−x) Derivation — Negative Root Analysis
Odd-degree coefficients are negated. Orange circles mark sign changes in f(−x).
All Valid Root Combinations
Every valid (positive, negative, complex) combination where degree − positive − negative = even non-negative integer.
| Positive Real Roots | Negative Real Roots | Complex Pairs | Total |
|---|
Upper & Lower Bounds on Real Roots
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 + 2 | 2 | 1 | (2,1,0) or (0,1,1) |
| x⁴ − x³ + x² − x + 1 | 4 | 0 | (4,0,0),(2,0,1),(0,0,2) |
| x⁵ − x⁴ + 3x³ − x + 2 | 3 | 2 | (3,2,0),(3,0,1),(1,2,1),(1,0,2) |
| 2x³ + 3x² − 11x − 6 | 1 | 2 | (1,2,0) or (1,0,1) |
| x² + 1 | 0 | 0 | (0,0,1) |
| x⁴ − 5x² + 4 | 2 | 2 | (2,2,0),(2,0,1),(0,2,1),(0,0,2) |