Solution:
Key idea: Parallel currents in the same direction attract and those in opposite directions repel. The force per unit length is 2πrμ0I1I2, so it is weaker at a larger distance r.
Step 1 — Find the forces on sides BC and DA.
Sides BC and DA are perpendicular to the wire and carry equal currents in opposite directions (from B to C, and from D to A). Each part of BC is at the same distance from the wire as the matching part of DA, so the forces on these two sides are equal and opposite and cancel.
Step 2 — Find the force on side AB.
Side AB, nearest the wire, carries current from A to B, upward, in the same direction as the current in the wire. So it is attracted towards the wire.
Step 3 — Find the force on side CD.
Side CD, farther from the wire, carries current from C to D, downward, opposite to the current in the wire. So it is repelled from the wire.
Step 4 — Compare the two forces.
Let a and b be the distances of AB and CD from the wire, with a less than b, and let l be the length of these sides. The net force towards the wire is the attraction minus the repulsion:
Fnet=2πμ0I2l(a1−b1)
Since a is less than b, the bracket is positive, so the attraction on AB is larger than the repulsion on CD.
Therefore, the net force on the loop is an attraction, and the loop moves towards the straight wire (without turning).