A first integral for a class of time-dependent anharmonic oscillators with multiple anharmonicities

Abstract
The integrability of the equationq̈=f(t)q 2+g(t)q 3+h(t)q 4+j(t)q 5 is considered. Particular cases of this equation arise in the study of charged plasma in an axially symmetric magnetic field and in shear‐free spherically symmetric gravitational fields in general relativity. The above equation with only a quadratic term arises in the study of shear‐free fluids, in general [A. Krasinski, J. Math. Phys. 30, 433 (1989)]. The equation with a cubic term is applicable when there is an electromagnetic field. In special cases we reduce the solution to a quadrature that has solutions in terms of elliptic integrals. A Lie point symmetry analysis is performed and the different cases that arise are considered for the existence of a symmetry.