limit of an integral whose intagrand contains singularity Consider the following one-sided limit:
$$\vec B(x_f,y_f,0)=\frac{\mu_0}{4\pi}\lim_{y_f \to 0}\int_{-\infty}^{+\infty}\int_{xs1}^{xs2}\frac{J_s\vec a_z\times ((x_f-x_s)\vec a_x + (y_f-0)\vec a_y + (0-z_s)\vec a_z)}{((x_f-x_s)^2+(y_f-0)^2+(0-z_s)^2)^{3/2}}dx_sdz_s$$
where $\vec a_x$, $\vec a_x$ and $\vec a_x$ are the unit vectors in Cartesian coordinates. In order to simplify the problem we can consider $J_s$ constant. Also: $$x_{s1}<x_f<x_{s2}$$
This is a case of Biot-Savart's integral in magnetostatics. As can be seen, the singularity of integrand is on:
$$x_f=x_s, y_f=0, z_s=0$$
From my physical insight, I know the limit exists; however the solution is not easy to obtain. If there is no analytical expression for the limit, how can we compute it numerically?
 A: First, let $x'=x_s-x_f$ and $z_s=z'$ so that
$$\vec B(x_f,y_f=0^\pm,0)=\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}\int_{-\infty}^\infty \int_{x_{s1}-x_f}^{x_{s2}-x_f} \frac{ x' \hat a_y-y_f \hat a_x}{(x'^2+z'^2+y_f^2)^{3/2}}\,dx'\,dz'\tag1 $$
Now, let $\nu>0$ be chosen such that $\nu< \min(x_f-x_{s1},x_{s2}-x_f)$.  Dentote by $R$ the region of integration and $C_\nu$ the cirular region $x'^2+z'^2 \le \nu$.  Then we can write $(1)$
$$\begin{align}
\vec B(x_f,y_f=0^\pm,0)&=\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}  \int_{R\setminus C_\nu} \frac{ x' \hat a_y-y_f \hat a_x}{(x'^2+z'^2+y_f^2)^{3/2}}\,dx'\,dz'\\\\
&+\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}  \int_{ C_\nu} \frac{ x' \hat a_y-y_f \hat a_x}{(x'^2+z'^2+y_f^2)^{3/2}}\,dx'\,dz'\tag2\\\\
&=\frac{\mu_0 J_s}{4\pi}  \int_{R\setminus C_\nu} \frac{ x' \hat a_y}{(x'^2+z'^2)^{3/2}}\,dx'\,dz'\\\\
&+\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}  \int_{-\pi}^{\pi}\int_0^\nu \frac{ \rho \cos(\phi) \hat a_y-y_f \hat a_x}{(\rho^2+y_f^2)^{3/2}}\,\rho\,d\rho \,d\phi\tag3
\end{align}$$
In going from $(2)$ to $(3)$ we exploited the fact that the first integral on the right-hand side of $(2)$ has no singularity.
Evaluation of the second integral on the right-hand side of $(3)$ reveals
$$\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}  \int_{-\pi}^{\pi} \int_0^\nu \frac{ \rho \cos(\phi) \hat a_y-y_f \hat a_x}{(\rho^2+y_f^2)^{3/2}}\,\rho\,d\rho \,d\phi=\mp \hat a_x \frac{\mu_0 J_s}{2} $$
Letting $\nu\to 0$ we find that
$$\vec B(x_f,y_f=0^\pm,0)= \mp \hat a_x \frac{\mu_0 J_s}{2}+\frac{\mu_0 J_s}{4\pi} \text{PV} \left(\int_{R} \frac{ x' \hat a_y}{(x'^2+z'^2)^{3/2}}\,dx'\,dz'\right)\tag4$$
where the Principal Value integral in $(4)$ is defined as
$$\text{PV} \left(\int_{R} \frac{ x' \hat a_y}{(x'^2+z'^2)^{3/2}}\,dx'\,dz'\right)=\lim_{\nu\to 0}\int_{R\setminus C_\nu} \frac{ x' \hat a_y}{(x'^2+z'^2)^{3/2}}\,dx'\,dz'$$

CLOSED-FORM SOLUTION:
For $y_f^2>0$ we can carry out the integration over $z_s$ first and write
$$\begin{align}\vec B(x_f,y_f=0^\pm,0)&=\frac{\mu_0 J_s}{4\pi}\lim_{y_f\to 0^\pm}\int_{-\infty}^\infty \int_{x_{s1}-x_f}^{x_{s2}-x_f} \frac{ x' \hat a_y-y_f \hat a_x}{(x'^2+z'^2+y_f^2)^{3/2}}\,dx'\,dz'\\\\
&=\frac{\mu_0 J_s}{2\pi}\lim_{y_f\to 0^\pm} \int_{x_{s1}-x_f}^{x_{s2}-x_f} \frac{ x' \hat a_y-y_f \hat a_x}{x'^2+y_f^2}\,dx'\,dz'\\\\
&=\mp \hat a_x \frac{\mu_0 J_s}{2}+\hat a_y \frac{\mu_0 J_s}{2\pi}\log\left(\frac{x_{s2}-x_f}{x_f-x_{s1}}\right)
\end{align}$$
