In a solenoid energy is stored in the form of magnetic field. If a constant current is flowing from a solenoid then magnetic field inside the solenoid is uniform. Therefore, energy per unit volume (or energy density) in the magnetic field inside the solenoid is constant.
The energy per unit volume in the magnetic field is given as,
, where B is uniform magnetic field inside the solenoid.
Therefore, energy density all points inside a solenoid is same.