Consider a circular current-carrying loop of radius "a". The magnetic field at an axial point at a distance "r" from the loop due to an infinitesimal current element, is given by the Biot-Savart law. Applying the Pythagorean theorem to the distance r, the components of the magnetic field along the x-axis and the y-axis can be defined. The perpendicular components of the magnetic field, corresponding to different current elements around the loop, cancel each other. Integrating the parallel components for all the current elements around the loop gives the total magnetic field on the axis of the circular loop. For a coil of n closely spaced loops, the total field on the axis of circular loops is n times the field due to a single loop. The magnetic field's magnitude is maximum at the center of the coil, and decreases along the axis following the inverse square law. If this coil is passed through the plane of a slab containing iron filings, the orientation of the iron filings shows the alignment of the magnetic field lines.