Say there’s an iron nail sitting on the table and I bring a permanent magnet close enough above it that the nail comes off the table and sticks to the magnet. Now it appears a force has been exerted on the nail to move it over a distance (the definition of work, measured in units of energy). Where did the energy come from?
In: 0
It’s basically like gravity but with magnetism. Say there’s a ball on my balcony and I push it gently and it falls down. Where did the energy come from to make it fall down?
Answer: It started with energy because it was on the balcony instead of on the ground. And your nail started with energy because it wasn’t stuck to a magnet.
Actually for calculations it’s easier to go the other way around: we say that a nail by itself with no magnets nearby has 0 energy, and when it’s stuck to a magnet it has negative (-) energy. That’s fine – since we can’t measure potential energy, just potential energy difference, we can say 0 is wherever we like.
There is a potencial energy associated to that magnetic field. A uniform Magnetic Field can only exert rotational work over a dipole (or a system of dipoles like a nail). If this field is not uniform (like the one generated by a magnet), the dipoles are not rotating at the same speed generating a net force that performs traslational work
If you’re worried about conservation of energy, don’t be. In order to exploit the magnet for energy, you need to separate the nail from the magnet before the magnet it able to pull on it again. So yes, work is done to pull the nail towards the magnet, but then you apply work and energy to separate them. In the end, we have not stumbled on an unlimited energy scheme. Darn!
Latest Answers