The balance equation derived by Sigmund, Oliva, and Falcone [Nucl. Instrum. Methods 194, 541 (1982)] for the evolution with ion fluence of the composition of irradiated polyatomic targets is generalized to include the effect of the implanted bombarding ions and the allowance for the target density to depend on depth. The model also includes atomic mixing, surface recession due to sputtering, and homogeneous target relaxation. As an additional feature in theoretical descriptions of collisional mixing, the need to introduce the effect of the surface in the relocation operator is stressed, and a model for the evaluation of this contribution is proposed. The relocation operators are evaluated in detail for power-law interatomic potentials. We give explicit expressions that are ready for use in numerical solutions of the coupled integro-differential equations that describe the concentration profiles. The potential of the formalism to treat a variety of topics in the interaction of energetic ions with matter is commented upon. In particular, we discuss the conditions for the balance equation to be linear, and results on the evolution with ion fluence of thin markers embedded in solids are compared with other theoretical predictions and with experimental data.