  The future detection projects of gravitational waves are expected to have the
sensitivity of detecting the primordial gravitational waves, which may be
useful to get new insight into the very early universe. It is essential to
analyze the evolution equation of the gravitational waves to estimate the
present field strength of the primordial gravitational waves. In this paper, we
obtain analytic solutions of the gravitational wave equation in the presence of
non-relativistic matters as well as the cosmological constant. Although it is
difficult to obtain the solution directly, we find that the equation for the
square of the amplitudes has a simple polynomial solution. This quantity, which
is directly related to the energy density of the gravitational waves, turns out
to be useful to construct analytic solutions for the amplitudes by using
Weierstrass's elliptic functions.
