Differential Operators, Symmetries and the Inverse Problem for Second-Order Differential Equations