Given two coordinates in space, I want to expand the inverse distance $$ I=\frac{1}{|\mathbf r_1 - \mathbf r_2|} $$ as a function of their respective spherical angles $(\theta_1,\phi_1)$ and $(\theta_2,\phi_2)$.
To this end, we notice that $I$ can be written as the generating function for the Legendre polynomials
\begin{align} \frac{1}{|\mathbf r_1 - \mathbf r_2|} &= \frac{1}{\sqrt{r_1^2+r_2^2-2r_1r_2\cos(\gamma)}} \\ &= \frac{1}{r_1} \frac{1}{\sqrt{1+x^2-2rx\cos(\gamma)}} \quad x:=\frac{r_2}{r_1} \\ &= \frac{1}{r_1} \sum_{k=0}^\infty x^k P_k(\cos \gamma) \ , \end{align} where $\gamma$ denotes the angle between the coordinates $\angle(\mathbf r_1,\mathbf r_2)$. $P_k(\cos\gamma)$ are our Legendre polynomials in $\cos(\gamma)$.
I now want to rewrite the last expression in terms of spherical angles, at which I'm stuck. Any hint are highly appreciated.
Context
In calculating the expectation value $\big\langle \psi_0 \big|\frac{1}{|\mathbf r_1 -\mathbf r_2|} \big| \psi_0 \big\rangle $ of the two-electron approximate ground state $\psi_0(\mathbf r_1, \mathbf r_2)$ of the He atom, all $P_k$ with $k>0$ will vanish in the integral \begin{align} \bigg\langle \frac{1}{|\mathbf r_1-\mathbf r_2|} \bigg\rangle &= \bigg( \frac{8}{\pi a^3} \bigg)^2 \int_{\mathbf{r}_1 \in \mathbb R^3} \int_{\mathbf{r}_2 \in \mathbb R^3} \frac{1}{\sqrt{(\mathbf r_1-\mathbf r_2)^2}} e^{-4(r_1+ r_2)/a} d\mathbf r_1 d \mathbf r_2 \ . \end{align}
As it turned out, I was able to solve it in a more simple manner, by using a change of variables. But I'm still interested in solving it with this method using Legendre polynomials.