d
Current in a small element, $d I=\frac{d \theta}{\pi} I$
Magnetic field due to the element
$d B=\frac{\mu_{0} 2 d I}{4 \pi R}$
The component $d B \cos \theta,$ of the field is cancelled by another opposite component.
Therefore,
$B_{n e t}=\int d B \sin \theta=\frac{\mu_{0} I}{2 \pi^{2} R_{0}} \int_{0}^{\pi} \sin \theta d \theta=\frac{\mu_{0} I}{\pi^{2} R}$
