Closed form for integral $\int_{0}^{\pi} \left[1 - r \cos\left(\phi\right)\right]^{-n} \phi \,{\rm d}\phi$ Is there a closed form for $$I_n =\int_{0}^{\pi} \frac{\phi}{(1 - r \cos\phi)^n} \,{\rm d}\phi $$ for $\left\vert\,r\,\right\vert < 1$ real and $n > 0$
integer ?
The solution to this integral would give a closed form solution for this integral, which describes the interaction energy of vector resonant relaxation in astrophysical dynamics.
Using Mathematica and analytic methods I have derived the following result for $n=\{1,2,3,4,5,6\}$: 
$$\tag{1} I_n = -\frac{a_n r}{s^{2n-2}} + \frac{b_n}{s^{2n-1}}\left[\chi_2(q) +\left(-\frac{c_n}{b_n}s + {\rm arctanh}(q) \right){\rm arctanh}(r) \right]$$
where $s=\sqrt{1-r^2}$, $q=\sqrt{(1-r)/(1+r)}$, $\chi_2(x)$ is the Legendre chi function, $a_n$, $b_n$, and $c_n$ are constants given by 
\begin{align}
a_1 &= 0, \quad b_1 = 4, \qquad c_1 = 0,\\
a_2 &= 0, \quad b_2 = 4, \qquad c_2 = 2,\\
a_3 &= 1, \quad b_3 = 4 + 2r^2, \qquad c_3 = 3,\\
a_4 &= \frac{7}{3}, \quad b_4 = 4 + 6r^2, \qquad c_4= \frac{11}{3} + \frac{4}{3}r^2,\\
a_5 &= \frac{23}{6}+\frac{11}{12}r^2, \quad b_5 = 4 + 12 r^2 + \frac{3}{2}r^4, 
\qquad c_5=\frac{25}{6} + \frac{55}{12}r^2,\\
a_6 &=\frac{163}{30} + \frac{47}{12}r^2, \quad b_6 = 4 + 20 r^2 + \frac{15}{2}r^4, 
\qquad c_6=\frac{137}{30} + \frac{607}{60}r^2 + \frac{16}{15}r^4.
\end{align}
Is the integral $I_n$ in the general closed form given by (1) for all $n$? If so, what are the constants $a_n$, $b_n$, and $c_n$?

The integral can be evaluated by realizing that it is a derivative with respect to $R=1/r$, i.e.
$$I_n =\int_{0}^{\pi} \frac{\phi}{(1 - r \cos\phi)^n} \,{\rm d}\phi = R^n \int_{0}^{\pi} \frac{\phi}{(R - \cos\phi)^n} \,{\rm d}\phi = \frac{(-1)^{n-1} R^n}{(n-1)!} \frac{d^{n-1}}{dR^{n-1}}\int_{0}^{\pi} \frac{\phi}{R - \cos\phi} \,{\rm d}\phi. $$
This integral can be evaluated with a Weierstrass substitution $t = \tan (\phi/2)$, 
$$F(R) = \int_{0}^{\pi} \frac{\phi}{R - \cos\phi} \,{\rm d}\phi 
= \frac{4r}{1+r}\int_0^{\infty} \frac{\arctan t}{q^2 + t^2} dt
= \frac{4}{\sqrt{R^2-1}}\int_0^{\pi/2} \arctan \left(q \tan y \right) dy
=  \frac{4}{\sqrt{R^2-1}}\left[\chi_2(q) - {\rm arctanh}(q) \ln(q) \right]
=\frac{4}{\sqrt{R^2-1}}\left[\chi_2(q) +\frac{1}{2} {\rm arccosh}(R) {\rm arctanh}(R) \right],$$
where $q=\sqrt{(1-r)/(1+r)}$ and $\chi_2(x)$ is the Legendre chi function. We can now derive the integral by taking derivatives of this function
$$I_n =  \frac{(-1)^{n-1} R^n}{(n-1)!} \frac{d^{n-1}}{dR^{n-1}}F(R).$$
Note that ${\rm arccosh\,}R=2{\rm arctanh\,}q$, ${\rm arccoth\,}R=\ln q$, and
$$\frac{d}{dx}\chi_2(x) = \frac{{\rm arctanh}(x)}{x} \quad{\rm so\quad} \frac{d}{dR}\chi_2(q) = \frac{{\rm arctanh}(q)}{R^2 - 1} = \frac{1}{2}\frac{{\rm arccosh}(R)}{R^2 - 1} $$
$$\frac{d}{dR} {\rm arccosh}(R) = \frac{1}{\sqrt{R^2 - 1}}  \quad{\rm and\quad} \frac{d}{dR} {\rm arccoth}(R) = \frac{-1}{R^2 - 1} 
= \frac{1}{2}\left(\frac{1}{R+1} - \frac{1}{R-1}\right).$$
The derivatives for $n\geq 3$ simplify to
$$I_n = \frac{R^n}{S^{2n-2}}\left\{ \frac{4 A_{n-1}}{S}\left[\chi_2(q) - {\rm arctanh(q)\ln q}\right]\right. \\
\left.+2\sum_{k=0}^{n-2} \frac{A_k A_{n-k-2}}{k+1} \ln q
+ \sum_{j=0}^{n-3}\sum_{k=0}^{n-3-j}\frac{A_k A_{n-3-j-k}}{n-1-k} \frac{(R-1)^{1+j}-(R+1)^{1+j}}{1+j}
 \right\} $$
where $S=\sqrt{R^2-1}$ and $A_n$ is a polynomial of $R$ defined as
$$A_n = \frac{(-1)^n}{n!}\left(R^2-1\right)^{n+(1/2)}\frac{d^{n}}{dR^{n}} \left(R^2-1\right)^{-1/2}\\
=\left(\frac{R+1}{4}\right)^n\sum_{s=0}^{n}\frac{(2s)!}{(s!)^2}\frac{[2(n-s)]!}{[(n-s)!]^2}q^{2s}.$$ 
The coefficients are related to Legendre polynomials $P_{2n}(0)=(-1)^n(2n)!/[4^n (n!)^2]$.
The result simplifies to
$$
I_n=\left(\frac{R}{R-1}\right)^n \frac{q^2}{4^{n-2}}\left\{
a(q) [\chi_2(q) - {\rm arctanh(q)}\ln q]
+b(q)\ln q + c(q)\right\}$$
where
$$
a(q)=\sum_{K=0}^{n-1}q^{2K-1}
\frac{(2K)!}{(K!)^2} \frac{[2(n-1-K)]!}{[(n-1-K)!]^2}\,,
$$
$$
b(q)=\sum_{K=0}^{n-2}q^{2K}
\sum_{s=0}^{K}\frac{(2s)!}{(s!)^2}\frac{[2(K-s)]!}{[(K-s)!]^2}
\sum_{j=K}^{n-2}\frac{[2(j-K)]!}{[(j-K)!])^2}\frac{[2(n-2-j)]!}{[(n-2-j)!]^2}\frac{2}{j-s+1}\,,
$$
$$
c(q)=\sum_{K=0}^{n-3}q^{2K+2}
\sum_{J=0}^{K} \frac{4^{K-J+1}}{1+K-J} \sum_{s=0}^{J}\frac{(2s)!}{(s!)^2}\frac{[2(J-s)]!}{[(J-s)!]^2}\\
\quad\times
\sum_{j=K}^{n-3}\frac{[2(j-K)]!}{[(j-K)!])^2}\frac{[2(n-3-j)]!}{[(n-3-j)!]^2}\frac{1}{n-1-j+s+K-J}\\
\quad+\sum_{K=0}^{n-3}q^{2K}
\sum_{J=K}^{L-3} \frac{-4^{J-K+1}}{1+J-K}\sum_{s=0}^{K}\frac{(2s)!}{(s!)^2}\frac{[2(K-s)]!}{[(K-s)!]^2}\\
\quad\times
\sum_{j=J}^{n-3}\frac{[2(j-J)]!}{[(j-J)!])^2}\frac{[2(n-3-j)]!}{[(n-3-j)!]^2}\frac{1}{n-1-j+s+J-K}\,.$$
