We find all polynomials Z(z) such that the differential equationwhere X(z), Y (z), Z(z) are polynomials of degree at most 4, 3, 2 respectively, has polynomial solutions S(z) = n i=1 (z − z i ) of degree n with distinct roots z i . We derive a set of n algebraic equations which determine these roots. We also find all polynomials Z(z) which give polynomial solutions to the differential equation when the coefficients of X(z) and Y (z) are algebraically dependent. As applications to our general results, we obtain the exact (closed-form) solutions of the Schrödinger type differential equations describing: 1) Two Coulombically repelling electrons on a sphere; 2) Schrödinger equation from kink stability analysis of φ 6 -type field theory; 3) Static perturbations for the non-extremal Reissner-Nordström solution; 4) Planar Dirac electron in Coulomb and magnetic fields; and 5) O(N ) invariant decatic anharmonic oscillator.2000 Mathematics Subject Classification. 34A05, 30C15, 81U15, 81Q05, 82B23.