Magnetic Field of a Long Straight Wire
In many cases, we are interested in calculating the electric field of a long, straight wire. -Claimed by Arjun Patra
Calculation of Magnetic Field
Imagine centering a wire on the y-axis and having a current run through the wire in the +y direction. We are interested in finding the magnetic field at some point along the z axis, say [math]\displaystyle{ (0,0,z) }[/math].
From here, it is an integral problem where you take an arbitrary piece of the rod and plug it into the generic formula for change in magnetic field: [math]\displaystyle{ \vec{B} =\frac{\mu_0}{4\pi} \frac{I(\vec{l} \times \hat{r})}{y^2+z^2} }[/math]
First, you can find the [math]\displaystyle{ \hat{r} }[/math]. The directional vector [math]\displaystyle{ \vec{r} }[/math] is equal to [math]\displaystyle{ (0,0,z) - (0,y,0) = (0,-y,z) }[/math]. You get this by doing final position - initial position. Next, you can find the magnitude of r, and you will get [math]\displaystyle{ (z^2+y^2)^{3/2} }[/math]. As a result, your [math]\displaystyle{ \hat{r} = \frac{(0,-y,z)}{(z^2+y^2)^{1/2}} }[/math]
The last thing we need to calculate is the [math]\displaystyle{ \Delta \vec{L} }[/math]. This is nothing more than a unit vector that tells us what direction the current is flowing. Since we know that the current is flowing in the +y axis, our [math]\displaystyle{ \Delta \vec{L} = \Delta{y} (0,1,0) }[/math].
Now that we have everything we need, we can plug it into the equation and evaluate the cross product. As a result we get [math]\displaystyle{ \Delta \vec{B} =\frac{\mu_0}{4\pi} \frac{I \Delta {y}}{(z^2+y^2)^{3/2}} (z,0,0) }[/math]
The final step is to integrate this. Since it is centered at the origin, we have to integrate from -L/2 to L/2. So our equation looks like [math]\displaystyle{ \int\limits_{-L/2}^{L/2}\ \Delta \vec{B} =\frac{\mu_0}{4\pi} \frac{I \Delta {y}}{(z^2+y^2)^{3/2}} (z,0,0) }[/math]