a) Verify that for $x > 1$, $n \in \mathbb{N}$ the function $$P_n(x) = \frac{1}{\pi} \int_0 ^ \pi (x + \sqrt{x ^ 2- 1} \cos \phi) ^ n d \phi$$ is a polynomial of degree $n$ (the $n$th Legendre polynomial).
b) Show that $$P_n(x) = \frac{1}{\pi} \int_0 ^ \pi \frac{d\varphi}{(x - \sqrt{x ^ 2- 1}\cos \varphi) ^ n}.$$
I have solved the first part of the problem but I am stuck on the second part. I have tried making the substitution $r = \varphi - \pi$ in the second integral and using the oddity of $y = \cos x$ to bring the denominator to $(x + \sqrt{x ^ 2 - 1} \cos r) ^ n$, but I have little idea how to proceed from there. Can sombody help? Thanks in advance!