  The properties of an electron in a typical solid are modified by the
interaction with the crystal ions, leading to the formation of a quasiparticle:
the polaron. Such polarons are often described using the Fr\"ohlich
Hamiltonian, which assumes the underlying lattice phonons to be harmonic.
However, this approximation is invalid in several interesting materials,
including the recently discovered high-pressure hydrides which superconduct at
temperatures above $200$K. In this paper, we show that Fr\"ohlich theory can be
extended to eliminate this problem. We derive four additional terms in the
Fr\"ohlich Hamiltonian to account for anharmonicity up to third order. We
calculate the energy and effective mass of the new polaron, using both
perturbation theory and Feynman's path integral formalism. It is shown that the
anharmonic terms lead to significant additional trapping of the electron. The
derived Hamiltonian is well-suited for analytical calculations, due to its
simplicity and since the number of model parameters is low. Since it is a
direct extension of the Fr\"ohlich Hamiltonian, it can readily be used to
investigate the effect of anharmonicity on other polaron properties, such as
the optical conductivity and the formation of bipolarons.
