  We present an ab initio method for computing vibro-polariton and
phonon-polariton spectra of molecules and solids coupled to the photon modes of
optical cavities. We demonstrate that if interactions of cavity photon modes
with both nuclear and electronic degrees of freedom are treated on the level of
the cavity Born-Oppenheimer approximation (CBOA), spectra can be expressed in
terms of the matter response to electric fields and nuclear displacements which
are readily available in standard density functional perturbation theory (DFPT)
implementations. In this framework, results over a range of cavity parameters
can be obtained without the need for additional electronic structure
calculations, enabling efficient calculations on a wide range of parameters.
Furthermore, this approach enables results to be more readily interpreted in
terms of the more familiar cavity-independent molecular electric field response
properties, such as polarizability and Born effective charges which enter into
the vibro-polariton calculation. Using corresponding electric field response
properties of bulk insulating systems, we are also able to obtain $\Gamma$
point phonon-polariton spectra of two dimensional (2D) insulators. Results for
a selection of cavity-coupled molecular and 2D crystal systems are presented to
demonstrate the method.
