Theoretical analysis of diffused quantum-well lasers and optical amplifiers