Considera magnetic dipole (a bar magnet) of length 2l. Let us find magnetic field (B) at a point P at a distance d from centre O of the magnetic dipole.
Let m be strength of each pole.
Magnetic field strength at P due to N-pole.
\(\left|\overrightarrow{\mathrm{B}}_1\right|=\frac{\mu_0}{4 \pi} \frac{m}{\left(d^2+l^2\right)}\) (along PL)
Magnetic field strength at P due to S-pole
\(\left|\overrightarrow{\mathrm{B}}_2\right|=\frac{\mu_0}{4 \pi} \frac{m}{\left(d^2+l^2\right)}\) (along PM)
Thus we find that \(\left|\overrightarrow{\mathrm{B}}_1\right|=\left|\overrightarrow{\mathrm{B}}_2\right|\) , so the components B1 sin θ along OP and B2 sin θ along PO cancel each other and the components, B1 cos θ along PQ and B2 cos θ along PQ get added.
∴ Resultant magnetic field strength at P will be
B = B1 cos θ + B2 cos θ
= 2B cos θ [along PQ]
B = \(\frac{\mu_0}{4 \pi} \frac{2 m \cos \theta}{\left(d^2+l^2\right)}\) (along PQ)