Abstract
Magnetic anisotropy is discussed in the context of density-functional theory. A formula for the magnetic torque is derived. This formula includes the effects of the spin part of the exchange-correlation energy. All relativistic effects are taken into account, but assumptions are made for the direction of the spin magnetic moment. The nature of the torque is analyzed by expanding the formula in terms of inverse powers of the speed of light. This analysis shows how to include the effects of the spin-dependent part of the exchange-correlation potential together with the spin-orbit coupling. We find that extra terms exist in addition to the standard spin-orbit coupling.