It is a well known fact that an inductor or a solenoid stores energy in the magnetic field around it. Suppose that the solenoid is unwound into a straight current carrying conductor. Firstly, is energy stored in the magnetic field around the straight wire? Secondly, if it does store energy, can the energy density be given by ,?
Considering a simple cicuit consisting of a resitor with resistance R and a battery with emf ε , then under ideal conditions, power delivered by the battery is equal to the energy dissipated as heat by resistor. $$H = i^2Rt$$ If some energy is also stored in the magnetic field around the wire, how is the above equation valid supposing that the energy stored in the magnetic field is from the energy supplied by the battery? more specifically , How is energy conserved in this case? why wouldn't be $$E_{\text{delivered by battery}} = i^2Rt + \text{Energy stored in the magnetic field} ?$$
Please point me out and explain where I had got the thing wrong. (By the way , this is my first question on Physics Stack Exchange)