During every oscillation about an equilibrium position, there is a force acting on the vibrating body “desiring” to return it to the equilibrium position. When a point is receding from its equilibrium position, the force decelerates its motion; when it is approaching this position, the force accelerates its motion.
Let us examine this force in the case of a pendulum (Figure 1). The bob of the pendulum is acted upon by the force of gravity and tension in the string. Let us decompose the force of gravity into two components – one directed along the string and the other perpendicular to it, along the tangent to the path. Only the tangential component of the gravitational force is of significance for the motion. I t is precisely the restoring force in this case. As for the force directed along the string, it is balanced by the reaction on the part of the nail on which the pendulum is hanging, and it is only necessary to take it into account when we are interested in whether the string will withstand the weight of the vibrating body.

Denote the magnitude of the displacement of the bob by
The pendulum serves as the simplest example of an oscillating body. However, we are interested in the possibility of extending the formulas and laws which we find to arbitrary vibrations.
The period of oscillation of a pendulum was expressed in terms of its length. Such a formula applies only to a pendulum. But we can express the period of free oscillations in terms of the restoring force constant
Let us now express the potential energy of a pendulum in terms of its displacement
Let us check the correctness of the formula we have just derived. The loss of potential energy must be equal to the work performed by the restoring force. Consider two of the body’s positions,
Our formula led us to the correct result: the loss of potential energy is equal to the work performed.