Is there an equation representing the movement of a longitudinal wave? Is there an equation, be it rectangular, polar, or parametric, that represents the movement of a longitudinal wave? Something like this:


taken from How can a sine wave represent a longitudinal wave?

or like this:



I am thinking that this can be done by a parametric equation $(x(t),y(t))$. Is the equation of this graph known already?

This is a question for identification of an equation, not a homework to find the equation of the graph itself as an exercise.
 A: General wave parameterisation
The waves the animations are showing can be parameterised as
$$
\rho(x,y,t) = A \cos(k x - \omega t + \phi)~,
$$
where $\rho$ is the density of particles in the first animation and the amount of spring contraction in the second, $A$ is the amplitude of the wave, $k$ is the wave number in $x$-direction and $\omega$ the wave's angular frequency, so $\omega/k$ would be the phase velocity. Finally, $\phi$ is some constant phase shift which can always be set to 0 by choosing the origin of the coordinate system cleverly. This is the same expression as for transversal waves, only it is interpreted as density rather than displacement.
About the first animation
If you are also interested in how the particles in the first animation behave, they are just harmonic oscillators, so their motion in $x$-direction obeys
$$
x(t) = B \cos(\omega t + \psi(x_0)) + x_0~,
$$
with $B$ as amplitude, $\omega$ as angular frequency, $x_0$ as equilibrium point and $\psi(x_0)$ as a constant phase which depends on the equilibrium point, because the wave has different phases at different points in space at a single point in time. In $y$-direction the particles obviously do not move at all.
About the second animation
Considering the second animation, the spring can be parameterised as
$$
x(\chi,t) = \chi + A \cos(k \cdot \chi - \omega t)~, \qquad y(\chi,t) = \cos(\chi)~,
$$
where the parameter $\chi$ can be interpreted as some kind of "unperturbed $x$", the "perturbation" being responsible for the spring contracting and relaxing. The amplitude $A$ is the one of this oscillating motion, $k$ and $\omega$ are the wave number and angular velocity of the wave propagating through the spring and $t$, the second parameter, represents time.
Plotting and animating these equations yields this:

It behaves quite similar to the animation in the question.
