(A) Magnetic moment of the bar magnet,$M = 5.25 \times 10^{-2} \; J \, T^{-1}$.
Magnitude of earth's magnetic field,$H = 0.42 \; G = 0.42 \times 10^{-4} \; T$.
$(a)$ The magnetic field $B$ at a distance $R$ on the normal bisector is $B = \frac{\mu_{0} M}{4 \pi R^{3}}$.
For the resultant field to be inclined at $45^{\circ}$ with the earth's field,we must have $B = H$.
$\frac{\mu_{0} M}{4 \pi R^{3}} = H \implies R^{3} = \frac{\mu_{0} M}{4 \pi H} = \frac{10^{-7} \times 5.25 \times 10^{-2}}{0.42 \times 10^{-4}} = 12.5 \times 10^{-5} \; m^{3}$.
$R = (125 \times 10^{-6})^{1/3} \approx 0.05 \; m = 5 \; cm$.
$(b)$ The magnetic field $B'$ at a distance $R'$ on the axis is $B' = \frac{\mu_{0} 2 M}{4 \pi R'^{3}}$.
For the resultant field to be inclined at $45^{\circ}$ with the earth's field,$B' = H$.
$\frac{\mu_{0} 2 M}{4 \pi R'^{3}} = H \implies R'^{3} = \frac{2 \mu_{0} M}{4 \pi H} = 2 \times R^{3} = 25 \times 10^{-5} \; m^{3}$.
$R' = (250 \times 10^{-6})^{1/3} \approx 0.063 \; m = 6.3 \; cm$.