Can Magnetic Field do work? My professor asked us a question if magnetic field does work?
Clearly Lorentz Force suggests that magnetic force is perpendicular to velocity so the power delivered is 0.
But another observation is that two magnets attract or repel, work is done.
My differentiation in the two scenarios is that magnet is a dipole whereas a charge doesn't always produce dipoles. My argument was magnetic field does work on dipoles but not on charges.
I suggested that magnetic dipoles and charges should be treated individually because a electron has a charge and spin 1/2 which means it has two different intrinsic properties.
My professor on the other wasn't actually happy with this answer.
 A: The key theorem governing work and energy in classical electromagnetism is Poynting's theorem. To properly deal with a permanent magnet like a magnetic dipole we need to use the "macroscopic" version of Poynting's theorem which is less familiar to many. A good derivation is in section 11.2 here: https://web.mit.edu/6.013_book/www/book.html
$$-\nabla \cdot (E \times H) = \frac{\partial}{\partial t} \left( \frac{1}{2}\epsilon_0 E \cdot E + \frac{1}{2} \mu_0 H \cdot H \right) + E \cdot \frac{\partial P}{\partial t} + H \cdot \frac{\partial \mu_0 M}{\partial t} + E \cdot J $$
In this expression the term on the left and the first term on the right involve only the field. They represent the flow of energy and the storage of energy in the field respectively. The remainder of the terms include matter, so they can be considered different forms of work on matter.
In particular for this question is the term $H \cdot \frac{\partial }{\partial t}\mu_0 M$. The magnetization, $M$, is the density of magnetic moment. Thus a magnetic dipole is simply a Dirac distribution of $M$, so it is indeed possible for the magnetic field $H$ to do work on a magnetic dipole.
The reason that this question may be confusing is if one is trying to treat a magnetic dipole using the more well-known microscopic version of Poynting's theorem. It is always best to use the most appropriate laws for a situation rather than try to use awkward tools simply because they are more familiar.
In the microscopic version of Poynting’s theorem the only term involving matter is $E \cdot J$. So in principle it is always possible to express the work done on matter purely in terms of $E$ without any magnetic contribution. However, in order to accomplish that you need to know all of the charges and fields microscopically.
So, in principle the “only E does work” position is theoretically justified by the microscopic theory. However, rarely do we have such detailed knowledge, so it is also justified to use the macroscopic theory. And the opposite conclusion is justified by the macroscopic theory. Both positions are justified, so overall the argument is rather pointless.
A: I think you are right. In classical physics one introduces this notion that magnetic fields do no work because nobody talks about the real microscopic origin of magnetism at this level. If we consider quantum mechanics, the answer could be different. I will not give a definite answer because I think there are some technicalities related to thermodynamics and quantum mechanics but my answer will be the following:

*

*Lorentz force acting on charges does no work, that's a fact.

*Materials are made of charges and magnetic dipoles (and other multipoles I will not consider here as come from these other two).

*On charges, the magnetic field does no work.

*On dipoles, it depends on the dipole, materials have different sources of magnetic moments.

*If the dipole is generated by some charge in a loop (like the orbit of an electron bound to an atom), it does not work.

Thus the only possible work that the magnetic field can do is when acting on intrinsic dipoles of the subatomic particles in the material. The electrons, protons and neutrons (chargeless) in the atom have a permanent magnetic moment (proportional to spin). The energy due to this interaction is given by
$$E=-\boldsymbol\mu\cdot\mathbf{B}$$
where $\boldsymbol{\mu}$ is this intrinsic magnetic moment of the particle under consideration and $\mathbf{B}$ the magnetic field. The sum of all these magnetic moments creates a macroscopic magnetization. If the magnetic field is changing the magnetization (here I refer only to the sum of all intrinsic moments, the rest is not included) of the material it could be considered to be doing work.
A: The recovering ex-engineer weighs in:
For the case of two permanent magnets, they can produce useful work as they attract one another. However, to pull them apart again requires exactly the same amount of work, which is why you cannot make a perpetual-motion machine out of permanent magnets.
However, if you use electromagnets instead which can be switched on and off at will, you can make a device which produces useful work out of the field energy that the electromagnets make.
This is the fundamental principle of all electric motors.
