# Magnetic Field of current carrying straight wire

1. Nov 10, 2006

So I get a "cheat" sheet for my upcoming emag test. I would like to have a general expression for the magnetic field of a current carrying wire. Would someone let me know if I am on the right path here.

Lets say we have a section of a current carrying wire that has length $L$. Lets say there is a point P that is located at $P(\bar r, \bar \phi, \bar z )$

We will use cylindrical coordinates and denote the bottom of the wire as $0$, and the top of the wire as $L$. Since we are in cylindrical coordinates, there will be no phi dependence, so the point can be expressed as: $P(\bar r, 0, \bar z)$

Thus, is my thought process correct here (I don't want to solve these integrals yet, if I am doing something wrong).

Recall:
$$\vec A = \frac{\mu_0 I}{4 \pi} \oint_{C'} \frac{\vec dl'}{R}$$

Thus, if we break the integral into two contours,
$$\vec A = \frac{\mu_0 I}{4 \pi} \left( \int_{C'_1} \frac{\vec dl'}{R_1} + \int_{C'_2} \frac{\vec dl'}{R_2} \right)$$

$$\int_{C'_1} \frac{\vec dl'}{R_1} = \int_{0}^{\bar z} \frac{\hat z dz'}{\sqrt{z'^2+\bar r^2}}$$
$$\int_{C'_2} \frac{\vec dl'}{R_2} = \int_{\bar z}^{L} \frac{\hat z dz'}{\sqrt{[(L-\bar z)-z']^2+\bar r^2}}$$

Now if I solve these two integrals and plug into $\vec A$ and then get $\vec B$ by $\vec B = \nabla \times \vec A$ I should be all set right? (...I hope)

Last edited: Nov 10, 2006
2. Nov 11, 2006

### Meir Achuz

Just use the law of Biot-Savart.

3. Nov 11, 2006

Does that make the math any easier? I'll see what I can do with that, but it seems like it would be easier to do this way. Those integrals are lengthy though (I let Maple solve the more complex one).

4. Nov 12, 2006

$$\vec B = \hat \phi \frac{\mu_0 I}{4 \pi \bar r} (\alpha + \beta)$$
$$\alpha = \frac{L - \bar z}{\sqrt{\bar r^2 + (\bar z - L)^2}}$$
$$\alpha = \frac{\bar z}{\sqrt{\bar r^2 + \bar z^2}}$$