  Pump-probe experiments have suggested the possibility to control electronic
correlations by driving infrared-active phonons with resonant midinfrared laser
pulses. In this work we study two possible microscopic nonlinear
electron-phonon interactions behind these observations, namely coupling of the
squared lattice displacement either to the electronic density or to the double
occupancy. We investigate whether photon-phonon coupling to quantized light in
an optical cavity enables similar control over electronic correlations. We
first show that inside a dark cavity electronic interactions increase, ruling
out the possibility that $T_c$ in superconductors can be enhanced via
effectively decreased electron-electron repulsion through nonlinear
electron-phonon coupling in a cavity. We further find that upon driving the
cavity, electronic interactions decrease. Two different regimes emerge: (i) a
strong coupling regime where the phonons show a delayed response at a time
proportional to the inverse coupling strength, and (ii) an ultra-strong
coupling regime where the response is immediate when driving the phonon
polaritons resonantly. We further identify a distinctive feature in the
electronic spectral function when electrons couple to phonon polaritons
involving an infrared-active phonon mode, namely the splitting of the shake-off
band into three bands. This could potentially be observed by angle-resolved
photoemission spectroscopy.
