Routh–Hurwitz Criterion Calculator

Introduction

This calculator checks whether a real-coefficient polynomial is compatible with a stable continuous-time linear system. In control engineering, the characteristic polynomial of a closed-loop system tells you where the poles sit in the complex plane. If every root has a negative real part, the response decays instead of growing. The Routh–Hurwitz criterion answers that question without forcing you to solve for every root explicitly. That is the main appeal of this method: it turns a potentially messy root-finding problem into a structured table made from the coefficients you already have.

That makes the test useful in early design work, classroom exercises, gain tuning, and quick checks during modeling. If you are adjusting a controller and want to know whether the closed-loop polynomial stays in the left half-plane, a Routh table gives a fast yes-or-no stability picture and also tells you how many roots cross into the right half-plane. The calculator below automates the arithmetic while keeping the reasoning visible, so you can use it as both a practical tool and a learning aid.

What this Routh–Hurwitz calculator does

This tool builds the Routh table for a real-coefficient polynomial and counts sign changes in the first column. From that information it determines how many roots lie in the open right half of the complex plane. This is the standard Routh–Hurwitz stability test used in linear time-invariant (LTI) control systems.

Instead of solving for all polynomial roots directly, which becomes tedious and numerically delicate for higher degree equations, the Routh–Hurwitz procedure relies only on arithmetic with the coefficients. That makes it practical for hand calculations, quick design checks, and educational work where you want to see the stability logic rather than only a list of complex roots.

Typical use cases include checking whether a closed-loop transfer function is asymptotically stable, counting how many poles lie in the right half-plane, exploring how controller gains change stability without recomputing every root, and sanity-checking answers from a numerical root solver.

How to use

Enter the polynomial coefficients in descending powers of s, separated by commas. For example, if your characteristic polynomial is s^3 + 4s^2 + 5s + 2, type 1,4,5,2. If a power is missing, include its zero coefficient so the degree stays correct. A polynomial such as s^4 + 3s^2 + 1 should be entered as 1,0,3,0,1, not 1,3,1.

After you click Build Routh table, the calculator forms the top two rows of the table, computes the lower rows, and shows the completed table beneath the result message. The result line reports the number of sign changes in the first column and translates that count into a stability statement. If the leading coefficient is not positive, the calculator asks you to fix that first because the usual interpretation of the first column assumes a positive leading term.

When you read the output, focus on the first column rather than the rest of the entries. Each sign change from one row to the next represents one root in the open right half-plane. No sign changes means no right-half-plane roots. A zero pivot or a full row of zeros is more delicate; those cases often signal a marginal situation or repeated imaginary-axis roots, so the calculator continues with the standard workaround but also warns you to confirm borderline cases if needed.

Mathematical background

Consider a real-coefficient polynomial of degree n with positive leading term:

Formula: P(s) = a_n s^n + a_n-1 s^n-1 + ⋯ + a_1 s + a_0

P(s) = an sn + an-1 sn-1 + + a1s + a0

with all coefficients real and an > 0. The polynomial is called Hurwitz stable if all of its roots satisfy Re(s) < 0. In a control system, these roots are the poles of the characteristic equation. If they all lie in the left half-plane, disturbances decay with time and the equilibrium is asymptotically stable.

The Routh–Hurwitz criterion gives necessary and sufficient conditions for Hurwitz stability using only the coefficients a0, a1, …, an. The version used here constructs a Routh table. The crucial fact is simple: the number of sign changes in the first column of that table equals the number of roots with positive real part.

How the Routh table is constructed

For a polynomial of degree n, the Routh table has n + 1 rows. The top two rows are filled directly from the coefficients, alternating by powers of s. This alternating pattern is what gives the table its structure.

Top two rows

The first row contains the coefficients of the highest power and then every second power after that:

[an, an-2, an-4, …]

The second row starts one power lower and follows the same skip-by-two pattern:

[an-1, an-3, an-5, …]

If the polynomial degree is odd or even, one of these rows may end earlier than the other. Missing terms are treated as zeros.

Recursive formula for lower rows

Every lower row is computed from the two rows above it. If the entry in row i, column j is written as r[i, j], the recurrence is:

r[i, j] = ( r[i-1, 0] × r[i-2, j+1] − r[i-2, 0] × r[i-1, j+1] ) / r[i-1, 0]

This is algebraically equivalent to the standard hand-construction method. Although the full row can be informative, the stability decision depends primarily on the signs in the first column.

Zero pivots and rows of zeros

Two special cases deserve attention. The first is a zero in the first column, which would place a zero in the denominator of the recurrence. In that case the usual workaround is to replace the zero pivot with a very small positive number ε. This calculator uses ε = 10−6 when it encounters that situation.

The second special case is a complete row of zeros. That does not mean the method fails; it signals a symmetric structure that is handled by forming an auxiliary polynomial from the row above, differentiating it, and using those derivative coefficients to continue the table. Because rows of zeros often correspond to repeated roots on the imaginary axis or other borderline behavior, they deserve extra interpretation even when the arithmetic continues cleanly.

Interpreting the results

Once the Routh table is built, inspect the first column. If the signs stay the same all the way down, the polynomial has no roots in the right half-plane. If the signs flip one or more times, each flip corresponds to one right-half-plane root.

This gives a direct stability classification for continuous-time LTI systems. No sign changes means the polynomial is Hurwitz stable, provided you are not in a special borderline case involving rows of zeros or exact imaginary-axis roots. One sign change means one root has positive real part. Two sign changes mean two roots have positive real part, and so on.

In practice, that classification is often exactly what an engineer needs. If the answer is unstable, you know the design must change. If the answer is stable, you can move on to performance questions such as overshoot, settling time, damping ratio, or robustness. If the calculator reports a special-case warning, treat that as a cue to confirm the result with direct root computation or simulation.

Worked example

Consider the polynomial P(s) = s^4 + 3s^3 + 3s^2 + 3s + 1. The coefficient list is 1,3,3,3,1. When you enter those numbers, the top two rows of the Routh table are formed as [1, 3, 1] and [3, 3, 0]. The lower rows are then computed from the recurrence.

The completed first column becomes [1, 3, 2, 1, 1]. Every entry is positive, so there are no sign changes. That means the polynomial has no roots in the right half-plane, and the associated continuous-time system is asymptotically stable.

Now compare that with P(s) = s^4 - 2s^2 + 1, entered as 1,0,-2,0,1. This polynomial is a good reminder that missing odd-power terms must still appear as zeros in the input. In this case the table includes a special structure, and the first-column pattern reveals instability. The key lesson is that the sign-change count tells you where the unstable poles are heading without solving the quartic directly.

Summary of the algorithm

The logic behind the calculator can be described as a short sequence. First, read the coefficients from highest power to constant term and make sure the leading coefficient is positive. Next, create the top two rows by taking alternating coefficients. Then compute each lower row from the two rows above it. If a first-column pivot is zero, substitute a small ε. If an entire row becomes zero, use the auxiliary-polynomial rule to continue. Finally, count the sign changes in the first column and interpret that number as the count of right-half-plane roots.

Even though the procedure is mechanical, it reflects a deep theorem. The table is not just a bookkeeping device; it is encoding how the polynomial behaves in relation to the imaginary axis. That is why the first column carries such important information.

Comparison with direct root finding

Routh–Hurwitz versus direct root computation
Aspect Routh–Hurwitz (this calculator) Direct root computation
Main output Number of right-half-plane roots and stability classification Approximate locations of all roots in the complex plane
Computational effort Arithmetic on coefficients; efficient for moderate degrees Requires solving polynomial equations numerically
Numerical sensitivity Often robust for engineering sign checks Exact root locations can be sensitive to coefficient changes
Information provided Stable, unstable, or borderline, plus count of unstable poles Complete pole locations for detailed analysis
Typical use Fast stability screening during design or teaching Detailed dynamic analysis after a design is acceptable

Engineers often use both approaches together. The Routh–Hurwitz test is a quick gatekeeper: it tells you whether a design even belongs in the stable region. Direct root calculations then refine the picture by showing damping, oscillatory modes, and exact pole locations.

Assumptions and limitations

This calculator assumes that the polynomial coefficients are real numbers and that you are working in the usual continuous-time LTI stability setting. It does not replace the Jury test for discrete-time systems, and it is not a complete analysis tool for nonlinear or time-varying models. It also assumes that your coefficient list is complete and properly ordered; missing powers should be entered explicitly as zeros.

When a first-column pivot is zero, the calculator uses an epsilon substitution. When an entire row becomes zero, it applies the standard auxiliary-polynomial continuation. Those are accepted parts of the method, but they also mark cases where more interpretation is needed. If your design appears to sit on the edge of stability, confirm the answer with direct root computation, simulation, or a symbolic derivation.

Finally, remember that stability is only one design requirement. A system can be stable and still respond too slowly, overshoot badly, amplify noise, or be too fragile to parameter changes. The Routh–Hurwitz criterion is excellent for the stability question, but it should sit alongside root locus, Bode or Nyquist analysis, time-domain simulation, and engineering judgment.

Enter a comma-separated list such as 1,5,6 for s² + 5s + 6. Include zeros for missing powers, and keep the leading coefficient positive.

Enter coefficients like 1,5,6 for s² + 5s + 6.

Routh table output

Computed Routh table rows
Row Entries

Mini-game: First-Column Frenzy

This optional arcade-style mini-game turns the stability idea into a fast routing challenge. You are not changing the calculator’s math; you are practicing the same language the criterion uses. Incoming first-column entries drop toward a switch, and your job is to route each one to the correct lane: negative, epsilon, or positive. As the pace rises, watch the sign-change counter. That counter is the heart of the real criterion too.

Score0
Time75.0s
Streak0
Integrity5
Sign changes0
PhaseBaseline

First-Column Frenzy

Route each incoming first-column entry before it reaches the switch. Tap or click the left, center, or right side of the playfield, or use A, S, and D on the keyboard.

  • Left lane: negative entry
  • Center lane: zero pivot handled as ε
  • Right lane: positive entry

Wrong routes cost integrity. Correct routes build streaks. The sign-change meter teaches the same idea as the calculator: each sign change in the first column represents a right-half-plane root.

Best score: 0

Tip: the calculator replaces a zero first-column pivot with a tiny positive epsilon so the construction can continue. That is why the center lane is marked ε.

Start a run and see how quickly sign changes appear when the first-column pattern flips.

Embed this calculator

Copy and paste the HTML below to add the Routh–Hurwitz Criterion Calculator | Polynomial Stability Test and Routh Table to your website.