Charge density of Hertzian dipole I am wanting to find the charge density of an infinitely thin Hertzian dipole, but am struggling evaluating the Dirac delta functions gradient.
$$\vec{J} = I_{0}\cos(\omega t) \delta^3(r) \hat k.$$
Using: $\nabla \cdot \vec{J} = -\frac{\partial \rho}{\partial t}$
We know $\nabla \cdot ({\phi \vec{v}}) = \phi \nabla \cdot \vec{v} + \nabla \phi \cdot \vec{v}.$
Which reduces to $\nabla \phi \cdot \vec{v}.$
Which ultimately means
$$\nabla \cdot \vec{J} = I_{0}\cos(\omega t) \delta(x) \delta(y) \frac{\partial}{\partial z} \delta(z).$$
Beyond this point I am not really sure if what I'm doing is really correct
By definition  $lim z -> 0$
$$\delta (z) = \frac{1}{|a|\sqrt{\pi}}e^{-(\frac{z}{a})^2}.$$
So $\frac{\partial}{\partial z} \delta(z) = \frac{1}{|a|\sqrt{\pi}}e^{-(\frac{z}{a})^2} \cdot -2(\frac{z}{a}) \cdot \frac{1}{a}$
= $\delta(z) \cdot -2(\frac{z}{a^2}) $
So,
$$\nabla \cdot \vec{J} = I_{0}\cos(\omega t) \delta(x) \delta(y) \delta(z) \cdot -2(\frac{z}{a^2})  $$
$$\nabla \cdot \vec{J} = I_{0}\cos(\omega t) \delta^3(r) \cdot -2(\frac{z}{a^2}).$$
Integrating gets:
$$\rho = I_{0}\sin(\omega t) \delta^3(r) \cdot 2(\frac{z}{a^2 \omega}).$$
So, plugging this expression into math lab and taking the limit yields an infinite charge density,
I would assume that if I integrate it, it yields a finite charge, but I haven't really been able to find anything on getting the charge density from the current density online, so I would appreciate it if anyone could tell me any mistakes that I've made? and if not, help me re write this in a form  such  that I am able to prove that it's integral is finite.
(Here $I_{0}$ is not current, and is some finite value)
 A: Yes your derivation is correct, and it’s normal to get an infinite charge density. Actually, you’ll recognize the charge density of an ideal dipole so the integrated charge is exactly $0$, which can also be seen as recognizing the density as the divergence of a polarization.
If you’re manipulating distributions with the Dirac delta, might as well go all the way. You are allowed to take its derivative.
I’ll wrap up by going off on a tangent to link your $I_0$ to physical values. Since you’re describing a dipole, it’s best to start from the charge density that you know. You have a dipole moment $p$ so can write your density distribution:
$$
\rho=-p\cdot \nabla \delta ^{3}(r)
$$
You can write express as a divergence using your derivation. Hence, integration over space gives you $0$.
Using the reverse reasoning, you get:
$$
j=\dot p \delta ^{3}(r)
$$
So in the ideal limit, writing $p=qd$ (charge times distance) and identifying $I=\dot q$ (current), you’ll get:
$$
j=Id \delta ^{3}(r)
$$
In general, the current diverges in the ideal limit even if the dipole moment does not, so the latter is mathematically more convenient. Note that you can do similar considerations, this time assuming a varying magnetic moment (in which case the charge density is null).
Hope this helps and tell me if you need more details.
A: Your formulas are essentially correct.
The current density and charge density
$$\begin{align}
\vec{J}&=I_0 \cos(\omega t)\delta(x)\delta(y)\delta(z)\hat{z} \\
\rho&=-\frac{I_0}{\omega}\sin(\omega t)\delta(x)\delta(y)\frac{\partial\delta(z)}{\partial z}
\end{align}$$
together satisfy charge conservation
$\vec{\nabla}\vec{J}=-\frac{\partial\rho}{\partial t}$.
In the $\vec{J}$ and $\rho$ above you may well use the $\delta$ representation
$$\delta(z)=\lim_{a\to 0}\frac{1}{|a|\sqrt{\pi}}e^{-z^2/a^2}$$
and its derivative
$$\frac{\partial\delta(z)}{\partial z}=
  \lim_{a\to 0}\frac{-2z}{|a|a^2\sqrt{\pi}}e^{-z^2/a^2}$$
The fact that $\rho$ near the center becomes infinite for $a\to 0$ was to
be expected, because an idealized "point-like" dipole is made up by two
opposite infinitely big charges separated by an infinitesimal small distance.
In your case you have two charges $\pm\frac{I_0}{\omega a}\sin(\omega t)$
located at $(x,y,z)=(0,0\pm a)$ (I have deliberately neglected any
factors of $2$ or $\sqrt 2$),
thus giving a dipole moment of $\frac{I_0}{\omega}\sin(\omega t)$.
You can also verify that the total charge
$Q=\iiint\rho\ d^3r$ is zero as it should be.
