Consider this arrangement
\begin{axis}[axis lines=middle,xmin=-4,xmax=4,ymin=-4,ymax=4,
xtick={-1.5,1.5},ytick={0},xticklabels={},axis equal,xlabel=$x$,ylabel=$z$]
\addplot[black,very thick,domain=-1.5:1.5,samples=120]
{-sqrt( 1.5^2 - x^2 )};
\addplot[black,very thick] coordinates {(-1.5,0)(-1.5,3.5)} node[pos=1,above]{$\infty$};
\addplot[black,very thick] coordinates {(1.5,0)(1.5,3.5)}
node[pos=1,above]{$\infty$};
\addplot[mark=*,domain=0:0] {0} node[pos=1,above,right]{$P$};
\end{axis}
Current flows from the left wires downward in negative $z$-direction and continues like that through the U-turn and then upwards the second straight wire.
I want to determine the magnetic field due to this contraption in the origin, i.e. at position $\vec{p} = (0,0,0)^T$. According to Biot-Savart, it can be calculated using
$$ \vec{B}(\vec{p}) = \vec{B}(0) = \frac{\mu_0 I}{4 \pi} \int \frac{d\vec{l} \times (\vec{p} - \vec{r}^\prime)}{(r^\prime)^3} = -\frac{\mu_0 I}{4 \pi} \int \frac{d\vec{l} \times \hat{r}^\prime}{(r^\prime)^2} $$
For the left wire, introduce the angle $\alpha$ as
\begin{axis}[axis lines=middle,xmin=-4,xmax=4,ymin=-4,ymax=4,
xtick={-1.5,1.5},ytick={0},xticklabels={},axis equal,xlabel=$x$,ylabel=$z$]
\addplot[black,very thick,domain=-1.5:1.5,samples=120]
{-sqrt( 1.5^2 - x^2 )};
\addplot[black,very thick] coordinates {(-1.5,0)(-1.5,3.5)}node[pos=1,above]{$\infty$};
\addplot[black,very thick] coordinates {(1.5,0)(1.5,3.5)}
node[pos=1,above]{$\infty$};
\addplot[black] coordinates {(0,0)(-1.5,1.5)};
\addplot[black,domain=-0.5:-0.35] {(0.5^2 - x^2)^(1/2)} node[pos=0.5,left]
{$\alpha$};
\node[below] at (-0.75,0) {$R$};
\node[left] at (-1.5,0.75) {$z$};
\node[above] at (-0.75,0.75) {$r$};
\end{axis}
We find that $d\vec{l} = -dz \hat{z}$, as well as $r^\prime = \sqrt{R^2 + z^2}$ and
$$ \hat{r}^\prime = \begin{pmatrix} -\cos(\alpha) \\ 0 \\ \sin(\alpha) \\ \end{pmatrix} $$
which leads to
$$ d\vec{l} \times \hat{r}^\prime = dz \begin{pmatrix} 0 \\ \cos(\alpha) \\ 0 \\ \end{pmatrix}. $$
Making use of the definition of the cosine, we additionally find that $\cos(\alpha) = \frac{R}{\sqrt{R^2 + z^2}}$. Then, the magnetic field due to the left wire is
$$ \vec{B}_1(0) = -\frac{\mu_0 I R}{4 \pi} \hat{y} \int_{\infty}^{0} \frac{dz}{(R^2 + z^2)^{3/2}}. $$
Carrying out the integration, however, tells us that the magnetic field points in the positive $y$-direction. By the right hand rule though, it should point in the negative $y$-direction. That would mean that there is a minus sign missing somewhere. I could imagine that the integration bounds are chosen wrongly, i.e. one would have to integrate from $0$ to $\infty$, not the other way around. However, I think the integration should follow the current direction, which is exactly as in the integral above.
Have I missed anything here? Thank you in advance.