# Derivative of Magnetic Field from a dipole

1. Dec 6, 2012

### mbq

I need to take the derivative of the magnetic field from a magnetic dipole with respect to r for a project I'm working on:

B =[m[/0]/(4π) * (3rhat(μ dot rhat) - μ)/|r|^3

where rhat is the unit vector of the vector r (or r/|r|), |r| is the magnitude of the vector r, and μ is the magnetic moment of the dipole

I'm mainly confused about how to take the derivative of rhat with respect to r

Thanks for any suggestions anyone may have!

2. Dec 7, 2012

### tiny-tim

welcome to pf!

hi mbq! welcome to pf!
write $\hat{r}$ = (x/r, y/r, z/r)