# Dipole term in multipole expansion

Hi.
I'm having some difficult in understanding something about the dipole term in a multipole expansion. Griffiths writes the expansion as a sum of terms in Legendre polynomials, so the dipole term in the potential is writen

$\frac{1}{4 \pi \epsilon r^{2}}\int r^{'}cos\theta^{'}\rho dv^{'}$

Then, by defining

$\vec{p}=\int \vec{r}^{'}\rho dv^{'}$

he writes

$V=\frac{1}{4 \pi \epsilon}\frac{\vec{p}\cdot\hat{r}}{r^{2}}$

I understood how thats done. My problem is: using the dipole moment vector and doing the scalar product it will usually appear the cossine of an angle in the potential, but it will never appear using the first definition , that is, calculating directly the integral. Maybe I understood something wrong but I cant figure out what. Hope someone helps me. Thanks.