We show that there are two different families of (weakly) orthogonal polyno
mials associated to the quasi-exactly solvable Razavy potential V(x) = (zet
a cosh2x - M)(2) (zeta > 0, M is an element of N). One of these families en
compasses the four sets of orthogonal polynomials recently found by Khare a
nd Mandal, while the other one is new. These results are extended to the re
lated periodic potential U(x) = -(zeta cos 2x - M)(2), for which we also co
nstruct two different families of weakly orthogonal polynomials. We prove t
hat either of these two families yields the ground state (when M is odd) an
d the lowest-lying gaps in the energy spectrum of the latter periodic poten
tial up to and including the (M - 1)th gap and having the same parity as M
- 1. Moreover, we show that the algebraic eigenfunctions obtained in this w
ay are the well known finite solutions of the Whittaker-Hill (or Hill's thr
ee-term) periodic differential equation. Thus, the foregoing results provid
e a Lie-algebraic justification of the fact that the Whittaker-Hill equatio
n (unlike, for instance, Mathieu's equation) admits finite solutions.