Calculating Energy of a Wave So my physics examinations are coming up and I was going through my notes on waves, but I realized that there were some discrepancies. 
In my notes, the energy of a wave is directly proportional to the square of the amplitude, ie. $E \propto A^2$
However, I recalled that, in one of my physics lessons, our physics teacher told us that the energy of a wave can be calculated using $E=hf$, where $h$ is the Planck constant and $f$ the frequency.
Hence I was rather confused and tried searching google for answers but couldn't find any suitable ones. To the best extent of that research, what I found out was (apparently) (for visible light), the frequency of the wave could be used to calculate the energy of the wave, while the amplitude was used to determine the intensity of the wave.
So I was wondering, firstly, whether the above statement was correct, and secondly, in the event it is correct, whether it would be applicable to all kinds of waves, (ie. Sound waves, water waves, other EM waves, etc.), and thirdly, back to the original question, how do we calculate the energy of a wave?
Thanks. :) 
 A: 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.
A: You are mixing classical mechanics with quantum mechanics. In QM, a photon has a wavelength and a frequency, but it isn't a "wave". It will never be seen on an oscilloscope because of various quantum mechanical oddities like superposition, entanglement, etc., which are completely foreign to classical mechanics. Nobody yet knows how to combine classical mechanics and quantum mechanics into a single theory. It will almost certainly require a rewrite to both of them. There is much discussion and little progress in this area.
Classical mechanics is solely statistical in nature--it is an analysis of the "average" behavior of many quantum mechanical systems. QM is also statistical only because we don't yet understand the exact reasons behind individual (quantum) interactions, and if there even are any, so it talks about probability of an interaction taking place.
Anyway, a classical wave's energy is proportional to the square of its amplitude. For example, classically speaking the energy in an electromagnetic wave is proportional to the square of its peak electric field, or you an say its proportional to the square of its peak magnetic field. However, in the last hundred years or so we've discovered that the EM field is quantized, and that the "wavelength" of each quanta is inversely proportional to that quanta's energy. We measure wavelength in, for example, double slit experiments. But we never see the wave of a single photon on an oscilloscope. You can have a lot of low frequency photons with some total energy, and have fewer high frequency photons with the same energy. Classically they have the same peak electric field, but one has fewer photons than the other.
A: But, I should add that an intense wave of low-frequency photons may have the same electric and magnetic field strengths as a less-concentrated wave of gamma-rays, but they don't 'react' with matter in the same way necessarily.  Since atoms/molecules deal with one photon at a time, even an powerful laser of IR photons won't ionized them like a gamma ray would.  I think.
A: I have derived an equation myself I.e.
$$(E = 32 D  V Q A^2 f^2)$$
Here,
E is the net energy of sound wave,
D is the mean density of medium,
V is the volume through wave passed,
Q is the number of oscillations in the wave,
A is the amplitude of the wave just after the wave formed,
f is the frequency of the wave just after the wave formed,
32 is a numeric constant having no unit, like that of $\pi$.
Sometime it gives approx.value of energy and sometime it gives accurate.Hope your problem is solved.
