# Homework Help: Magnetic Field Equation in Spherical Coordinates to Cartesian Coordinates

1. Jan 31, 2012

### jhosamelly

1. The problem statement, all variables and given/known data

The magnetic field around a long, straight wire carrying a steady current I is given in spherical coordinates by the expression

$\vec{B} = \frac{\mu_{o} I }{2∏ R} \hat{\phi}$ ,

where $\mu_{o}$ is a constant and R is the perpendicular distance from the wire to the observation points. Find the expression for $\vec{B}$ in cartesian coordinates.

2. Relevant equations

3. The attempt at a solution

I know I need to get the partial derivative of this with respect to some variable.. but I don't know what that variable is. can someone help me please?

2. Jan 31, 2012

### Mindscrape

Jacobians are pretty helpful moving between coordinates. You don't necessarily need to go that in depth though. The R is easy. How will the unit vector transform?

3. Jan 31, 2012

### jhosamelly

I didn't really get your point.. i mean, is that formula a unit vector?? I think not.

In terms of R. do u mean I should make it

R = $\frac{\mu_{o} I}{2∏ \vec{B}}$ $\hat{\phi}$

4. Feb 1, 2012

### paris1244bc

He means the unit vector in your basis.

5. Feb 1, 2012

### jhosamelly

basis meaning the observation points..

its

R=Rx i + Ry j + Rz k

6. Feb 1, 2012

### vela

Staff Emeritus
He means $\hat{\phi}$.

7. Feb 1, 2012

### jhosamelly

hmmm.. now I'm really confused. Can you please tell me the steps on how to do this, then i'll try. I'll show you what I did then you can tell me if I'm wrong or right. Thanks.

8. Feb 1, 2012

### jhosamelly

Can someone please help me with this one?? This is the last problem I wasn't able to solve in our problem set. Help will be much appreciated. Thanks.

9. Feb 1, 2012

### jhosamelly

Spherical coordinates to cartesian coordinates

1. The problem statement, all variables and given/known data
$\vec{B} = \frac{\mu_{o} I }{2∏ R} \hat{\phi}$ , is the equation of Magnetic Field in spherical coordinates. where $\mu_{o}$ is a constant and R is the perpendicular distance from the wire to the observation points. Find the expression for $\vec{B}$ in cartesian coordinates.

2. Relevant equations

3. The attempt at a solution

I tried to equate this equation in terms of $\hat{\phi}$ but after that I'm stuck.. I know also that R being the perpendicular distance from the wire to the observation points will also do the trick but I don't know how it will help. Can someone please help me figure this thing out? help will be much appreciated

Last edited: Feb 1, 2012
10. Feb 1, 2012

### tiny-tim

hi jhosamelly!

hint: what shape are the field-lines?

11. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

circular.. do you mean I should use equations for circle?

12. Feb 1, 2012

### tiny-tim

seems a good idea!

what do you get?

13. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

$(x-a)^2 + (y-b)^2 = r^2$

or if the center is at the origin

$x^2 + y^2 = r^2$

how does this help? should I equate this with the R in the equation?

14. Feb 1, 2012

### tiny-tim

the centre isn't at the origin, is it?

it's anywhere along the z-axis

and it isn't r, it's R …

ok, now that you know what shape everything is, write the original formula for B in spherical coordinates

15. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

do you mean this??

$\vec{B} = \frac{\mu_{o} I }{2∏ R} \hat{\phi}$

I think this is already in spherical coordinates.

should i change R now to $x^2 + y^2$

$\vec{B} = \frac{\mu_{o} I }{2∏ (x^2 + y^2)} \hat{\phi}$

16. Feb 1, 2012

### tiny-tim

oops! i meant cartesian coordinates!
yes, and finally you need to change phi to x and y (or i and j)

17. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

$\vec{B} = \frac{\mu_{o} I }{2∏ (x^2 + y^2)} \hat{\phi}$

$\hat{\phi} = - sin \phi \hat{i} + cos \phi \hat{j}$

$\vec{B} = \frac{\mu_{o} I }{2∏ (x^2 + y^2)} (-sin \phi \hat{i} + cos \phi \hat{j})$

is this it???? Thanks for your help )

18. Feb 1, 2012

### tiny-tim

(type \pi for π in latex )
that's it!

(except for the missing square-root )

(btw, now that you've got the idea, you don't need to find the shape of the field-lines …

that was just to help you visualise everything)

19. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

ow yah.. because its R^2.. hehe.. thanks for the reminder..

$\vec{B} = \frac{\mu_{o} I }{2\pi (\sqrt{(x^2 + y^2)})} (-sin \phi \hat{i} + cos \phi \hat{j})$

is this ok now or should i also change sin to y/r and cos to x/r ??

20. Feb 1, 2012

### tiny-tim

yes!

21. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

so the final answer is

$\vec{B} = \frac{\mu_{o} I }{2\pi (\sqrt{(x^2 + y^2)})} (-\frac{y}{r} \hat{i} + \frac{x}{r} \hat{j})$

Thank you so much for your help.. God Bless

Last edited: Feb 1, 2012
22. Feb 1, 2012

### tiny-tim

hold on!

you need to change those r's to x and y also!

23. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

ow.. ok. So, the final answer should be

$\vec{B} = \frac{\mu_{o} I }{2\pi (\sqrt{(x^2 + y^2)})} (-\frac{y}{\sqrt{(x^2 + y^2)}} \hat{i} + \frac{x}{\sqrt{(x^2 + y^2)}} \hat{j})$

if i distribute $\frac{\mu_{o} I }{2\pi (\sqrt{(x^2 + y^2)})}$

$\vec{B} = - \frac{\mu_{o} I y }{2 \pi (x^2 + y^2)} \hat{i} + \frac{\mu_{o} I x}{2 \pi (x^2 + y^2)} \hat{j}$

Thanks ))) Because you helped me I'll return the favor by helping others here as well as much as I can ;))) Thank you so much

Last edited: Feb 1, 2012
24. Feb 1, 2012

### tiny-tim

and how about multiplying those √s together?
that's the way it works!

25. Feb 1, 2012

### jhosamelly

Re: Spherical coordinates to cartesian coordinates

i think I already did this.. can you please look at my final answer to clarify. Thanks )