Triple integral $\iiint_{\mathbb{R}^3} d^{3}q ~\delta^{3}(\vec{q})\frac{(\vec{p}\cdot\vec{q})^2}{q^{2}} $ involving Dirac Delta function 
I am trying find $$\iiint_{\mathbb{R}^3} d^{3}q ~\delta^{3}(\vec{q})\frac{(\vec{p}\cdot\vec{q})^2}{q^{2}},$$ where $\vec{p}$ is some fixed vector. 

The answer should be $\frac{p^2}{3}$. Below is my attempt, which seems to lead to the wrong answer $\frac{p^2}{2}$.
Attempt: Let's align $q_{z}$ with $\vec{p}$, so we measure $\theta$ wrt $\vec{p}$. Since there is no $\phi$ dependence so I can write $$\delta^{3}(\vec{q})=\frac{\delta(q)\delta(\theta)}{2\pi q^{2}\sin(\theta)}.$$ 
Therefore I have 
$$p^{2}\int_{0}^{\infty} dq \delta(q)\hspace{1mm}\int_{-\pi}^{\pi}d\theta\hspace{1mm} \delta(\theta)\cos^2\theta .$$ 
I understand $$\int_{0}^{\infty}\delta(q)dq = \frac{1}{2},$$ if we treat $\delta(q)$ as a limiting case of a symmetric Gaussian distribution. While the $\theta$ integral is $1$. So my answer to my question is $\frac{p^2}{2}$. Which is different from the correct answer $\frac{p^2}{3}$.
So my questions are: 


*

*What went wrong in my derivation?

*How do you derive and justify the answer $\frac{p^2}{3}$ from first principles?
 A: Hints:


*

*In mathematics, a distribution is usually only defined wrt. smooth testfunctions. However the function ${\bf q}\mapsto({\bf q}\cdot{\bf p})^2/q^2$ is not continuous at the origin ${\bf q}={\bf 0}$. Nevertheless, we can e.g. try to evaluate the triple integral using the following representation of the 3D Dirac delta distribution
$$\tag{1} \delta^3({\bf q})~=~ \lim_{\varepsilon\to 0^+} \frac{1}{4\pi} \frac{3\varepsilon}{(q^2+\varepsilon)^{\frac{5}{2}}}, \qquad q~:=~|{\bf q}|,$$
where it is implicitly understood that the limit $\lim_{\varepsilon\to 0^+}$ should be taken after the triple integration.

*For given $\varepsilon>0$, the integrand is integrable on $\mathbb{R}^3$. And it is bounded at the origin ${\bf q}={\bf 0}$, so we can use spherical coordinates. As OP mentions, in spherical coordinates with ${\bf p}$ along the $z$-axis, we have 
$$\tag{2}\frac{({\bf q}\cdot{\bf p})^2}{q^2}~=~p^2\cos^2\theta.$$

*Substitute $q\to \sqrt{\varepsilon}q$ in the triple integral. The $\varepsilon$-dependence disappears. Perform the triple integral.
A: $$δ^3(q⃗ )=\frac{δ(q)δ(\theta)}{2\pi q^2\sin(\theta)}$$ 
is wrong. The delta function is spherically symmetric, and thus has no θ dependence. Simply use: $$d^3(q⃗ )=\frac{δ(q)}{2\pi q^2}$$ instead. Use the Jacobian when you switch coordinate systems (from Cartesian to spherical) ($r^2 \sin(\theta)$), and you should get the result.
