We first note that the direction of the B field, as given by the Biot-Savart Law, is into the page. To get the magnitude for the field, we need to integrate over the infinite length of the wire. Consider the circuit shown in the figure below. A current i runs through it. For our problem, we use the right-hand rule to note that the field due to the arc of radius b points out of the page while the arc of radius a gives a field that points into the page.
P are both out of the page.
To get the contribution from piece 2, the semi-circular arc, look again at the diagram above.