Descartes Rule of Signs Calculator
Bound the number of positive and negative real roots by counting sign changes.
What it does
Descartes' rule of signs gives a quick bound on how many positive and negative real roots a polynomial can have. You count how often the sign of a coefficient changes as you move through the polynomial, ignoring any zero coefficients.
This tool takes the coefficients in descending power order. It counts sign changes in f(x) and in f(-x), then lists the possible root counts by subtracting two repeatedly from each bound.
The page opens with the quartic x to the fourth plus 7 x cubed minus 4 x squared minus x minus 7. Its signs are plus, plus, minus, minus, minus, giving one sign change and therefore exactly one positive root.
For f(-x) the signs become plus, minus, minus, plus, minus, giving three sign changes. The polynomial therefore has either three or one negative real roots.
The rule gives bounds rather than exact counts when the number of changes exceeds one. It also says nothing about complex roots except that they come in conjugate pairs.
How to use
- Enter the coefficients from highest power down.
- Put zeros where powers are missing; they will be ignored.
- Read the number of sign changes in f(x).
- Check the possible positive root counts.
- Use the f(-x) results for negative roots.
- Combine with the rational root theorem to test candidates.
Formula
- f(x)
- The polynomial with coefficients in descending powers.
- f(-x)
- The polynomial with x replaced by minus x, which flips signs of odd powers.
- sign change
- A transition between consecutive nonzero coefficients of opposite sign.
The parity of the root count matches the parity of the sign change count, which is why the actual number is the bound, the bound minus two, the bound minus four, and so on. A bound of zero or one gives the exact number of roots.
Worked example
Example: x to the fourth plus 7 x cubed minus 4 x squared minus x minus 7
The page opens with coefficients 1, 7, -4, -1, -7.
- Write the signs of f(x): plus, plus, minus, minus, minus.
- There is one change, from plus to minus, so there is exactly one positive root.
- Form f(-x) by flipping the signs of odd powers: plus, minus, minus, plus, minus.
- There are three sign changes: plus to minus, minus to plus, and plus to minus.
- The number of negative roots is therefore three or one.
- The tool reports positive_changes 1 and negative_changes 3.
Reference table
| Coefficients | Signs of f(x) | Positive changes | Negative changes |
|---|---|---|---|
| 1, 7, -4, -1, -7 | + + - - - | 1 | 3 |
| 3, 1, -1, 3, 2, -1, 1 | + + - + + - + | 4 | 2 |
Limits
- Accepts 2 to 12 coefficients.
- The leading coefficient cannot be zero.
- Provides bounds, not exact counts, when the bound exceeds one.
- Says nothing about the location or value of the roots.
Common mistakes
- Counting zero coefficients as sign changes.
- Forgetting that the actual count can be lower by an even number.
- Using f(x) instead of f(-x) to bound negative roots.
- Treating the bound as an exact count when it is greater than one.
- Assuming the rule finds complex roots.
Try it yourself
Quick checks. Answers sit tucked under each question.
Signs + + - + + - +. Positive changes?
4, so there are 4, 2 or 0 positive real roots.
One sign change in f(x). Positive roots?
Exactly one.
How do you bound negative roots?
Count sign changes in f(-x), obtained by flipping odd power coefficients.
Questions
What does the rule tell me?
An upper bound and parity constraint on positive and negative real roots.
Why subtract two at a time?
Because nonreal roots arrive in conjugate pairs, so the count drops in steps of two.
How do I get f(-x)?
Replace x with minus x, which negates the coefficients of odd powers.
Are zero coefficients counted?
No. They are skipped when counting sign changes.
Can the rule give an exact count?
Yes when the number of changes is zero or one.
Does it locate the roots?
No. It only constrains how many there can be.
Sources
- Harvey Mudd College, Descartes rule of signs math fun fact
- Richland Community College, real zeros of polynomial functions
- Stanford University, Descartes rule of signs notes