Source: High school physics (Chinese)
Problem
In Figure a wire is bent into two mutually perpendicular straight segments and placed in a uniform magnetic field of magnitude $B = 0.10$ T (directed out of the page). The wire carries a current of $2$ A. The horizontal segment from $a$ has length $3$ cm and the vertical segment ending at $b$ has length $4$ cm. Find the resultant force on this bent wire, and show that this force equals the force on a straight wire (carrying the same current) that directly connects the points $a$ and $b$.
The resultant force on the bent wire is $F = 0.01$ N, directed perpendicular to the straight segment $ab$ (in the plane of the page). It equals the force on a straight wire (carrying the same current) connecting $a$ to $b$.
Place the corner of the bend at the origin, with the $3$ cm segment along $+\hat{x}$ (from $a$) and the $4$ cm segment along $+\hat{y}$ (ending at $b$). With $\vec{B} = B\hat{z}$ (out of page):
Force on segment 1 (length $L_1 = 0.03$ m, current in $+\hat{x}$):
$$\vec{F}_1 = I\vec{L}_1\times\vec{B} = IL_1B\,(\hat{x}\times\hat{z}) = -IL_1B\,\hat{y}.$$ $F_1 = 2\times0.03\times0.10 = 6\times10^{-3}$ N, directed in $-\hat{y}$.Force on segment 2 (length $L_2 = 0.04$ m, current in $+\hat{y}$):
$$\vec{F}_2 = IL_2B\,(\hat{y}\times\hat{z}) = IL_2B\,\hat{x}.$$ $F_2 = 2\times0.04\times0.10 = 8\times10^{-3}$ N, directed in $+\hat{x}$.Resultant:
$$F = \sqrt{F_1^2+F_2^2} = \sqrt{(6\times10^{-3})^2+(8\times10^{-3})^2} = 10\times10^{-3} = 0.01\ \text{N}.$$The straight wire from $a$ to $b$ has length $L_{ab} = \sqrt{3^2+4^2} = 5$ cm $= 0.05$ m, perpendicular to $\vec{B}$, so the force on it is
$$F_{ab} = BIL_{ab} = 0.10\times2\times0.05 = 0.01\ \text{N}.$$The direction is perpendicular to the wire $ab$ in the plane of the page, with components $(0.8\,\hat{x}-0.6\,\hat{y})\times0.01$ N, identical to $\vec{F}_1+\vec{F}_2$.
This illustrates the general result: in a uniform field, the resultant Ampere force on any current-carrying wire between two points depends only on the straight-line vector joining those endpoints, not on the shape of the wire.