The example question is:
"a clock contains a pendulum arm with a mass of $3.5 \,kg$. If the spring constant of the arm is $1.0\, N/m$ and the maximum amplitude of the arm is $45$ cm, calculate the energy of the system and the maximum speed of the mass."
The solution they give goes as follows:
$$\mathcal{E}=kA^2, \quad \text{(total energy = spring constant x amplitude^2)}.$$
The result is $2.0 \times 10^{-1} J$. Next they use the equation $\mathcal{E} = (mv^2)/2 + (kx^2)/2$, substitute $2.0 \times 10^{-1} J$ for $\mathcal{E}$, set $x$ to zero and solve for $v$.
What I don't understand is the first part of the solution. In the previous example the equation $\mathcal{E} = (kA^2)/2$ was used for the total energy of the system. Where did the equation $\mathcal{E} = kA^2$ come from?