Which symmetry for which distance function For evaluating the electric field of some charge distribution one can use $$\phi(r):= \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(r')}{||r-r'||_2} dr'.$$
My question is: What symmetry do we need to have that we can write in spherical coordinates $$||r-r'||_2 = \sqrt{||r||_2^2+||r'||_2^2-2||r||_2||r'||_2\cos(\theta')}~?$$ 
This is of course not the most general way to express this distance, as the $\phi$ dependence is missing. So, under what conditions can the distance be expressed like this? 
Notice that $\theta'$ is the respective angle in spherical coordinates, so it's NOT the angle between $r$ and $r'$.
So in particular, your answer should clarify, why we can evaluate for example the electric potential of a sphere by integrating: $$\frac{1}{4 \pi \varepsilon_0} \int_0^{2\pi}\int_0^\pi \int_0^{\infty}  \frac{\rho(r')||r'^2|| sin(\theta')}{\sqrt{||r||_2^2+||r'||_2^2-2||r||_2||r'||_2\cos(\theta')}}d||r'||_2 d\theta'd\phi',$$ but need to refer to a more general equation in this example, where the $\phi$ angle is used too: excercise 14b)
 A: The answer is that $\rho$ must be  spherically symmetric (necessary and sufficient condition).
To show it, let me change notation. Now $r$ ad $r'$ are the absolute values of the vectors $\vec{r}$,$\vec{r'}$ and we know that
$$\phi(\vec{r}):= \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{r}-\vec{r'}||_2} dr'.\tag{0}$$
where  $$||\vec{r}-\vec{r'}||_2 = \sqrt{r^2+{r'}^2-2rr'\cos(\theta')}\tag{1}\:,$$
$\theta'$ being the polar angle of $\vec{r'}$.
From the general theory we know that it also hold
$$\phi(\vec{r}):= \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{r}-\vec{r'}||} dr'\tag{2}$$
where 
$$||\vec{r}-\vec{r'}|| = \sqrt{r^2+{r'}^2-2rr'\cos(\alpha)}\tag{3}\:,$$
$\alpha$ being the angle between $\vec{r'}$ and $\vec{r}$.
Comparing (1) and (3), we conclude that 
$$\phi(\vec{r})= \phi(r \vec{e}_z)= f(r)$$
Consequently we have that
$$\phi(\vec{r}) = f(r)\:.$$
Since, for some constant depending on the unit system, $\kappa \Delta \phi(\vec{r}) = \rho(\vec{r})$, we have that
$$\rho(\vec{r}) = \kappa \Delta f(r)\:.$$
In other words $\rho$ must necessarily be a spherically symmetric function. 
The found condition is also sufficient. Indeed, if $\rho$ is spherically symmetric, using the rotational invariance of the measure and the standard distance, it easily arises that the right-hand side of (2) can be re-written as the right-hand side of (0):
$$\phi(\vec{r}):= \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{r}-\vec{r'}||} dr' = \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{Rr'})}{||\vec{r}-\vec{Rr'}||} dRr'=
\frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{r}-\vec{Rr'}||} dr'=  \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{R^{-1}r}-\vec{r'}||} dr' =
 \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||r\vec{e}_z-\vec{r'}||} dr' = \frac{1}{4 \pi \varepsilon_0}\int_{\mathbb{R}^3} \frac{\rho(\vec{r'})}{||\vec{r}-\vec{r'}||_2} dr'\:.$$
