Deriving the Lienard-Wiechert Potentials Let $\mathbf{w}(t)$ be the trajectory of a moving charge. Let the observation event be $(\mathbf{r},t)$.
The scalar potential is:
$$\varphi = \frac{q}{4\pi\epsilon_0}\int \frac{\delta\left(\mathbf{r'} - \mathbf{w}\left(t - \frac{|\mathbf{r} - \mathbf{r'}|}{c}\right)\right)}{|\mathbf{r'}-\mathbf{r}|} \mathrm d^3\mathbf{r'}$$
It can be shown that at most only ONE event on the trajectory of the charge produces the potential at the observation event. This is the event $(\mathbf{w}(t_r),t_r)$, where $t_r$ is such that $|\mathbf{r}-\mathbf{w}(t_r)| = c(t-t_r)$. 
Because the delta function is 0 apart from at one point, it seems to make sense that $\mathbf{w}(t_r)$ must be the point that it picks out. Is it then legitimate to write the scalar potential as:
$$\varphi = \frac{q}{4\pi\epsilon_0|\mathbf{r} - \mathbf{w}(t_r)|}\int \delta\left(\mathbf{r'} - \mathbf{w}\left(t - \frac{|\mathbf{r} - \mathbf{r'}|}{c}\right)\right) \mathrm d^3\mathbf{r'}\;?$$
If not, why not? And what is the best way to calculate the remaining delta function integral?
 A: The general rule (see the "Composition with a function" section of the Wikipedia article on Dirac delta functions) is (for suitably well-defined functions):
\begin{equation*}
\int_{-\infty}^\infty {\mathrm dx \, f(x)\,  \delta(g(x))} = \sum_i {\frac{f(x_i)}{|g'(x_i)|} }
\end{equation*}
where $x_i$ are the roots of $g(x)$, so your "extraction" is justified.
One way to apply this result to the 3-dimensional delta function is to choose the axes so that 1) the particle is moving along the $x$-axis with velocity $v$ at time $t_r$ (e.g. $\boldsymbol{w}(t)=(a+vt,0,0)$ near time $t_r$), and 2) the observation point is at $\boldsymbol{r}=(0,y,0)$.  Then:
\begin{align*}
\int {\mathrm dx' \,\mathrm dy' \, \mathrm dz' \, \delta^3} &= \int {\mathrm dx' \, \mathrm dy' \, \mathrm dz' \, \delta \left(x' - a - v(t-|\boldsymbol{r-r'}|/c)\right)\, \delta(y')\, \delta(z')} \\
   &= \int {\mathrm dx' \, \mathrm dy' \, \mathrm dz' \, \delta \left(x' - a - vt + (v/c) \sqrt{x'^2 + (y-y')^2 + z'^2} \right) \,\, \delta(y') \, \delta(z')} \\
   &= \int {\mathrm dx' \, \delta \left(x' - a - vt + (v/c) \sqrt{x'^2 + y^2} \right)} \\
   &= \int {\mathrm dx' \, \frac{\delta \left(x'- (a+vt_r)\right)}{1+\frac{v}{c}\frac{x'}{\sqrt{x'^2+y^2}}}} \\
   &= \frac{1}{1-\boldsymbol{\beta \cdot n}}
\end{align*}
where $\boldsymbol{\beta}=\boldsymbol{v}/c$ and $\boldsymbol{n}$ is the unit vector $\boldsymbol{n}= \frac{\boldsymbol{r-w}}{|\boldsymbol{r-w}|}$, evaluated at time $t_r$.
