This paper investigates the stability of (switched) polynomial systems. Using semi-tensor product of matrices, the paper developed two tools for testing the stability of a (switched) polynomial system. First, a way to convert a product of multivariable polynomials into a canonical form. Second, an easily verifiable sufficient condition to justify whether a multi-variable polynomial is positive definite. Using these two tools, we construct a polynomial function as a candidate Lyapunov function and via testing its derivative to provide some sufficient conditions for the global stability of polynomial systems.