For SHM,
acceleration , a = -ω²y
F = ma = -mω²y
now, work , W = F.dy cos180° { because displacement and acceleration are in opposite direction so, cos180° taken }
W = ∫mω²y.dy = mω²y²/2
use standard form of SHM , y = Asin(ωt ± Ф)
W = mω²A²/2 sin²(ωt ± Ф)
We know, Potential energy is work done stored in system .
so, P.E = W = mω²A²/2 sin²(ωt ± Ф)
again, Kinetic energy , K.E = 1/2mv² , here v is velocity
we know, v = ωAcos(ωt ± Ф)
so, K.E = mω²A²/2cos²(ωt ± Ф)
Total energy = K.E + P.E
= mω²A²/2 cos²(ωt ± Ф) + mω²A²/2 sin²(ωt ± Ф)
= mω²A²/2 [ cos²(ωt ± Ф) + sin²(ωt ± Ф) ] = mω²A²/2 [ ∵sin²α + cos²α = 1]
= mω²A²/2 = constant