A method of solving numerically the one-dimensional diffusion equation for arbitrary profiles and arbitrary functional dependencies of the diffusion coefficient on the position, diffusant concentration and the time, is described. The technique is applied to a variety of diffusion problems in semiconductor quantum wells to illustrate its power and versatility. In particular solutions are shown for diffusion of graded interfaces, a concentration dependent diffusion coefficient, and the effect of a depth and time dependent diffusion coefficient on a superlattice, as occurs in ion implantation and the subsequent annealing out of the resulting radiation damage. The depth dependence of the intermixing due to ion implantation and subsequent rapid thermal anneal, of a GaAs/Gal-,Al,As multiple-quantum-well structure, is deduced from the broadening of the low temperature photoluminescence emission.