Lattice Dynamics and the Optical Properties of Semiconductors: Theory of the Temperature Dependent Dielectric Functions of GaAs and Si and Comparison with Experiment