Local analytic integrability for nilpotent centers

Let X(x,y) and Y(x,y) be real analytic functions without constant and linear terms defined in a neighborhood of the origin. Assume that the analytic differential system \dot{x}=y+ X(x,y), \dot{y}=Y(x,y) has a nilpotent center at the origin. The first integrals, formal or analytic, will be real except if we say explicitly the converse. We prove the following. If X= y f(x,y^2) and Y= g(x,y^2), then the systemhas a local analytic first integral of the form H=y^2+F(x,y),where F starts with terms of order higher than two. If the system has a formal first integral, then it hasa formal first integral of the form H=y^2+F(x,y), where Fstarts with terms of order higher than two. In particular, if thesystem has a local analytic first integral defined at the origin,then it has a local analytic first integral of the formH=y^2+F(x,y), where F starts with terms of order higher than two. As an application we characterize the nilpotent centersfor the differential systems \dot{x}=y+P_3(x,y),\dot{y}=Q_3(x,y), which have a local analytic first integral,where P_3 and Q_3 are homogeneous polynomials of degree three.