  One of the greatest challenges in cosmology today is to determine the nature
of dark energy, the sourse of the observed present acceleration of the
Universe. Besides the vacuum energy, various dark energy models have been
suggested. The Friedmann - Robertson - Walker (FRW) spacetime plays an
important role in modern cosmology. In particular, the most popular models of
dark energy work in the FRW spacetime. In this work, a new class of integrable
FRW cosmological models is presented. These models induced by the well-known
Painlev$\acute{e}$ equations. Some nonintegrable FRW models are also
considered. These last models are constructed with the help of Pinney,
Schr$\ddot{o}$dinger and hypergeometric equations. Scalar field description and
two-dimensional generalizations of some cosmological models are presented.
Finally some integrable and nonintegrable $F(R)$ and $F(G)$ gravity models are
constructed.
