Answer
$\text{Total energy of the harmonic oscillator}$ $=\frac{1}{2}m\omega^2A^2$
Work Step by Step
The displacement $(x)$ of a harmonic oscillator at any instant can be written as
$x=A\sin\omega t+B\cos\omega t$
In this problem, $B=0$, therefore
$x=A\sin\omega t$
where $A$ is the s maximum displacement amplitude.
$\therefore$ The velocity of the oscillator at that instant is given by
$v=\frac{dx}{dt}$
or, $v=A\omega \cos\omega t$
Let $m$ be the mass of the oscillator.
$\therefore$ Potential energy of the oscillator is
$PE=\frac{1}{2}m\omega^2x^2$=$\frac{1}{2}m\omega^2A^2\sin^2\omega t$
and kinetic energy of the oscillator is
$KE=\frac{1}{2}mv^2$=$\frac{1}{2}mA^2\omega^2\cos^2\omega t$
$\therefore$ $\text{Total energy of the harmonic oscillator}$
$=PE+KE$
$=\frac{1}{2}m\omega^2A^2\sin^2\omega t+\frac{1}{2}mA^2\omega^2\cos^2\omega t$
$=\frac{1}{2}m\omega^2A^2(\sin^2\omega t+\cos^2\omega t)$
$=\frac{1}{2}m\omega^2A^2$