We start by looking at a derivation of the given formula for $\delta(f(x))$ in one dimension:
Let $I$, $J$ be intervals on $\mathbb R$ and assume that $f : I \to J$ is differentiable and invertible. If $0 \in J$ we then formally have
$$
\int_I \delta(f(x)) \, \phi(x) \, dx
= \{ x = f^{-1}(y) \}
= \int_J \delta(y) \, \phi(f^{-1}(y)) \, \frac{dy}{|f'(f^{-1}(y))|} \\
= \phi(f^{-1}(0)) \, \frac{1}{|f'(f^{-1}(0))|}
= \phi(x_0) \, \frac{1}{|f'(x_0)|} \\
$$
where $x_0 = f^{-1}(0)$ is the zero of $f$.
Generally, if $f : \mathbb R \to \mathbb R$ is differentiable and have isolated zeros so that we can take intervals $I_n$ containing only one zero each, say $x_n$, then we get
$$
\int_{-\infty}^{\infty} \delta(f)(x)) \, \phi(x) \, dx
= \sum_n \int_{I_n} \delta((f|I_n)(x)) \, \phi(x) \, dx
= \sum_n \phi(x_n) \frac{1}{|f'(x_n)|} \\
= \sum_n \int_{-\infty}^{\infty} \frac{1}{|f'(x_n)|} \delta(x-x_n) \, \phi(x) \, dx
= \int_{-\infty}^{\infty} \sum_n \frac{1}{|f'(x_n)|} \delta(x-x_n) \, \phi(x) \, dx.
$$
Since this is valid for any "nice" $\phi$ we have
$$\delta(f(x)) = \sum_n \frac{1}{|f'(x_n)|} \delta(x-x_n).$$
Now we instead consider $\delta'(f(x))$, still in one dimension:
Here we need to know that
$$\int_{-\infty}^{\infty} \delta'(t) \, g(t) \, dt = -g'(0)$$
In this case the first calculation becomes
$$\begin{align}
\int_I \delta'(f(x)) \, \phi(x) \, dx
& = \left. -\frac{d}{dy} \left( \phi(f^{-1}(y)) \, \frac{1}{|f'(f^{-1}(y))|} \right) \right|_{y=0} \\
& = \left. - \left( \phi'(f^{-1}(y)) \frac{1}{f'(f^{-1}(y))} \cdot \frac{1}{|f'(f^{-1}(y))|} + \phi(f^{-1}(y)) \cdot \frac{-f''(f^{-1}(y))}{|f'(f^{-1}(y))|^3} \right) \right|_{y=0} \\
& = - \left( \phi'(x_0) \frac{1}{f'(x_0)} \cdot \frac{1}{|f'(x_0)|} + \phi(x_0) \cdot \frac{-f''(x_0)}{|f'(x_0)|^3} \right) \\
& = \frac{f''(x_0)}{|f'(x_0)|^3} \phi(x_0) - \frac{f'(x_0)}{|f'(x_0)|^3} \phi'(x_0)
\end{align}$$
Therefore our final formula becomes
$$\delta'(f(x)) = \sum_n \frac{f''(x_n) \delta(x-x_n) + f'(x_n) \delta'(x-x_n)}{|f'(x_n)|^3}$$