A quasi-Newton method is used to simultaneously relax the internal coordinates and lattice parameters of crystals under pressure. The symmetry of the crystal structure is preserved during the relaxation. From the inverse of the Hessian matrix, elastic properties, and some optical phonon frequencies at the Brillouin zone center can be estimated. The efficiency of the method is demonstrated for silicon test systems.