In case \( f(t) \) is a closed form expression or it has an analytic continuation in the complex plane, it may be possible to obtain an expression on closed form for the above integral.
However, the situation which we are often confronted with is that \( f(t) \) is only known at some points \( t_i \) with corresponding values \( f(t_i) \). In order to obtain \( I(x) \) we need to resort to a numerical evaluation.
To evaluate such an integral, let us first rewrite it as $$ \begin{equation*} {\cal P}\int_a^bdt\frac{f(t)}{t-x}= \int_a^{x-\Delta}dt\frac{f(t)}{t-x}+\int_{x+\Delta}^bdt\frac{f(t)}{t-x}+ {\cal P}\int_{x-\Delta}^{x+\Delta}dt\frac{f(t)}{t-x}, \end{equation*} $$ where we have isolated the principal value part in the last integral.