Einstein equations for several matter sources in Robertson-Walker and Bianchi
I type metrics, are shown to reduce to a kind of second order nonlinear
ordinary differential equation $\ddot{y}+\alpha f(y)\dot{y}+\beta f(y)\int{f(y)
dy}+\gamma f(y)=0$. Also, it appears in the generalized statistical mechanics
for the most interesting value q=-1. The invariant form of this equation is
imposed and the corresponding nonlocal transformation is obtained. The
linearization of that equation for any $\alpha, \beta$ and $\gamma$ is
presented and for the important case $f=by^n+k$ with $\beta=\alpha ^2
(n+1)/((n+2)^2)$ its explicit general solution is found. Moreover, the form
invariance is applied to yield exact solutions of same other differential
equations.