Calculating Energy of a Wave

Both the equations you cite are correct.

The energy carried by a wave is indeed proportional to the amplitude squared. for what it's worth, you don't even need a propagating wave, any harmonic oscillator (e.g. a pendulum) will follow that rule. The validity of this rule remains unaffected even in quantum mechanics (actually, since in QM everything can be described by a wave function, it is even more fundamental there).

The second formula expresses the energy of a single photon. A photon is the smallest quantity of radiation that can exist at that frequency. This is completely unrelated to the total energy of the wave! For instance even a small light bulb will emit something like $10^{20}$ photons each second. Each carries an energy of $hf$. Together they sum up to the total power of the beam.

Tags:

Energy

Waves