Direct variational methods are used to find simple approximate solutions of the Thomas–Fermi equations describing the properties of self-gravitating radially symmetric stellar objects both in the non-relativistic and ultra-relativistic cases. The approximate solutions are compared and shown to be in good agreement with exact and numerically obtained solutions.