On a class of nonlinear differential equations of astrophysics