  We study diamagnetism of a gas of fermions moving in a nonhomogeneous
magnetic field $( {\bf B} =B( 0, 0, 1/cosh^{2}( \frac{x-x_{0} }{ \delta })))$
The gas magnetization, the static magnetic susceptibility, the chemical
potential and the gas compressibility are discussed and compared with the
uniform field case. General need to study dynamics of electrons in different
types of magnetic fields follows from a large number of experimental situations
in which its understanding enables physicists to obtain new information.
