We consider analytic or polynomial vector fields of the form $${\mathcal {X}}=\left( -y+X\right) \dfrac{\partial }{\partial x}+\left( x+Y\right) \dfrac{\partial }{\partial y},$$ where $$X=X(x,y))$$ and $$Y=Y(x,y))$$ start at least with terms of second order. It is well-known that $${\mathcal {X}}$$ has a center at the origin if and only if $${\mathcal {X}}$$ has a Liapunov–Poincare local analytic first integral of the form $$H=\dfrac{1}{2}(x^2+y^2)+\sum _{j=3}^ {\infty } H_j$$ , where $$H_j=H_j(x,y)$$ is a homogenous polynomial of degree j. The classical center-focus problem already studied by Poincare consists in distinguishing when the origin of $${\mathcal {X}}$$ is either a center or a focus. In this paper we study the inverse center problem, i.e. for a given analytic function H of the previous form defined in a neighborhood of the origin, we determine the analytic or polynomial vector field $${\mathcal {X}}$$ for which H is a first integral. Moreover, given an analytic function $$V=1+\sum _{j=1}^ {\infty } V_j$$ in a neighborhood of the origin, where $$V_j$$ is a homogenous polynomial of degree j, we determine the analytic or polynomial vector field $${\mathcal {X}}$$ for which V is a Reeb inverse integrating factor. We study the particular case of centers which have a local analytic first integral of the form $$ H=\dfrac{1}{2}(x^2+y^2)\,\left( 1+ \sum _{j=1}^{\infty } \Upsilon _j\right) , $$ in a neighborhood of the origin, where $$\Upsilon _j$$ is a homogenous polynomial of degree j for $$j\ge 1.$$ These centers are called weak centers, they contain the uniform isochronous centers and the isochronous holomorphic centers, but they do not coincide with the class of isochronous centers. We have characterized the expression of an analytic or polynomial differential system having a weak center at the origin We extended to analytic or polynomial differential systems the weak conditions of a center given by Alwash and Lloyd for linear centers with homogeneous polynomial nonlinearities. Furthermore the centers satisfying these weak conditions are weak centers.