Derivation of Intensity of a wave

We know that the energy of a particle moving in SHM as a wave passes is E= (1/2) k A2.

We can write k, the force constant in terms of frequency as, k = m/ω2.

Then, energy E = 2 π2 m f2 A2.

The mass 'm' in terms of density 'ρ' of the medium can be written as,m = ρV.
V is the Volume of a small slice of the medium and can be written as V = S l.
S is the cross sectional surface area through which the wave travels and
l is the distance travelled by the wave in a time t.
l can be written in terms of the velocity of the wave as l = vt.

substituting all these in the energy equation, we get E = 2 π2ρSvtf2A2.

The intensity of the wave is the energy transported per unit time across unit area perpendicular to the direction of energy flow.