Can someone please help me understand and answer the question of "why are the forces on a magnetic dipole different in a uniform magnetic field and non-uniform magnetic field?" I know in a uniform magnetic field the magnetic dipole material will tend to align with the field lines of the magnetic field it is in but what happens in a non-uniform one? Doesn't it just change movement rapidly whilst trying to align it's poles with the field line of the magnetic field.
In uniform field, the net force is zero $$F=\oint ids\times B=(\oint ids)\times B=0\times B=0 $$ but the torque is not zero,$\tau\neq0$, until it aligns with field lines,
in non-uniform field, both are nonzero $F \neq 0$ , $\tau \neq 0$.