Analytical solutions for the spin-1 Bose-Einstein condensate in a harmonic trap