In my physics problem I've modelled the following integral.
\begin{equation} p(X,Y,x_0,y_0) = \int_{0}^{2\pi} \frac{1}{\sqrt{(X-R\cos(\Psi))^2+(Y-R\sin(\Psi))^2}} \delta(g) d\Psi \end{equation}
Where $g=Y[x_0-R\cos(\Psi)]-X[y_0-R\sin(\Psi)]-R[x_0\sin(\Psi)-y_0\cos(\Psi)]$, and $\delta$ is the dirac delta function. From the research I've done I think the answer is:
\begin{equation} p = \sum_i \frac{f(\Psi_i)}{|g'(\Psi_i)|} \end{equation}
Where $\Psi_i$ are the roots of $g(\Psi)=0$, and $g'= \frac{\partial g}{\partial\Psi}$
\begin{equation} d = \sum_i \frac{f(\Psi_i)}{|g'(\Psi_i)|} \end{equation}
Where $\Psi_i$ are the roots of $g(\Psi)=0$, and $g'= \frac{\partial g}{\partial\Psi}$