In the literature on point particles in 2+1 gravity, I often see the identity
$$d^2 \phi = 2\pi \delta^{(2)}(r)dx\wedge dy$$
being used. Here, the particle is a puncture located at the origin and $(r,\phi)$ are polar coordinates around this puncture.
One example is in this paper (unfortunately it's behind a paywall), where in equation 3.4 the author uses the above identity to show that the torsion and curvature are both described by delta distributions. For example, for the curvature, since the connection is given in equation 3.3b by $\omega=M d\phi$, the curvature is
$$F=d\omega=Md^2\phi=2\pi M \delta^{(2)}(r)dx\wedge dy.$$
Other papers seem to be using this result as well, and cite the above paper. One example is this paper, equations 4.6-4.7.
I know that $d^2$ is supposed to be always zero because the partial derivatives commute, so this has to fail somehow for the identity to be satisfied, but I don't know how that would happen in this case.
$d^2$ vanishes because mixed partial derivatives commute, which happens for $C^2$ functions; functions whose second derivative exists and is continuous. $\phi=\tan^{-1}(y/x)$ is not even continuously defined on an arbitrarily small neighborhood of the origin.
So let's compute $d^2\phi$ and see whether it equals $2\pi\delta(r)\,dx\wedge dy,$ defined to be the form satisfying $\int f(x,y)\delta(r)\,dx\wedge dy = f(0).$
Away from the origin, for the first derivative, we have $$d\phi=d(\tan^{-1}(y/x))= \frac{1}{1+(y/x)^2}d(y/x)=\frac{x\,dy-y\,dx}{x^2+y^2}. $$
We could then compute for the second derivative and get
$$ d^2\phi=d \left(\frac{x\,dy-y\,dx}{x^2+y^2}\right)=\frac{-2x^2-2y^2}{(x^2+y^2)^2}\,dx\wedge dy+\frac{2}{x^2+y^2}\, dx\wedge dy=0. $$
So it does vanish away from the singularity at the origin. But we're interested on its behavior on a domain that does include the origin. Let's remember how derivatives are defined for distributions: weakly, via integration by parts.
So how do we also see that it satisfies the integral identity $\int f(x,y)\,d^2\phi=f(0)?$ Well lets take $f$ to be a sufficiently well-behaved test-function, say a smooth function of compact support.
And then to compute $\int f(x,y)\,d^2\phi,$ we'll use integration by parts. If $d\phi$ were a smooth form, we would have its exterior derivative as $d(f(x,y)\,d\phi)=df\wedge d\phi+f\,d^2\phi,$ and then $$\int f\,d^2\phi=-\int df\wedge d\phi$$ (since $f$ has compact support, the term $\int d(f(x,y)\,d\phi)$ vanishes by Stokes' theorem). Instead since $d\phi$ is known not to be differentiable, we define $d^2\phi$ to be the form satisfying the above equation. This bit of sleight of hand is known as the weak derivative in distribution theory.
Then
$$ \int df\wedge d\phi=\int\left(\frac{\partial f}{\partial r}dr+\frac{\partial f}{\partial \phi}d\phi\right)\wedge d\phi=\int\frac{\partial f}{\partial r}dr\wedge d\phi=-2\pi f(0). $$
Thus we have concluded that $\int f d^2\phi=2\pi f(0).$ Thus $d^2\phi=2\pi\delta(r),$ which was to be proved.
Note that this conclusion could also be reached avoiding distribution language, if we allow to work on a domain that excises the origin. That's the standard method of proof of the Cauchy integral formula. Or if we work with holomorphic functions, we can just invoke the Cauchy integral equation itself. It is related to a question I askedrecently.