The energy of a wave is proportional to the amplitude squared due to the relationship between potential energy and maximum displacement in simple harmonic oscillators, where the potential energy is derived from the work done against an internal restoring force. This principle is illustrated mathematically using Hooke's Law, leading to the equation for potential energy. However, the same derivation does not directly apply to electromagnetic (EM) waves, as they lack a spring constant analogous to that in mechanical systems. Instead, the energy density of electric and magnetic fields in EM waves is proportional to the square of the electric field (E^2) and magnetic field (B^2), respectively. Textbooks often demonstrate this through examples involving capacitors and inductors, highlighting the fundamental differences between mechanical and electromagnetic wave energy.