By the semi-inverse method, a variational principle is obtained for the Thomas– Fermi equation, then the Ritz method is applied to solve an analytical solution, which is a much simpler and more efficient method. 2002 Elsevier Science Inc. All rights reserved.