We characterize the set of n-jets admitting an extension which is a germ of
a differential equation with an analytic first integral, and compute its c
odimension in the n-jet space. Some applications in the case of the centre-
focus problem are given.