# Homework Help: Finding flux from electric field

Tags:
1. Oct 30, 2015

### Titan97

1. The problem statement, all variables and given/known data
If $\vec{E}=k\frac{x\hat i +y\hat j}{x^2+y^2}$, find flux through a sphere of radius R centered at origin.

2. Relevant equations
$\int E.da=\int(\nabla\cdot E)\cdot da$

3. The attempt at a solution
I was able to solve this problem without finding divergence of electric field.
If $\vec{r}= {x\hat i +y\hat j}$.
Then, $$E=k\frac{\vec{r}}{r^2}=k\frac{\hat r}{r}$$
This is like the electric field due to an infinite line charge which is given by $$E=\frac{\lambda}{2\pi\epsilon_0 r}$$
So the field specified in question can be assumed to be from an infinitely long charged wire.
I can easily find the flux using Gauss' law by finding the charged enclosed by the spherical surface.

But when I tried finding the divergence of E, it came out to be zero.
I used the formula $$E=\frac{\partial E}{\partial x}+\frac{\partial E}{\partial y}$$

2. Oct 30, 2015

### TSny

The divergence of E is indeed zero at all points other than points on the z axis (i.e., on the line charge itself). However, you can see that $\partial E/ \partial x$ and $\partial E/ \partial y$ are undefined on the z axis.

This is similar to the example of the E field of a single point charge where the divergence is zero everywhere except at the location of the point charge (where the divergence is undefined). To deal with the divergence at the location of the charge, you can use a dirac delta function.

See http://www.physicspages.com/2011/11/14/dirac-delta-function-in-three-dimensions/

3. Oct 30, 2015

### Titan97

Divergence is zero in this case at all points (except at x-axis). Does that mean flux is zero through a spherical surface?

4. Oct 30, 2015

### TSny

If the divergence is zero at every point inside a spherical surface, then the net flux through the surface would be zero. For this problem of a line charge along z axis and spherical surface centered at the origin, there are points inside the spherical surface where the divergence is not zero (namely, at points on the z axis where the divergence is undefined). The net flux through the surface is not zero, as you have shown using Gauss' law.

5. Oct 31, 2015

### Titan97

I tried finding divergence in cylindrical coordinates. It worked perfectly. Why?

6. Oct 31, 2015

### TSny

In cylindrical coordinates the divergence of $\vec{E}$ for this problem is $$\frac{1}{r} \frac{\partial (r E_r)}{\partial r}$$ The partial derivative is zero everywhere, but the $\frac{1}{r}$ factor is undefined on the z axis. So, the divergence does not have a definite value on the z axis.

7. Oct 31, 2015

### Titan97

Thats not what I got.
$r=\sqrt{x^2+y^2}$
$x=r\cos\theta$
$y=r\sin\theta$
$\hat i=(\cos\theta) \hat r-(\sin\theta) \hat \theta$
$\hat j=(\sin\theta) \hat r+(\cos\theta) \hat \theta$
$$E=a\frac{x\hat i+y\hat j}{x^2+y^2}=a\frac{(r\cos\theta)(\cos\theta \hat r-\sin\theta \hat \theta)+(r\sin\theta)(\sin\theta \hat r+\cos\theta \hat \theta)}{r^2}$$
$$E=a\frac{r\hat r}{r^2}=a\frac{\hat r}{r}$$
Hence, $$\nabla\cdot E=-a\frac{1}{r^2}$$
So, divergence is non zero in cylindrical coordinates. But should divergence change if the coordinate system changes? The vector field is still the same.

8. Oct 31, 2015

### TSny

9. Oct 31, 2015

### Titan97

Why is it $\frac{1}{r}\frac{\partial rA}{\partial r}$?

10. Oct 31, 2015

### TSny

It is due to the fact that the unit vectors in cylindrical coordinates change direction as you move around in space. Thus, when taking derivatives of a vector you need to take derivatives of the unit vectors as well as the coefficients of the unit vectors. The derivation of the form of the divergence is found in many texts.

11. Nov 5, 2015

### Titan97

@TSny , $$E=a\frac{\hat r}{r}$$
$$\nabla\cdot E=a\nabla\cdot\frac{\hat r}{r}$$
This gives
$$\nabla\cdot E=ak\delta(r)$$
How do I find $k$?

12. Nov 5, 2015

### TSny

To express $\nabla\cdot\frac{\hat r}{r}$ in terms of $\delta(r)$ where $r$ is the radial coordinate in cylindrical coordinates, examine the integral $\int \nabla\cdot\frac{\hat r}{r} dV$ over a cylindrical volume centered on the z-axis. Use the divergence theorem to get the answer by converting the integral to a surface integral. Then try to express $\nabla\cdot\frac{\hat r}{r}$ in terms of $\delta(r)$ such that when you do the volume integral you get the same result as the surface integral. You will see that you must take $\nabla\cdot\frac{\hat r}{r}$ proportional to $\delta(r)/r$ rather than just proportional to $\delta(r)$.

13. Nov 5, 2015

### Titan97

$$\int\int\int \nabla\cdot\frac{\hat r}{r}dV=\int\int\frac{\hat r}{r}\cdot dS$$
Let the cylinder have centre at origin and axis along z-axis.There are three surfaces.
Since field is along radial direction, flux through the plane surfaces will be zero. There will only be flux through the curved surface.
$$dS=rd\theta dz \hat r$$
$$\int\int\frac{\hat r}{r}\cdot dS=\int_{-z}^z\int_0^{2\pi}d\theta dz=4\pi z$$

14. Nov 5, 2015

### TSny

OK.

Now evaluate $\int\int\int \nabla\cdot\frac{\hat r}{r}dV$ for the same volume and force it to equal $4\pi z$ by deducing the necessary relation between $\nabla\cdot\frac{\hat r}{r}$ and $\delta(r)$.

15. Nov 6, 2015

### Titan97

$\int\int\int \nabla\cdot\frac{\hat{r}}{r}dV=0$ for all $r\neq 0$
$\int\int\int \nabla\cdot\frac{\hat{r}}{r}dV=4\pi z$ for $r=0$

So $$\nabla\cdot\frac{\hat{r}}{r}=4\pi z\delta(r)$$

16. Nov 6, 2015

### TSny

This isn't correct. In $\int\int\int (\nabla\cdot\frac{\hat{r}}{r})dV$ you need to write out the volume element $dV$ in cylindrical coordinates and integrate over the same cylinder that you used for evaluating the surface integral.

17. Nov 6, 2015

### Titan97

How can I evaluate that integral? It will come out to be zero since the divergence is zero.

18. Nov 6, 2015

### Titan97

How can I evaluate that integral? It will come out to be zero since the divergence is zero.

19. Nov 6, 2015

### TSny

We are assuming that the divergence is proportional to a delta function $\delta(r)$ so that it will be zero everywhere except at $r = 0$, where it is singular. (It is good that it is singular at $r=0$ since we know that at the location of a line charge the volume charge density is singular.) So, you can try letting $\vec{\nabla} \cdot \frac{\hat{r}}{r} = k \delta(r)$ and then try to determine k such that the volume integral will equal $4 \pi z$.

You should find that you can't make it work. But, in the process you might see how to express $\vec{\nabla} \cdot \frac{\hat{r}}{r}$ in terms of $\delta(r)$ to make it work. In a previous post, I alluded to what you should find.

EDIT: Alternately, you can try expressing $\vec{\nabla} \cdot \frac{\hat{r}}{r}$ in terms of Cartesian coordinate delta functions. For example, suppose you try $\vec{\nabla} \cdot \frac{\hat{r}}{r} = k \delta(x) \delta(y)$. Can you find $k$ such that the volume integral of $\vec{\nabla} \cdot \frac{\hat{r}}{r}$ over your cylindrical volume equals $4 \pi z$?

Last edited: Nov 6, 2015
20. Nov 7, 2015

### Titan97

δ(r) is infinite at r=0. But is $\nabla\cdot\frac{\hat r}{r}$ infinite at r=0?

21. Nov 7, 2015

### TSny

I would say that neither δ(r) nor $\nabla\cdot\frac{\hat r}{r}$ is infinite at r = 0. Neither one can actually be said to take on any particular value (finite or infinite) at r = 0. See here for some discussion: https://en.wikipedia.org/wiki/Dirac_delta_function

The important thing is not what their value is at r = 0, but how they behave when you integrate them. You can show that $\nabla\cdot\frac{\hat r}{r}$ has the same properties as δ(r)/r when occurring in volume integrals using cylindrical coordinates (r, θ, z).

22. Nov 8, 2015

### Titan97

I will use cylindrical coordinates.

Let $\nabla\cdot\frac{\hat r}{r}=f(r)\delta(r)$

$$\int\nabla\cdot\frac{\hat r}{r}=\int_0^R\int_{-z}^z\int_0^{2\pi}rf(r)\delta(r)drd\phi dz=4\pi z\int_0^R rf(r)\delta(r)dr$$

So $$\int_0^R rf(r)\delta(r)dr=1$$

23. Nov 8, 2015

### TSny

Yes. So, you need to deduce the form of $f(r)$.

$\delta(r)$ is defined so that $\int_0^a \delta(r)dr=1$ and $\int_0^a g(r) \delta(r)dr=g(0)$ for any function g(r) and any positive number $a$. This definition of $\delta(r)$ is a little different than the usual definition of the delta function because the lower limit of the integral (r = 0) occurs at the point where the argument of the delta function is zero. Usually we require the point where the argument is zero to be within the range of integration (rather than at the boundary of the range of integration) in order for the delta function to yield it's full nonzero contribution.

So, if you compare your result $\int_0^R rf(r)\delta(r)dr=1$ with $\int_0^R \delta(r)dr=1$, you can see what f(r) must be.

24. Nov 8, 2015

### Titan97

So does this new δ(r) look like a rectangular hyperbola with its value zero at all points except at x=0?
This a graph of $\frac{e^-{100x^2}}{x}$.

Why can't it be defined such that $\int_0^R\delta(r)=1$
If you take $\int_{-a}^R\delta(r)$, it will be zero.(from the graph).
What do you mean by argument of a function?

25. Nov 8, 2015

### TSny

We are working in cylindrical coordinates (r, θ, z) where r is always greater than or equal to zero.

You could also work in Cartesian coordinates (x, y, z) and find $\nabla \cdot \frac{\hat{r}}{r}= 2\pi \delta(x) \delta(y)$ where $\vec{r} = x \hat{i} + y \hat{j}$.