The relative velocity of an object A with respect to another object B is the velocity that object A would appear to have to an observer situated on object B moving along with it.
In simple words relative velocity of A with respect to Be is the vector difference between the velocities of A and B.
It is represented as
If a spring is stretched or compressed by a distance x from its natural length under the action of restoring force then
F = -kx

dU=−F.dx