Is there work done when two current carrying wires are attracted?

When a current carrying wire attracts(or repels) another wire, the wire moves under the action of a force. Also, it is obvious that the work done is due to force of "magnetic field" on "moving electrons".

Now, from the equation $$\overrightarrow F=q[\overrightarrow v,\overrightarrow B]$$, where $[\overrightarrow a,\overrightarrow b]$ stands for cross product

As is clear, the force is perpendicular to the velocity(for a finite force) and therefore to the direction of motion, i.e. to $d\overrightarrow r$, which would mean that the work done is zero.

Which viewpoint is wrong and why? Also, what about the general case when a wire is moved by a magnetic field?

Also, it is obvious that the work done is due to force of "magnetic field" on "moving electrons".

This part is problematic, as you probably already know (you've put the quotes). There is macroscopic magnetic force on wire 1 due to wire 2 given by $\int \mathbf j_1 \times \mathbf B_2 \,d^3\mathbf x$. Often this force is present but balanced by other forces so the wire does not move and there is no work involved.

When wire moves and kinetic energy increases, work is done on the wire. However this work is not due to the above force, since it is everywhere perpendicular to the motion of the charges it acts on, as you wrote above.

The only force that can do work on the wire and increase its kinetic energy is electric force. Since there are no external electric fields, it can be only the electric field of the wire 1 itself. This is always present, since there is current inside the wire, but usually does not move the wire in a noticeable way since mechanical equilibrium is easily established in common circuits. When the electric and magnetic forces cease to be counteracted by contact and mechanical forces (say, attached wire gets loose), the wire 1 will have non-zero acceleration due to magnetic force of wire 2, the power of this force being always zero. However, as soon as the wire 1 accelerates, this produces change in its own electric field. The changed electric field will now work on the wire itself and give it kinetic energy. This will happen at expense of the energy of magnetic field of the wires (and the source maintaining the current).

EDIT

The above explanation does not seem correct to me now, because one can extract work from the system of current carrying conductors very slowly, in which case the induced electric field will be negligible, while the force doing work is still great and given by the formula like $\int \mathbf j_1 \times \mathbf B_2\,d^3\mathbf x$. Please remove the green sign of acceptance. The real answer to your question requires more insight.

The work done will be the change in electric potential . If we assume current density to be constant and electric current to be constant(DC current) then we can equate this wire to a linearly charged wires(Static field). The amount of charge per unit length is always constant since outgoing electrons are replaced by incoming electrons. When two charges are brought together then the work is done.

Coming to your question the magnetic field does work in by changing electric potential between two wires. If magnetic field was applied to a single wire, the work done is zero as you mentioned. When the current is not constant, then also the magnetic field does work on electric field. Work is done by external magnetic field and magnetic field generated by wire.

The force is perpendicular to the motion of the charge carriers.

But the resulting motion of the wire is in the direction of the induced force, so work is done on the wire.

• But the wire moves due to the motion of the electrons! And how can work be done 'on the wire', when the force is on the charges and not on the wire? – Shubham Apr 18 '14 at 18:39