# How to determine if a given charge and current density function satisfy continuity equation?

$$\nabla \cdot J = -\partial\rho/\partial t$$ is the continuity equation for charge.

Meaning that any charge density and current density function I input into Maxwell's equation, must fit this condition for the equations to yield physics results.

My question is, how can I determine, that given my $$\partial\rho/\partial t$$ is zero, that the divergence of $$J$$ is also zero for a chosen current density function?

This is obviously for situations for where I am talking about currents in wires that have ideally infinitely thin radius and having a net zero charge(or have uniform distribution).

Clearly, the divergence of $$J$$ is zero if it is independent of $$x,y,z$$

as $$\nabla \cdot= \partial/\partial x +\partial/\partial y +\partial/\partial z$$

for example I (khat) or if the component is independent of the variable your differentiating e.g Idirac(x)dirac(y) (khat)

However for a current that lies on a LOOP( with constant absolute magnitude), the current density function most definitely still depends on x,y,z, as it's direction changes, But the sum of all of the derivative totals zero,

However for a current density function that has a constant magnitude but lies in a ring shape for example. How would I compute the divergence of this? as we use functions like this all the time, for moddeling things when dp/dt is zero . e.g in all electrostatic equations.

but no where online have I been able to find the actual current density function for an infinitely thin wire of any shape,

Can someone prove that for a current density function that is in the direction of dl,that
lies on a continuous curve, of infinite thinness, where the absolute magnitude of the current is constant, that the divergence is zero?

My only reason for asking this, is that when solving maxwells equations, all physics textbooks never input a volume current density function J dv for an infinitely thin wire and then integrates DA to reduce it to Idl , they just assume that they are equivalent for infinitely thin wire, and replace it. I have only come across a mathematically rigorous way of transforming between the two in the case of a STRAIGHT wire, with the use of Dirac(x,y)

Simply assuming they are equivalent isn't rigorous, and simply saying $$\sigma dA = Q$$ so I can use this e.g instead of $$\rho dV$$ isn't satisfying as we live in a 3d world and solve maxwells equations using volume charge

can someone also perhaps show me how to derive then continuity equation in the case where I'm using Surface current/ linear current density instead?

• The divergence in cylindrical coordinates is $\nabla \times A = \frac{1}{r} \frac{\partial (r A_r)}{\partial r} + \frac{1}{r} \frac{\partial A_\phi}{\partial\phi} + \frac{\partial A_z}{\partial z}$. If $A_\phi$ and $r A_r$ are constant, then divergence is zero. Nov 10 '21 at 7:42

This form of Maxwell's Equations should cover metals dielectrics and most other media. Focus on the following

\begin{align} \boldsymbol{\nabla}.\mathbf{D}&=\rho_f \\ \boldsymbol{\nabla}\times\mathbf{H}&=\mathbf{J}_f+\partial_t\mathbf{D} \end{align}

Now take divergence of the second equation, and bear in mind that divergence of a curl is zero:

$$\boldsymbol{\nabla}.\boldsymbol{\nabla}\times\mathbf{H}=\boldsymbol{\nabla}.\mathbf{J}_f+\boldsymbol{\nabla}.\partial_t \mathbf{D}=0$$

You can then swap and substitute $$\boldsymbol{\nabla}.\partial_t \mathbf{D}=\partial_t \boldsymbol{\nabla}.\mathbf{D}=\partial_t \rho_f$$

So the continuity equation is a direct consequence of Maxwell's equations. Verifying it is akin to verifying Maxwell's equations. No need to mess around with thing wires and loops, the above prescription applies to most media and even mixed domains, i.e. with different media.

The above analysis tells you that you cannot talk about charge density and current density separately.

I am not sure what proof you are expecting for infinitely thin wire. There I would simply state current density as:

$$\mathbf{J}\left(\mathbf{r}\right)=\alpha\int ds'\: \boldsymbol{\mathcal{\dot{R}}}\left(s'\right)\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s'\right)\right)$$

Where $$\boldsymbol{\mathcal{R}}\left(s\right)$$ is the trajectory of your wire, parametrized by arc-length $$s$$. Assuming $$\boldsymbol{\mathcal{\dot{R}}}.\boldsymbol{\mathcal{\dot{R}}}=\mathcal{\dot{R}}^2=const$$

Value of $$\alpha$$ follows from:

$$\int_S{d^2}r\: \mathbf{\hat{n}}.\mathbf{J}=I\Delta\left(s\in S\right)\cos\theta_\mathcal{\dot{R}}=\alpha\mathcal{\dot{R}}^2\,\Delta\left(s\in S\right)$$

Where the integral above is over the surface area $$S$$ of the dot-product of the current density with the surface normal $$\mathcal{\hat{n}}$$. Quantity $$\Delta\left(s\in S\right)=1$$ is the wire only goes through the surface area $$S$$ once. $$\cos\theta_{\mathcal{\dot{R}}}$$ is the cosine of the angle between the wire and the surface normal. $$I$$ is the current in the wire. Equation above only makes sense if wire goes through $$S$$ once or not at all.

From this you can then extract the charge density by taking divergence. I think, you will find that once you take divergence the derivative (of the divergence) and the integral ($$\int ds'$$) will cancel out, and you will get zero charge density for closed-loop wires

Lets see how certain integrals/derivatives will transform

Let us restrict our attention to a region, $$\left(x,y,z\right)\in\Omega$$ and $$s\in\left(s_0,s_1\right)$$, where $$z$$ has a one-to-one relationship with arc-length $$s$$. More specifically, $$\mathcal{R}_z\left(s\right)$$ gives the z-coordinate of the arc at all points. Within the region we are considering, let $$\mathcal{R}_z^{-1}\left(z\right)$$ be defined.

Irrespective of where $$z$$ is the component of the arc-tangent (of the wire) in the direction of $$z$$ is:

$$\frac{d\mathcal{R}_z}{ds}=\mathbf{\hat{z}}.\frac{d\boldsymbol{\mathcal{R}}}{ds}=\mathbf{\hat{z}}.\boldsymbol{\dot{\mathcal{R}}}$$

Next note that within $$\Omega$$ for any function $$f=f\left(x,y,z\right)$$:

\begin{align} \int^b_a dz\, f\left(x,y,z\right)&=\int^{\mathcal{R}_z^{-1}\left(b\right)}_{\mathcal{R}_z^{-1}\left(a\right)} \frac{dz}{ds} ds f\left(x,y,\mathcal{R}_z\left(s\right)\right)=\int^{\mathcal{R}_z^{-1}\left(b\right)}_{\mathcal{R}_z^{-1}\left(a\right)} \frac{d\mathcal{R}_z}{ds} ds f\left(x,y,\mathcal{R}_z\left(s\right)\right)\\ &=\mathbf{\hat{z}}.\int^{\mathcal{R}_z^{-1}\left(b\right)}_{\mathcal{R}_z^{-1}\left(a\right)} \boldsymbol{\mathcal{\dot{R}}} f\left(x,y,\mathcal{R}_z\left(s\right)\right)ds \end{align}

Where I simply replaced the integration variable $$z\to s$$ where $$z=\mathcal{R}_z\left(s\right)$$. The same trick will work in volume integrals within $$\Omega$$. The the transform would be:

\begin{align} x &\to x \\ y&\to y \\ z &\to s \\ \end{align}

With the Jacobian $$\left|\frac{\partial\left(x,y,z\right)}{\partial\left(x,y,s\right)}\right|=\mathbf{\hat{z}}.\boldsymbol{\mathcal{\dot{R}}}$$

It then follows that (within $$\Omega$$):

\begin{align} \mathbf{\hat{z}}.\mathbf{J}\left(\mathbf{r}\right)&=\alpha\mathbf{\hat{z}}.\int ds'\: \boldsymbol{\mathcal{\dot{R}}}\left(s'\right)\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s'\right)\right)=\alpha\int dz'\: \delta^{\left(3\right)}\left(\left(\begin{array}\\x\\y\\z\end{array}\right)-\left(\begin{array}\\\mathcal{R}_x\left(\mathcal{R}_z^{-1}\left(z'\right)\right)\\\mathcal{R}_y\left(\mathcal{R}_z^{-1}\left(z'\right)\right)\\z'\end{array}\right)\right)=\\ &=\alpha \:\delta\left(x-\mathcal{R}_x\left(\mathcal{R}_z^{-1}\left(z\right)\right)\right)\:\delta\left(y-\mathcal{R}_y\left(\mathcal{R}_z^{-1}\left(z\right)\right)\right) \end{align}

From here it should be relatively easy to derive:

$$\int_{x_0}^{x_1} dx \int_{y_0}^{y_1} dy \int_{-l/2}^{l/2} dz\: \mathbf{\hat{z}}.\mathbf{J}\left(\mathbf{r}\right)=l\,\alpha$$

Assuming that $$\left(x_0,\,x_1\right)\times\left(y_0,y_1\right)\times\left(-l/2,l/2\right)$$ contain the wire and are within $$\Omega$$. I think this is what you were after.

Another interesting thing to try is:

\begin{align} \boldsymbol{\nabla}.\mathbf{J}&=\int^{s_b}_{s_a} ds'\: \boldsymbol{\mathcal{\dot{R}}}\left(s'\right).\boldsymbol{\nabla}\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s'\right)\right)=\int^{s_b}_{s_a} ds'\: \frac{d\boldsymbol{\mathcal{R}}}{ds'}.\boldsymbol{\nabla}\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s'\right)\right) \\ &=-\int^{s_b}_{s_a} ds'\: \frac{d}{ds'}.\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s'\right)\right)=\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s_a\right)\right)-\delta^{\left(3\right)}\left(\mathbf{r}-\boldsymbol{\mathcal{R}}\left(s_b\right)\right) \end{align}

Clearly, if $$s_a=s_b$$ as would be in the case of a closed loop, the divergence of the current density would vanish.

• what is the name of the current density function you have wrote , can you give me a link to more information about it Nov 10 '21 at 14:17
• Not sure it has a name, simply current density that makes sense. You want to be in 3d, but you want your current density to give finite result when integrated over area, this is like 2d delta function. How would you convert 3d delta function to 2d? Integrate it along a curve. Roughly along these lines. Similar treatments appear when discussing four-current of a charged particle in special relativity. Can give references for those books
– Cryo
Nov 10 '21 at 21:06
• I've accepted your answer as I understand what that integral represents. I haven't actually used parameterization via arc length, so I changed it to dt and the r'(s') is replaced by r'(t)/|r'(t)| ? as that's a unit parralel vectors to dl. However my main point of concern is how the volume integral of this reduces to" I dl" like so many books use ( they replace J(r') d^3r' with Idl) as the integral d^3 r' in my head is simply dx' dy' dz' where r = x'i+y'j+z'k so I have no idea how to convert this into a form where it is dl, l Nov 10 '21 at 23:02
• it is tempting to say (d^3r') dv = dA dl where da is the the surface in the wire. are da dl equivalent to dv where I define my dl and da properly? Nov 10 '21 at 23:04
• @jensen paull. Firstly, please use latex for maths, including comments. I have added more detail hopefully it covers it, if not please provide more expanded explanation of the issue
– Cryo
Nov 11 '21 at 22:20

Proof that the integral over all of space of Jdv when J is a current density function that represents an infinitely thin wire is equal to integral I dl where dl is the vector path element of the wire

• note this only works as my bounds are infinity as each dirac integral is 0 if either x,y,y don't match x(s),y(s),z(s) but because I'm integrating about -infinity and +infinity, for any value of s, the integral is one Nov 12 '21 at 1:50
• and in my answer, the r' Shouldve been the unit vector r' divided by the magnitude if r', And I Shouldve been "a" Where a/abs r' is I Dec 13 '21 at 23:49