A comment on $\int_{0}^{\pi} \frac{d\theta}{2 - \cos \theta}$ This is taken from Saff&Snider



Q1: I know behind the scenes we are trying to perform a change of variable $\theta \to 2\pi - \theta$. But this isn't the "obvious" substitution I would think of. I would most likely think of $\theta \to \theta/2$ if this was presented to me.
Now this brings my question, is there a reasoning that is missed by me  that the author wanted to communicate to me? (Yes I know cosine is even and has period $2\pi$, but that is not what I think being communicated here) because the author didn't outright write we are using an algebraic substitution to solve the integral.
Note I am aware that $\int_{0}^{\pi} \cos dx = \int_{\pi}^{2 \pi} \cos dx$, but is this preserved under $f \to 1/f$ where $f$ is integrand.
Q2: Relating to Q1, how did they know to come up with that substitution
Q3: I found that my substitution $\theta \to \theta/2$ only gets me half of the integral value because I am integrating on a semi-circle $z = e^{i\theta/2}$. My domain $[0,2\pi]$ isn't truly symmetric as oppose to $[-\pi,\pi]$, so I am not sure why multiplying by 2 gets me the real answer. 
For those curious, the Residue theorem yields $I = \frac{\pi}{\sqrt{3}}$, but that isn't important to my question(s).
 A: For Q1 and Q2: This substitution is useful as it yields the full period of $\cos\theta$. Note that $$\displaystyle\int_a^b f(x)dx + \int_b^c f(x)dx = \int_a^c f(x)dx$$ in general. So, here we get $$2I = \displaystyle\int_0^{2\pi} {d\theta\over 2-cos\theta}$$
And generally as $\cos\theta$ and its anti derivative, $\sin\theta$ has a period of $2\pi$, this leads to some useful simplifications (used for example in that the average voltage across an AC source throughout a cycle is $0$). It doesn’t seem to be that way here, though.
Usually, scaling substitutions such as $t \mapsto \frac\theta2$ are not particularly useful, certainly not in the way of any further substitutions because in the end you’re taking an integral of half the variable for twice as long, resulting in no net gain. Here, however, note that with the above substitution we get $$\displaystyle\int_0^{\pi\over 2} {2dt\over2-cos2t}$$
$$= \displaystyle\int_0^{\pi\over2} {2dt\over 1+\sin^2t}$$ which is exactly the same thing… you could have done this in $\theta$ itself and then implicitly made this substitution during integration.  The only advantage of writing it like this is that it led us to notice this path. It is not even necessary such a transformation is particularly useful (I think it may be here) but as it is a trigonometric function we may try other substitutions now. 
Also note that a given substitution doesn’t “hold” for any particular function $f$. It’s entirely a transformation of the variable and has nothing to do with the function which is using that variable. 
For Q3: see that you have correctly made the substitution. Is it what I have written above?
A: In the half period $[0, \pi],  \cos \theta$ takes on every value in its range.  So does $\frac {1}{2-\cos\theta}.$  So, in the second half of the period, the function runs through the same values.
This is not true for all periodic functions.  It is not true for $f(\theta) = \sin\theta.$
Nonetheless, as it is the case we can say:
$\int_0^\pi \frac{1}{2-\cos\theta}\ d\theta = \frac 12 \int_0^{2\pi} \frac{1}{2-\cos\theta}\ d\theta$
As you note a more formal way to look at it would be to say:
$\int_0^\pi \frac{1}{2-\cos\theta}\ d\theta = \int_{\pi}^{2\pi} \frac{1}{2-\cos\phi}\ d\phi$ 
by the substitution $\phi = 2\pi - \theta$
or 
$\int_0^\pi \frac{1}{2-\cos\theta}\ d\theta = \int_{-\pi}^{0} \frac{1}{2-\cos\theta}\ d\theta$ 
by the substitution $\phi = -\theta$
Where do these substitutions come from?  It is not uncommon to try $u = a+b-x$ as a standard trick in the toolbox.  Although this is not what we did, it has a similar feel.  The second one might be a little bit more obvious as we are exploiting the fact that $\cos \theta$ is an even function.
As you note, if we use the substitution $\phi = 2\theta$
$\int_0^\pi \frac{1}{2-\cos\theta}\ d\theta$ becomes $\frac 12 \int_0^2\pi \frac{1}{2-\cos\frac \phi 2}\ d\phi$
We still have not cycled a full period for $\cos \frac{\phi}{2}$
