Can the Residue Integration method be used if the interval of integration does not result in a closed contour, or cannot be leveraged due to symmetry?
For example:
$$\int_{a}^{b}\frac{1}{k+cosx}\,dx \\$$
Edit: k>1
Letting a=0, b=2$\pi$, then substituting z=$e^{ix}$, then this can be written as:
$$\int_{C}^{}\frac{1}{k+\frac{1}{2}(z+\frac{1}{z})}\,dz/ix \\$$
Where C is the unit circle. There is one pole inside the unit circle, so the integral can be calculated to equal $\frac{2\pi}{k^2-1}$.
However, if the interval does not cover the entire circle, the resulting contour is not closed. For some special cases, such as a=0, b=$\pi$, the symmetry of the function can be leveraged, but that's not a general solution.
In an earlier post, another member provided an alternative method that works with solving this generally, but my question here is whether the Residue Integration method can be used if the interval of integration does not result in a closed contour (generally).
Thanks.
Earlier post: $\dfrac{1}{a-b \cos x}$ format integral