Dirac writes down the following formula on page 61 of his "Principles of quantum mechanics": $\frac{d}{dx}\log x = \frac{1}{x} i\pi\delta(x)$, see http://adsabs.harvard.edu/abs/1947pqm..book.....D for the exact reference (but no text). What is the best way of formalizing this to a mathematician's satisfaction?

In integral form, this amounts to the SokhotskiPlemelj theorem: $\lim_{\epsilon\rightarrow 0^{+}}\int_{\infty}^{\infty}dx f(x) \frac{d}{dx}\log (x+i\epsilon)=i\pi f(0)+{\cal P}\int_{\infty}^{\infty}dx f(x)\frac{1}{x}$. The symbol ${\cal P}$ indicates that the Cauchy principal value of the integral is to be taken. Formalization then amounts to stating the conditions on $f$ so that the principal value integral exists. The logarithm for $x<0$ is defined as $\log x= \log(x) + i\pi$. You can avoid the delta function by including the absolute value signs in the logarithm: $\int_{\infty}^{\infty}dx f(x) \frac{d}{dx}\logx={\cal P}\int_{\infty}^{\infty}dx f(x)\frac{1}{x}$. 


Questions about distributions, usually involving the $\delta$ distribution ("function"), are of frequent occurrence on this and related sites. Since they are often treated in a rather cavalier fashion, I would like to attempt to answer this query in some detail. The basic problem lies in the interpretation of the functions $\frac 1 x$ and $\log x$ (notabene not $\log x $) as distributions. As a preliminary remark, it is not surprising that theoretical physicists are guided by their physical intuition and not by mathematical rigour in dealing with such questions and it is perfectly acceptable for mathematicians to proceed in the same way in formulating such conjectures. However, since this is a mathematical forum, one does have the right to expect that the final formulation of the solution conforms to the usual standards of mathematical rigour (as is implied in the OP). In fact it is rather disquieting that this is often not the case, since this task can be achieved by elementary methods which have been on record in the primary and secondary literature for at least 50 years. For the example in question (and, indeed, for most of the examples in such forums), one need only be cognisant of the following simple facts about distributions. $1$. Every continuous function on the reals, better, every locally integrable function, determines in a natural way a distribution. $2$. There is a notion of convergence for distributions. For our purposes, it suffices to know that if a sequence of continuous functions converges uniformly on compacts, then it converges in the sense of distributions. In fact, local $L^1$ convergence suffices. $3$. The dream theorem of every freshman calculus student holdsif a sequence of distributions converges, then the sequence obtained by differentiating term by term also converges. We can now turn to the above query. Note that the problem lies in the fact that while the function $\log x$, being locally integrable, determines a distribution, the same is not true a priori for $\frac 1 x$ and $\log x $. In these two cases, we have to proceed in a more delicate manner. Firstly, note that the function $\log x$ is locally integrable and so is a distribution. More importantly the same is true for its derivative in the distributional sense. It is then rather natural to define this derivative to be the distribution $\frac 1 x$. The case of the distribution $\log x$ is rather more subtle. In this case we resort to the complex logarithm. y thus we define, for nonzero $\epsilon $, the distribution $\log(x+i\epsilon)$ to be $\logx+i \arctan \frac \epsilon x$ (i.e., we are using the principal branch of the complex logarithm). We now define the distribution $\log x $ to be the limit of this distribution as $\epsilon$ tends to zero. At this point, we see that we get different values, depending on whether we consider the limit $\epsilon \to 0_+$ or $\epsilon \to 0_$. If we now differentiate this equation we obtain the required formula. To conclude, a few remarks. The above approach is due to the portuguese mathematician J. Sebastião e Silva who developed it in the context of his axiomatic approach to the theory of distributions. The above is a special case of the family of distributions $x^\lambda$ for general $\lambda$ (even complex) which is developed in detail in the above reference. They are also described in the standard four volume text of Gelfand and Silov. The distribution $\frac 1 x$ is also treated by Laurent Schwartz who used the Hadamard principal value (the latter was his great uncle by marriage). The connection with the above approach can easily be established by considering the truncated function $\log_\epsilon$ (which is set equal to zero on the interval $]\epsilon,\epsilon[$), letting $\epsilon$ tend to zero and differentiating. The ambiguity in the definition of the distribution $\log x$ is no more disconcerting than that in the definition of the logarithm function for complex arguments. In a more sophisticated approach this distribution would not be defined on the real line but on the natural domain of definition of the latter, i.e., on the unversal covering of the punctured plane. 


$$ \lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}\frac{d\ln x}{dx} dx = \lim_{\epsilon \rightarrow0}[\ln \epsilon\ln(\epsilon)] \\ \ln(\epsilon)= \ln\epsilon+ i\Theta \\ $$ choose the principle value for the angle$$ \Theta=\theta= \pi \\ \lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}d\ln x = \lim_{\epsilon \rightarrow0}[\ln \epsilon\ln(\epsilon)] =\lim_{\epsilon \rightarrow0}[\ln \epsilon\ln(\epsilon)i\pi]=i\pi $$ $$\lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}\frac{1}{x}dx =0$$ Because 1/x is a odd function, thus its integral vanished. The left hand side equals to $i\pi$, thus we need add $i\pi$ to the right hand side. Above all, we can obtain $$ \lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}\frac{d\ln x}{dx} dx = \lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}\frac{1}{x}dx i\pi= \lim_{\epsilon \rightarrow0} \int_{\epsilon}^{+\epsilon}\frac{1}{x} i\pi\delta(x)\ dx$$ According to the inside parts of integrals, we finally got $$ \frac{d\ln x}{dx} =\frac{1}{x} i\pi\delta(x) $$ 


The question is not meaningful since $\ln x$ is not defined for $x\le 0$. You may define, with derivatives in the distribution sense $$ f(x)=\ln\vert x\vert\text{ (even)},\quad f'(x)=pv\frac1{x} \text{ (odd, homogeneous degree 1)} $$ $$ g(x)=\ln(x+i0)=\lim_{\epsilon\rightarrow 0_+}\ln(x+i\epsilon),\quad g'(x)=\frac{1}{x+i0}= pv\frac1{x}i\pi \delta, \text{(homogeneous degree 1)} $$ where the latter formula follows from $$ \ln(z)=\oint_{[1,z]}\frac{d\xi}{\xi},\quad z\in \mathbb C\backslash \mathbb R_. $$ By analytic continuation we have (for $z\in \mathbb C\backslash \mathbb R_$) $e^{\ln z}=z$ and with $H=\mathbf 1_{\mathbb R_+}$ $$ \ln(x+i0)=\ln\vert x\vert +i\pi H(x)\Longrightarrow g'(x)=\frac{1}{x+i0}= pv\frac1{x}i\pi \delta. $$ Taking the complex conjugate of $g$ gives you the definition of $\frac{1}{xi0}$. 

