Photoreflectance (PR) at different temperatures and spectroellipsometry (SE) at room temperature were used to study, in a systematic and complementary way, the optical response of a series of strained and relaxed InxGa1-xAs (x<0.15) epilayers. All the samples were grown by molecular-beam epitaxy on GaAs, both with and without a GaAs cap layer, which in the thinnest samples determines a single-quantum-well configuration. The effects of the strain on the optical structures E(0), E(1), and E(1)+Delta(1) observed in the 1.2-3.3 eV photon-energy range were analyzed by fitting standard critical points (CP) line shapes to the PR and SE spectra. The CP experimental energies versus x were compared with the relations obtained in the framework of the elastic strain theory and, in the quantum-well structures, of the envelope-function scheme. The excellent agreement between experiment and theory allowed us to determine, independently and only by optical techniques, the strain epsilon and the composition x values, which compare well with those measured by x-ray diffraction. Additional information concerning the critical thickness for the pseudomorphic growth and the residual strain in quasirelaxed layers was achieved. (C) 1995 American Institute of Physics.