You may have read about how to find the magnetic field from a very long wire of current. Now, what is the magnetic field from a single segment? Suppose we have the configuration shown below. Your observation point is at the origin, and the segment of current I runs in a straight line from ⟨−L,0,0⟩ to ⟨0,−L,0⟩.
Below, we show a diagram with a lot of pieces of the Biot-Savart Law unpacked. We show an example d→l, and a separation vector →r. Notice that d→l is directed along the segment, in the same direction as the current. The separation vector →r points as always from source to observation.
For now, we write d→l=⟨dx,dy,0⟩
and
→r=→robs−→rsource=0−⟨x,y,0⟩=⟨−x,−y,0⟩
Notice that we can rewrite
y as
y=−L−x. This is a little tricky to arrive at, but is necessary to figure out unless you rotate your coordinate axes, which would be an alternative solution to this example. If finding
y is troublesome, it may be helpful to rotate. We can take the derivative of both sides to find
dy=−dx. We can now plug in to express
d→l and
→r in terms of
x and
dx:
d→l=⟨dx,−dx,0⟩
→r=⟨−x,L+x,0⟩
Now, a couple other quantities that we see will be useful:
d→l×→r=⟨0,0,dx(L+x)−(−dx)(−x)⟩=⟨0,0,Ldx⟩=Ldxˆz
r3=(x2+(L+x)2)3/2
The last thing we need is the bounds on our integral. Our variable of integration is
x, since we chose to express everything in terms of
x and
dx. Our segment begins at
x=−L, and ends at
x=0, so these will be the limits on our integral. Below, we write the integral all set up, and then we evaluate using some assistance some
Wolfram Alpha.
→B=∫μ04πI⋅d→l×→rr3=∫0−Lμ04πILdx(x2+(L+x)2)3/2ˆz=μ02πILˆz