Analytical theory of four-wave mixing in semiconductor amplifiers