<s>[INST] Cauchy principal value integral Doing numerical integration I encountered the following calculation of the Cauchy principal value of the following integral:
$$\int_0^{\pi/2}d\varphi\frac{1}{\cos(\varphi)-c},$$
with $0<c<1$.
What is the strategy to solve it?
 [/INST] The indefinite integral is elementary, can be found using half-angle substitution:
$$
   \int \frac{\mathrm{d} \varphi}{\cos(\varphi)-c} = \frac{2}{\sqrt{1-c^2}} \operatorname{arctanh}\left(\frac{1+c}{\sqrt{1-c^2}} \tan\frac{\varphi}{2} \right)+C =: F(\varphi)
$$
The Cauchy principal value is found as a symmetric limit:
$$
   \operatorname{P.V.} \int_0^\frac{\pi}{2} \frac{\mathrm{d} \varphi}{\cos(\varphi)-c} = \lim_{\epsilon\to 0} \left(F\left(\frac{\pi}{2}\right) - F\left( \arccos(c)+\epsilon\right) + F\left( \arccos(c)-\epsilon\right) - F(0)\right)
$$
Easily
$$
   F\left(\frac{\pi}{2}\right) - F(0) = \frac{2}{\sqrt{1-c^2}} \operatorname{arctanh}\left(\sqrt{\frac{1+c}{1-c}}\right) = \frac{2}{\sqrt{1-c^2}} \operatorname{arctanh}\left(\sqrt{\frac{1-c}{1+c}}\right) - \frac{i \pi}{\sqrt{1-c^2}}
$$
and, using $\tan\left(\frac{1}{2} \arccos(c)\right) = \sqrt{\frac{1-c}{1+c}}$
$$
   \lim_{\epsilon\to 0} \left( F\left( \arccos(c)-\epsilon\right) -  F\left( \arccos(c)+\epsilon\right) \right) = \frac{2}{\sqrt{1-c^2}} \lim_{\epsilon \to 0} \left( \operatorname{arctanh}\left(1+\frac{\epsilon}{\sqrt{1-c^2}}\right) - \operatorname{arctanh}\left(1-\frac{\epsilon}{\sqrt{1-c^2}}\right) \right) = \frac{i \pi}{\sqrt{1-c^2}}
$$
Combining, 
$$
  \operatorname{P.V.} \int_0^\frac{\pi}{2} \frac{\mathrm{d} \varphi}{\cos(\varphi)-c} = \frac{2}{\sqrt{1-c^2}} \operatorname{arctanh}\left(\sqrt{\frac{1-c}{1+c}}\right) = \frac{1}{\sqrt{1-c^2}} \log \frac{1+\sqrt{1-c^2}}{c}
$$
</s>