The actual motivation of this paper is to develop a functional link between artificial neural network (ANN) with Legendre polynomials and simulated annealing termed as Legendre simulated annealing neural network (LSANN). To demonstrate the applicability, it is employed to study the nonlinear Lane-Emden singular initial value problem that governs the polytropic and isothermal gas spheres. In LSANN, minimization of error is performed by simulated annealing method while Legendre polynomials are used in hidden layer to control the singularity problem. Many illustrative examples of Lane-Emden type are discussed and results are compared with the formerly used algorithms. As well as with accuracy of results and tranquil implementation it provides the numerical solution over the entire finite domain.