  We present a method to compute the electrooptic tensor from first principles,
explicitly taking into account the electronic, ionic and piezoelectric
contributions. It allows us to study the non-linear optic behavior of three
ferroelectric ABO_3 compounds : LiNbO_3, BaTiO_3 and PbTiO_3. Our calculations
reveal the dominant contribution of the soft mode to the electrooptic
coefficients in LiNbO_3 and BaTiO_3 and identify the coupling between the
electric field and the polar atomic displacements along the B-O chains as the
origin of the large electrooptic response in these compounds.
