# Homework Help: Deriving electric field with given potential

1. Mar 26, 2016

### AndrewAmmerlaa

1. The problem statement, all variables and given/known data
Given that the potential of dipole is equal to:
$$V(\vec{r})=\frac{\vec{p}\vec{r}}{4\pi\epsilon_0 r^3}$$
show that the electric field is equal to:
$$\vec{E}(\vec{r})=\frac{1}{4\pi\epsilon_0}(\frac{3(\vec{p}\vec{r})\vec{r}}{r^5}-\frac{\vec{p}}{r^3})$$

2. Relevant equations
$$\vec{E}(\vec{r})=-\nabla V(\vec{r})$$

3. The attempt at a solution
I thought i could just differentiate V(r):

$$\vec{E}(\vec{r})=-\nabla V(\vec{r}) = \frac{-1}{4\pi\epsilon_0}(\frac{r^3\vec{p}-3r^2\vec{p}\vec{r}}{r^6})\hat{r}=\frac{1}{4\pi\epsilon_0}(\frac{3(\vec{p}\vec{r})\vec{r}}{r^5}-\frac{\vec{p}\vec{r}}{r^4})$$
but that's not the correct answer, my question is: why does only one of the terms get multiplied with r^hat? It seems to me that the nabla operator would multiply the whole thing with r^hat, but that's not the correct answer according to the question (I checked if the question is correct and it is)

Last edited: Mar 26, 2016
2. Mar 26, 2016

### drvrm

use correct form of Nabla operator .
in your expression for potential there is there should be p.r .

3. Mar 26, 2016

### AndrewAmmerlaa

I used this, is this not the correct form?
$$\nabla f=\frac{\partial f}{\partial r}\hat{r}+\frac{1}{r}\frac{\partial f}{\partial \theta}\hat{\theta}+\frac{1}{rsin{\theta}}\frac{\partial f}{\partial \phi}\hat{\phi}$$
V is not dependent on phi or theta so the derivative of that is zero, that just leaves that partial derivative to r times r^hat

4. Mar 26, 2016

### drvrm

dipole potential has a standard form -one can see in any text book

V(r,theta)= p.r/ 4Pi.epsilon.r^2 so check in the question !

5. Mar 26, 2016

### AndrewAmmerlaa

I don't understand, according to wikipedia the equation for potential is correct: https://en.wikipedia.org/wiki/Dipole#Field_from_an_electric_dipole

6. Mar 26, 2016

### ehild

V can depend on phi and theta through the product of the position vector $\vec r$ with the vector $\vec p$. For example, if $\vec p$ is parallel with the z axis, $\vec p\cdot \vec r = pr\cos(\theta)$Only a spherically symmetric potential depends only on r.
Use the form of the nabla operator in Cartesian coordinates. What is it?
If you check your result for the electric field you can see that one term is a vector, the other is a scalar, which is certainly wrong.

Last edited: Mar 26, 2016
7. Mar 26, 2016

### AndrewAmmerlaa

I hadn't thought of that, adding the derivative of V to theta gives an term with $\hat{\theta}$ and i have no idea what to do with that.

nabla in cartesian coordinates:
$$\nabla f= \frac{\partial f}{\partial x}\hat{x}+\frac{\partial f}{\partial y}\hat{y}+\frac{\partial f}{\partial z}\hat{z}$$

but that gives me this:
$$\vec{E}(\vec{r})=-\nabla \frac{\vec{p}\vec{r}}{4\pi\epsilon_0 r^3}=-\frac{r^3\vec{p}-3r^2\vec{p}\vec{r}}{r^6}\hat{x}-\frac{r^3\vec{p}-3r^2\vec{p}\vec{r}}{r^6}\hat{y}-\frac{r^3\vec{p}-3r^2\vec{p}\vec{r}}{r^6}\hat{z}=\frac{1}{4\pi\epsilon_0}(\frac{3\vec{p}\vec{r}}{r^4}-\frac{\vec{p}}{r^3})(\hat{x}+\hat{y}+\hat{z})$$ but that leaves me one $\vec r$ short in the first term, and $\hat{x}+\hat{y}+\hat{z}$ would be the vector (1,1,1) and i'm unsure what to do with that.

8. Mar 26, 2016

### ehild

That is wrong. Write out the whole potential in Cartesian coordinates, and take the partial derivatives with respect x, y, z.

9. Mar 26, 2016

### AndrewAmmerlaa

Ok, so I got this:
$$V(\vec{r})=V(x,y,z)=\frac{1}{4\pi\epsilon_0(x^2+y^2+z^2)^{\frac{3}{2}}}\begin{pmatrix}p_1 \\ p_2 \\ p_3 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix}=\frac{p_1x+p_2y+p_3z}{4\pi\epsilon_0(x^2+y^2+z^2)^{\frac{3}{2}}} \implies \vec{E}(\vec{r})=\frac{-1}{4\pi\epsilon_0}(\frac{\sqrt{x^2+y^2+z^2}^3p_1-3x\sqrt{x^2+y^2+z^2}p_1x}{\sqrt{x^2+y^2+z^2}^6}\hat{x}$$
plus simular terms for y and z
$$=\frac{1}{4\pi\epsilon_0}(\frac{3(p_1x^2\hat{x}+p_2y^2\hat{y}+p_3z^2\hat{z})}{\sqrt{x^2+y^2+z^2}^5}-\frac{p_1\hat{x}+p_2\hat{y}+p_3\hat{z}}{\sqrt{x^2+y^2+z^2}^3}=\frac{1}{4\pi\epsilon_0}(\frac{3(p_1x^2\hat{x}+p_2y^2\hat{y}\hat{x}+p_3z^2\hat{z})}{r^5}-\frac{p_1\hat{x}+p_2\hat{y}+p_3\hat{z}}{r^3})$$
how do I turn the p1+p2+p3 back into a vector? I'm sorry i'm asking so many questions i thought i understood vector calculus but it turns out i don't.

EDIT: never mind, i forgot the hats, that makes adding p1 p2 and p3 easy, but what about the p1x^2+p2y^2+p3z^2?
wouldn't that be something like this:
$$\begin{pmatrix} p_1x^2\\ p_2y^2\\ p_3z^2\\ \end{pmatrix}$$ instead of $(\vec{p}\vec{r})\vec{r}$

Last edited: Mar 26, 2016
10. Mar 26, 2016

### ehild

You made a mistake. When you take the derivative of the denominator, you have to keep the whole numerator.

11. Mar 26, 2016

### AndrewAmmerlaa

I got it:
$$V(\vec{r})=V(x,y,z)=\frac{1}{4\pi\epsilon_0(x^2+y^2+z^2)^{\frac{3}{2}}}\begin{pmatrix}p_1 \\ p_2 \\ p_3 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix}=\frac{p_1x+p_2y+p_3z}{4\pi\epsilon_0(x^2+y^2+z^2)^{\frac{3}{2}}} \implies \vec{E}(\vec{r})=\frac{-1}{4\pi\epsilon_0}(\frac{\sqrt{x^2+y^2+z^2}^3p_1-3x\sqrt{x^2+y^2+z^2}(p_1x+p_2y+p_3z)}{\sqrt{x^2+y^2+z^2}^6}\hat{x}$$
plus simular terms for y and z
$$=\frac{1}{4\pi\epsilon_0}(\frac{3x(p_1x+p_2y+p_3z)\hat{x}+3y(p_1x+p_2y+p_3z)\hat{y}+3z(p_1x+p_2y+p_3z)\hat{z}}{\sqrt{x^2+y^2+z^2}^5}-\frac{p_1\hat{x}+p_2\hat{y}+p_3\hat{z}}{\sqrt{x^2+y^2+z^2}^3}=\frac{1}{4\pi\epsilon_0}(\frac{3x\vec{p}\vec{r}\hat{x}+3y\vec{p}\vec{r}\hat{y}+3z\vec{p}\vec{r}\hat{z}}{r^5}-\frac{p_1\hat{x}+p_2\hat{y}+p_3\hat{z}}{r^3})= \frac{1}{4\pi\epsilon_0}(\frac{3\vec{p}\vec{r}\vec{r}}{r^5}-\frac{\vec{p}}{r^3})$$

Thanks so much, this was a tough one.

12. Mar 26, 2016

### ehild

Correctly:
$$= \frac{1}{4\pi\epsilon_0}(\frac{3(\vec{p}\vec{r})\vec{r}}{r^5}-\frac{\vec{p}}{r^3})$$

There is a simpler way to find the gradient: It can be considered as derivative with respect $\vec r$.
r is the magnitude of $\vec r$ so $r=\sqrt{{\vec r}^2}$
$$V(\vec{r})=\frac{\vec p \cdot \vec r }{4\pi\epsilon_0 r^3}=\frac{1}{4\pi\epsilon_0}\frac{\vec p \cdot \vec r }{\left( {\vec r}^2\right)^{3/2}}$$
$$\vec E = - \frac{dV}{d \vec r }=- \frac{1}{4\pi\epsilon_0}\frac{\vec p \left( {\vec r}^2\right)^{3/2} -(\vec p \cdot \vec r)3(\vec r^2)^{1/2} \vec r}{\left( {\vec r}^2\right)^{3/2}}=-\frac{1}{4\pi\epsilon_0}\frac{\vec p r^3 -3(\vec p \cdot \vec r)r \vec r}{r^6}$$

Last edited: Mar 26, 2016