In this paper we present an algebraic study concerning the general second order
linear diferential equation with polynomial coefcients. By means of Kovacic’s
algorithm and asymptotic iteration method we fnd a degree independent algebraic
description of the spectral set: the subset, in the parameter space, of Liouville integrable diferential equations. For each fxed degree, we prove that the spectral set is
a countable union of non accumulating algebraic varieties. This algebraic description of the spectral set allow us to bound the number of eigenvalues for algebraically
quasi-solvable potentials in the Schrödinger equation.