A linear system is stable if every bounded input gives a bounded output, which holds when all closed-loop poles have negative real parts. Poles on the $j\omega$ axis (non-repeated) give marginal stability.
Routh array
For $a_0s^n + a_1s^{n-1} + \dots + a_n$, write the first two rows from alternate coefficients, then
$$b_1 = \frac{a_1a_2 - a_0a_3}{a_1},\qquad b_2 = \frac{a_1a_4 - a_0a_5}{a_1},\ \dots$$
The number of sign changes in the first column equals the number of right-half-plane roots.
Special cases
- Zero in the first column: replace it with a small $\varepsilon > 0$ and continue.
- Whole row of zeros: form the auxiliary polynomial from the row above, differentiate it and use its coefficients. Its roots are symmetric about the origin (often on the $j\omega$ axis).
Range of $K$
Keep $K$ as a symbol, require every first-column entry to be positive, and solve. The boundary value is the marginal gain; the auxiliary equation then gives the frequency of oscillation.