Actually I had posted a very similar question, but I wasn't quite satisfied with the answer so I am posting a new variety again.

Imagine an infinitely long wire carrying current $I_1$ from West to East. At a small distance $d$ above the wire there is another small current carrying wire of length $l$ carrying current $I_2$ from East to West (opposite to the direction of current in the below placed wire). Obviously they are magnetically repelling. And if the second wire (carrying current from East to West) is at rest the magnetic force must be equal to $mg$.

The magnetic force is upward and $mg$ is down. The magnetic force can be written as $$\frac{Uo I_1I_2}{2\pi d} l = mg$$ Now, if the magnetic force is greater than $mg$, the wire moves up. Now magnetic force is up and displacement is up too which means that work done by magnetic force should be positive. How is that possible when we know that work done by a magnetic force is always zero? Is it that an e.m.f. is induced which opposes the change?

• A constant - not varying in time - magnetic field doesn't do any work except the work done similar to a spring. So if one switch on the current in both wires a time varying magnetic field do work on both wires. After the electric currents get constant, the magnetic fields get constant too. Commented Aug 24, 2015 at 9:56
• Im sorry i dont get ur point Commented Aug 24, 2015 at 10:15
• Mohammad, the magnetic force on a charged particle is always perpendicular to the particle's velocity so the work done by the magnetic force on a charged particle must be zero. But note that, in the wire, the mobile electrons aren't free to, .e.g., execute circular motion in a uniform electric field, but are constrained by the surface of the wire. Consider the implication of that. Commented Aug 24, 2015 at 10:44
• cant the electrons exert a force on the walls the wire, which could lift the wire? Commented Aug 24, 2015 at 11:01
• Commented Aug 24, 2015 at 14:24

Here is the misunderstanding:

Now, if the magnetic force is greater than mg, the wire moves up. Now magnetic force is up and displacement is up too which means that work done by magnetic force should be positive.

The statement that a magnetic field does no work is of a static magnetic field. You are positing a changing magnetic field by the word "greater" and "moves". To become greater energy has been supplied and it is not the static condition. That changing magnetic fields do work is evident :

An electromagnetic crane is a type of crane with an electromagnetic lift. Electromagnetic cranes are commonly utilized in lifting and moving various scrap metals. It does not have the mechanical 'pincers' of a regular crane, instead, it has a large flat magnet which draws the metallic materials to it.

Im somehow not able to comment on anna v answer so here goes my cmment

How isnt the magnetic field non static. Acc. To The relation the force is dependent on the the magnitudes of current. Lets suppose some constant current i1 is flowing in the below placed wire and we bring the wire 2 also carrying some dc constant current i2 and place it above the i1 wire. The moment we place the wire 2 in the field of 1 the repelling force is experienced by the wire 2. And for instance the magnetic force which is constant as i1 and i2 are constants exceeds the mg downwards the wire 2 moves up, the work is certainly done by static magnetic field. I dont see any other parameter which could change the magnitude of magnetic field and make it varying.

• If the wire moves, magnetic field is changing. Just like if you wave a bar magnet around, the magnetic field is changing. Commented Aug 24, 2015 at 19:48
• What if the current is maintained by a dc source Commented Aug 25, 2015 at 1:05
• the magnetic field is changing because the wire is MOVING. A wire right next to you has a different magnetic field than a magnet a mile away. That's all that's happening. Commented Aug 25, 2015 at 2:38
• Got ur point. pls proceed to answer the question with the same logic Commented Aug 25, 2015 at 4:24