How to solve integration elegantly using contour integration Solve this integral analytically and prove the answer:

$$
\int_0^{\pi/2}\frac{d\psi}{1-\cos\theta \cdot \cos\psi} = \frac{\pi - \theta}{sin \theta}, \quad \theta \in (0,2\pi)
$$
To see the pic

I have already proved it numerically using Mathematica. But still can't prove it analytically.
This is a standard integral:

Let $\cos \theta = a$ (and $-1\leq a \leq 1$):

$$\int\limits_{\psi = 0}^{\pi/2} \frac{1}{1 - a \cos \psi}\ d\psi =\frac{2 \tan ^{-1}\left(\frac{a+1}{\sqrt{1-a^2}}\right)}{\sqrt{1-a^2}}$$
This is a standard integral:

Let $\cos \theta = a$ (and $-1\leq a \leq 1$):

$$\int\limits_{\psi = 0}^{\pi/2} \frac{1}{1 - a \cos \psi}\ d\psi =\frac{2 \tan ^{-1}\left(\frac{a+1}{\sqrt{1-a^2}}\right)}{\sqrt{1-a^2}}$$