# Homework Help: Derivatives in Vector Notation

1. May 12, 2006

### dimensionless

I've got an equation (from Wikipedia)for the electrostatic potential of an electric dipole. It looks like this:

$$\Phi (\mathbf{r}) = \frac {1} {4\pi\epsilon_0 r^2} (\mathbf{p}\cdot\hat{\mathbf{r}})$$

E is the electric field
r, r, r\hat are as above
p is the (vector) dipole moment
e0 is the primitivity of free space

To find the electric field I have to take the derivative as follows.

$$\mathbf{E} = - \nabla \Phi$$

The derivative looks like this:

$$\mathbf{E} = \frac {1} {4\pi\epsilon_0 r^3} \left(3(\mathbf{p}\cdot\hat{\mathbf{r}})\hat{\mathbf{r}}-\mathbf{p}\right)$$

I'm confused by the vector notation. Why do I have r\hat multiplied by r\hat? Why is the electric field simply not

$$\Phi (\mathbf{r}) = \frac {1} {2\pi\epsilon_0 r^3} (\mathbf{p}\cdot\hat{\mathbf{r}})$$

2. May 12, 2006

### Staff: Mentor

Do you know the equation for the grad operator $$\nabla$$ in spherical coordinates?

3. May 12, 2006

### neutrino

To answer your first question - it's not r\hat times r\hat, but the scalar product of p\hat and r\hat times r\hat (basically a scalar multiple of the unit vector)

As for the second question, it's not what you think it is because the expression is in spherical polar coordinates

Last edited: May 12, 2006
4. May 12, 2006

### marlon

This is a classic one, especially because you need to calculate the gradient of a scalar:

First apply :
$$\nabla \frac {1} { r^2} ({p}\cdot\hat{r}) = \nabla ( \frac {1} { r^2}) ({p}\cdot\hat{r}) + \frac {1} { r^2} \nabla ({p}\cdot\hat{r})$$

To get the gradient of a scalar:
$$\nabla \frac {1} {r^2} = \frac {-2 \vect(r)}{r^4}$$ ; the r in the numerator is a vector !!!

To get this, just write the vectors in x and y coordinates for example.

The $$\frac{1}{r^2} = \frac{1}{x^2+y^2}$$
Take the derivative to x and to y, then add up these two values. Keep in mind that each result will have a unitvector $$e_x$$ and $$e_y$$.

The p is easy, since it does not depend on r.

marlon

5. May 12, 2006

### marlon

Besides, shouldn't the $$\Phi (\mathbf{r}) = \frac {1} {4\pi\epsilon_0 r^2} (\mathbf{p}\cdot\hat{\mathbf{r}})$$

be

$$\Phi (\mathbf{r}) = \frac {1} {4\pi\epsilon_0 r} (\mathbf{p}\cdot\hat{\mathbf{r}})$$

so no r^2 but r ???

Otherwise, your given potential will not yield the solution that you have been given, after calculating the gradient.

regards
marlon

6. May 12, 2006

### dimensionless

Could the above be written as

$$\nabla \frac {1} {r^2} = \frac{\partial \frac {1} {r^2}}{\partial r} \hat{\mathbf{r}} + \frac{1}{r} \frac{\partial \frac {1} {r^2}}{\partial \theta} \hat{\mathbf{\theta}} + \frac{1}{r sin(\theta)} \frac{\partial \frac {1} {r^2}}{\partial \psi} \hat{\mathbf{\psi}}$$

??

7. May 12, 2006

### dimensionless

I think it is right because/if $$\hat{\mathbf{r}} = \mathbf{r}/r$$ .

8. May 12, 2006

### dimensionless

I do if it's

$$\nabla = \frac{\partial }{\partial r} + \frac{1}{r} \frac{\partial }{\partial \theta} + \frac{1}{r sin(\theta)} \frac{\partial}{\partial \psi}$$

9. May 12, 2006

### dimensionless

Why is $$\mathbf{p}$$ not treated as a constant?

10. May 12, 2006

### Staff: Mentor

Correct. When you do the differentiations, you will end up with r-hat and theta-hat components, where the polarization p is a scalar constant inside each term. I'm not used to seeing the form of the answer that you list for the E field of a dipole. Do you have another textbook that might show you a different form, with the r-hat and theta-hat terms?

11. May 12, 2006

### Staff: Mentor

Oh, and you omitted the r-hat, theta-hat, and phi-hat unit vectors from the three terms....

12. May 12, 2006

### HallsofIvy

Because it is not in general a constant! $\mathbf{p}$ is, as you said initially, "the (vector) dipole moment" which may vary with position.

13. May 12, 2006

### marlon

What do you mean by this ?

Ok, i am gonna assume that r hat is just the vector r, ok ? If not, please define what it is interms of vector r and the scalar r. The definition that you give is one that i don't get ? What does it mean ?

According to me, the r squared in the denominator should be r. Just to be clear, the r is the magnitude of the vector r , right ? At least, that is what it should be.

I get this :
$$\vec {\nabla} \frac {1} { r} ( \vec {p} \cdot \vec {r}) = \vec {\nabla} ( \frac {1} { r}) ( \vec {p} \cdot \vec {r}) + \frac {1} { r} \vec {\nabla} ( \vec {p} \cdot \vec {r})$$

This first part of the sum is :
$$\vec{\nabla} \frac{1}{r} = \frac{- \vec{r}}{r^3}$$

The second part :
$$\frac {1} { r} \vec {\nabla} ({\vec {p}} \cdot \vec {r}) = \frac {1} { r} {\vec {p}} \cdot \vec {\nabla} ( \vec {r}) = 3 \frac {1} { r} {\vec {p}}$$

The 3 comes from the gradient of the r vector. To check this, just write down the expression for both nabla and r in x y and z coordinates.

Now fill all of this into the sum and multiply by -1

To get :
$$\vec {E} = \frac {1} {4\pi\epsilon_0 r^3} \left((\vec {p} \cdot \vec {r}) \vec {r}- 3 {\vec {p} r^2}\right)$$

marlon

Last edited: May 12, 2006
14. May 12, 2006

### Random Variable

Use a vector identity and you can indeed treat vector P as a constant since it is a vector of constant length.

Last edited: May 12, 2006
15. May 13, 2006

### nrqed

Sounds like some replies have been given partial help and some other have made things more confusing. Let me add the following:

First, to answer your question, the key point is that, the derivative of the unit vector r hat is not zero! (but you may treat the dipole vector p as a constant vector here). That is the reason why you get two terms.

The best way to do the calculation is not to use r hat but the vector r. Then you have to take the gradient of

$$\Phi (\mathbf{r}) = \frac {1} {4\pi\epsilon_0 r^3} (\mathbf{p}\cdot{\mathbf{r}})$$

Using the spherical coordinate representation of the gradient, you should convince yourself easily that ${\vec{ \nabla}} {1 \over r^3 } = -3 {{\hat r} \over r^4}$.

Then, you also have to take the gradient of the dot product ${{\vec p}} \cdot {\vec{r}}$. Here, the best way is to go to Cartesian coordinates in which case you simply have to compute

$$({\vec i} {\partial \over \partial x} +{\vec j} {\partial \over \partial y}+{\vec k} {\partial \over \partial z}) ( p_x x + p_y y + p_z z)$$

(where I have used that ${\vec {r} } = x {\vec i} + y {\vec j} + z {\vec k}$ in Cartesian coordinates). You should easily convince yourself that the result is simply the vector ${\vec {p}}$!

Putting all the pieces together gives the desired result.

Patrick

16. May 13, 2006

### nrqed

But he/she *did* define it in terms of the vector r and scalar r! He/She wrote explicitly ${\hat{ r}} = { {\vec r} \over r}$. There is no other way to define it in terms of the vector r and scalar r! It means that r hat is the vector r divided by its magnitude. It's a very common notation!

The first step is wrong. One cannot move in the divergence to the right like this. My previous post shows that the result is the vector p.

Regards

Patrick

EDIT: One way to see that it is wrong is that the vector p is dotted into something which is what? a scalar? That is clearly inconsistent.

Last edited: May 13, 2006
17. May 20, 2006

### marlon

Indeed, i made a mistake there. Thanks for the correction

regards

marlon

18. May 24, 2006

### dimensionless

$$\mathbf{E} = \frac {p} {4\pi\epsilon_0 r^3}( 2\mathbf{cos}\theta\mathbf{a}_{r} +\mathbf{sin}\theta\mathbf{a}_{\theta} )$$

Last edited: May 24, 2006