# Derivatives of Dirac delta function and equation of continuity for a single charge

For a single charge $e$ with position vector $\textbf R$, the charge density $\rho$ and and current density $\textbf{j}$ are given by:

$$\rho(\textbf{r},t)= e\,\delta^3(r-\textbf{R}(t)),$$

$$\textbf{j}(\textbf{r},t)=e\frac{d\textbf{R}}{dt}\delta^3(\textbf{r}-\textbf{R}(t)).$$

Suppose we want to check the equation of continuity

$$\frac{\partial \rho}{\partial t}+\nabla \cdot\textbf{j}=0 .$$

How to do it? How to deal with the derivatives of a delta function?

It is almost no trouble to generalize to a finite number of point charges $q_i$ at positions ${\bf r}_i(t)$. Then the charge density is

$$\rho({\bf r},t)~ =~ \sum_i q_i \delta^3({\bf r}-{\bf r}_i(t)),$$

and the current density

$${\bf j}({\bf r},t)~ =~ \sum_i q_i \dot{\bf r}_i(t)\delta^3({\bf r}-{\bf r}_i(t)).$$

For clarity let us write ${\bf \nabla}\equiv\frac{\partial}{\partial {\bf r}}.$ The chain rule then yields the continuity equation

$$-\frac{\partial \rho({\bf r},t)}{\partial t} ~=~ -\sum_i q_i \frac{\partial }{\partial t}\delta^3({\bf r}-{\bf r}_i(t)) ~=~ \sum_i q_i \dot{\bf r}_i(t)\cdot \frac{\partial }{\partial {\bf r}}\delta^3({\bf r}-{\bf r}_i(t))$$ $$~=~ \frac{\partial }{\partial {\bf r}} \cdot \sum_i q_i \dot{\bf r}_i(t)\delta^3({\bf r}-{\bf r}_i(t))~=~\frac{\partial }{\partial {\bf r}} \cdot {\bf j}({\bf r},t).$$

The same calculation can be repeated more carefully with the help of test functions.

You're no longer dealing with real-valued functions on $\mathbb R^4$, but with distributions, and you need to evaluate expressions by integrating over a test function $\varphi$:

\begin{align*} &\int_{\mathbb R^4}\left(\frac{\partial\rho}{\partial t}(\mathbf r,t) + \nabla\cdot\mathbf j(\mathbf r,t)\right)\varphi(\mathbf r,t)\;\mathrm d(\mathbf r,t) \\= &\int_{\mathbb R^4}\left(e\frac\partial{\partial t}\delta(\mathbf r - \mathbf R(t))\varphi(\mathrm r,t) + \sum_{i=1}^3e\dot R_i(t)\frac\partial{\partial x^i}\delta(\mathbf r - \mathbf R(t))\varphi(\mathrm r,t)\right)\;\mathrm d(\mathbf r,t) \\=&\int_{\mathbb R^4}\left(-e\delta(\mathbf r - \mathbf R(t))\frac{\partial\varphi}{\partial t}(\mathbf r,t)-\sum_{i=1}^3e\dot R_i(t)\delta(\mathbf r - \mathbf R(t))\frac{\partial\varphi}{\partial x^i}(\mathbf r,t)\right)\;\mathrm d(\mathbf r,t) \\=&\int_\mathbb R\left(-e\frac{\partial\varphi}{\partial t}(\mathbf R(t),t)-\sum_{i=1}^3e\dot R_i(t)\frac{\partial\varphi}{\partial x^i}(\mathbf R(t),t)\right)\;\mathrm dt \\=&\int_\mathbb R -e\frac{\mathrm d}{\mathrm dt}\varphi(\mathbf R(t),t)\;\mathrm dt \\=&\left[-e\varphi(\mathbf R(t),t)\right]^\infty_{t=-\infty} \\=&0 \end{align*}

The second equality looks like integration by parts as $\varphi$ has compact support (ie in particular vanishes at infinity), but is actually the definition of the derivative of a distribution.