In forced oscillation of a particle the amplitude is maximum for a frequency ‘ω′1 of the force, while the energy is maximum for a frequency ‘ω′2 of the force, then
Both amplitude and energy get maximized when the frequency is equal to the natural frequency.
This is the condition of resonance. w1=w2