Let a hysteresis loop be as shown in the figure, with $B_0$ the applied external field due to a current $I$ in a toroid, and $B_M$ the additional field due to the ferromagnetic material. Hence we have that \begin{align*} \mathbf{B} = \mathbf{B}_0 + \mathbf{B}_M, \end{align*} where $B$ is the magnitude of the total field.
I got a couple questions now. My textbook says that in one cycle, a lot of energy is transformed to thermal energy (friction) due to the realigning of the magnetic domains. Do they mean magnetic potential energy due to the extern field ($B_0$)? Also, if some energy is transformed to thermal energy, where does the rest go?
Suppose I want to calculate the work done on one cycle, which is (I figure) just the area under the loop. How should I go about doing this? I would just do \begin{align*} W_h = V \oint B_0 \ dB_M, \end{align*} where $V$ is the volume of the ferromagnetic material enclosed. I'm not sure if this is correct though, nor what my integration bounds should be.
Any clarification would be helpful.