Two current-carrying wires may attract each other. In absence of other forces, the wires will move towards each other increasing the kinetic energy. Does it contradict the fact that the magnetic force cannot do any work and hence cannot increase the kinetic energy?

The displacement of the wire due to magnetic forces happens in the direction of the distance vector between the two wires. The magnetic field due to the wires is perpendicular to the wire and the distance vector between the wires so work done is by the field is zero as usual. As the wires move towards each other there is a change in magnetic field and according to Lenz law there will be an induced current in the wires which will be directed opposite to the current initially carried by them. As these electrons cannot come out of the wire, they hit the edges of the wire starts moving and gains kinetic energy.


1