Potential energy of the compressed (stretched) spring

$$E_{p} = \frac{k\cdot x^{2}}{2}$$
Find   It is known that:
      =