Potentially silly question, sorry! I understand that the $B$-field can be expressed as the curl of $A$, where $A$ is the magnetic vector potential, and so $B$ has no divergence. The auxiliary field $H$ however, is not necessarily divergenceless, and may have curl also (if free currents are present). I am confused about the following:
If there are no free currents present, then: $$ \nabla \times H = \vec{0} \rightarrow H = -\nabla \phi_m$$
where $\phi_m$ is a scalar magnetic potential. In linear media, $ \vec{B} = \mu \vec{H} $. Therefore:$$ \vec{B} = -\mu \nabla \phi_m$$ I am confused by this equation, because if B only has curl, how can it be expressed in terms of the grad of a scalar potential like this? Doesn't this expression imply that B has divergence, which is not possible? I am not sure where the error is coming from in this line of reasoning. Could someone please clarify?