Energetic derivation of the amplification of magnetic waves interacting with a flow of charges in a semiconductor