Both the homotopy analysis method and Galerkin spectral method are applied to find the analytical solutions of the two-dimensional and time-independent Gross-Pitaevskii equation,a nonlinear Schrdinger equation used in describing the system of Bose-Einstein condensates trapped in a harmonic potential.The approximate analytical solutions are obtained successfully.Comparisons between the analytical solutions and the numerical solutions have been made.The results indicate that they are agreement very well with each other when the atomic interaction is not too strong.