Question
A small magnet of magnetic moment M is placed at a distance r from the origin O with its axis parallel to x-axis as shown. A small coil of one turn, is placed on the x-axis, at the same distance from the origin, with the axis of the coil coinciding with x-axis. For what value of current in the coil does a small magnetic needle, kept at origin remain undeflected? What is the direction of current in the coil?
Solution
For a needle to remain undeflected the magnetic field due to magnet and current loop must be equal and opposite.
The magnetic field of magnet at origin
The magnetic field of the small coil at origin

The magnetic field of magnet at origin
The magnetic field of the small coil at origin
where, x is the radius of the loop.
For, the needle to remain undeflected we have
i.e.,
The direction of the current in the loop must be anticlockwise.
For, the needle to remain undeflected we have
i.e.,
The direction of the current in the loop must be anticlockwise.