Hint: Use the formula of the magnetic field due to a bar magnet.
From P to Q, every point on the z-axis lies at the axial line of magnetic dipole of moment M. Magnetic field induction at a point at distance z from the magnetic dipole of moment M is:
Step 1:
(i) Along z-axis from P to Q:
Step 2:
(ii) Along the quarter circle QS of radius R is given in the figure below,
The point A lies on the equatorial line of the magnetic dipole of moment Msin. The Magnetic field at point A on the circular arc is:
Step 3:
(iii) Along the x-axis over the path ST, consider the figure given ahead;
From the figure, every point lies on the equatorial line of the magnetic dipole. Magnetic field induction at a point at distance x from the dipole is,
Step 4:
(iv) Along with the quarter circle TP of radius a. Consider the figure given below.
From case (i), we get line integral of B along the quarter circle TP of radius a;