For the simple harmonic motion, the force and the displacement are related by Hooke.s law
` vecF =k vecr`
Since force is a vector quantity, in three dimensions it has three components. Further, the force in the above equation is a conservative force field, such a force can be derived from a scalar function which has only one component. In one dimensional case
`F= -kr`...(1)
We know that the work done by the conservative force field is independent of path. The potential energy U can be.calculated from the following expression.
`F=- (dU)/(dx )`...(2)
Comparing (1) and (2), we get
` - (dU)/( dx ) =- kx`
` dU = kx dx `
This work done by the force F during a small displacement dx stores as potential energy
` U (x ) = int _0 ^(x) kx . dx. = 1/2 k (x. ) ^2।_(0)^(x) = 1/2 kx^2`
From equation `w =sqrt( (k)/(m))` , we can substitute the value of force constant `k = m omega^2` in equation (3),
`U(x) = 1/2 m omega^2 x^2`
where `omega` is the natural frequency of the oscillating system. For the particle executing simple harmonio motion from equation` y= A sin omega t,` we get
`U(t) =1/2 m omega^2 A^2 sin^2 omega t`
This variation of U is shown in figure.
(b) Kinetic energy
`KE = 1/2 mv_(x)^(2) = 1/2 m ((dx)/(dt))^2`

Since the particle is executing simple harmonic motion, from equation
` y= A sin omega t`
` x=A sin omega t `
Therefore, velocity is
`v_(x ) = (dx )/( dt) = A omega t` ...(7)
` =A omega sqrt(1- ((x)/(A))^2)`
` v_(x) = omega sqrt( A^2 - x^2 )`
hence `KE =1/2 mv_(x)^(2) = 1/2 mv_(x) ^(2) =1/2 m omega ^2 (A^2 - x^2)`
`KE = 1/2 m omega ^2 A^2 cos^2 omega t`
this variation with time is shown in figure ,
(c ) total energy is the sum of kinetic and potential energy
` E=KV +U`
` E=1/2 m omega^2 (A^2 -x^2 ) +1/2 m omega ^2 x^2`
hence , cancelling `x^2` term
`E+1/2 m omega ^2 A^2 =` constant
Alternatively , from equation (5) and equation (10 ) we get the total energy as
` E = 1/2 m omega ^2 A^2 sin^2 omega t +1/2 m omega ^2 A^2 cos^2 omega t`
` =1/2 m omega ^2 A^2 ( sin^2 omega t+ cos^2 omega t)`

from trigonometry identity ,
`( sin^2 omega t + cos^2 omega t) =1`
` E =1/2 m omega ^2 A^2 =` constant
which gives the law conservation of total energy ,
thus the amplitude of simple harmonic oscillator , can be expressed in terms of total energy
` A= sqrt((2E )/( m omega^2))= sqrt( (2E )/(k ))`
