Here is the formula, where the second term is the principal value integral. Don’t ask my why. Sokhotski–Plemelj theorem