Conventionally one define electric energy as $$ U = \frac{1}{2} \int \vec{E}(r') \cdot \vec{E}(r') d^3 x' $$ where $\vec{E}$ is a Electric field.
And from textbook like Griffith, we know that electric field generated by dipole is given as $$ \vec{E}_{dipole}(r) = \frac{1}{4\pi} \frac{1}{r^3}(3 (\vec{p} \cdot \hat{r}) \hat{r} - \vec{p} ) $$ I am trying to plug this and obtain explicit formula for electric energy $U$.
I think the result should be on some textbook or papers but I couldn't find.
Do you know the formula?
The purpose of this question is actually to compute the $U$ with $\vec{E}$.
My trial was
$$ U = \frac{1}{2} \frac{1}{16 \pi^2} \int \frac{1}{r^6} \left( 3 (\vec{p}\cdot \hat{r})^2 - \vec{p}\cdot\vec{p} \right) r^2 dr\sin(\theta) d\theta d\varphi$$
$$ = - \frac{1}{32\pi r^3} \int_{0}^{\pi} \left( 3 (\vec{p} \cdot \hat{r})^2 - (\vec{p}\cdot \vec{p}) \right) \sin(\theta) d\theta $$