On the computation of Darboux first integrals of a class of planar polynomial vector fields

We study the class of planar polynomial vector fields admitting Darboux first integrals of the type $\prod_{i=1}^r f_i^{\alpha_i}$, where the $\alpha_i$'s are positive real numbers and the $f_i$'s are polynomials defining curves with only one place at infinity. We show that these vector fields have an extended reduction procedure and give an algorithm which, from a part of the extended reduction of the vector field, computes a Darboux first integral for generic exponents.


Introduction
Complex planar polynomial differential systems are being studied since the 19th century when Darboux [16], Poincaré [38,39], Painlevé [37] and Autonne [5] significantly contributed to this topic. Surprisingly, nowadays, the problem of characterizing integrable differential systems as above remains open. To compute a first integral is a very interesting issue because this function provides the solution curves of the system within their domain of definition, determining the phase portrait of the system. The Darboux theory of integrability of planar differential systems (as presented for example in [18]) considers a remarkable family of multi-valued functions, named Darboux functions, which have the following shape: where f i , and g j and h j are bivariate complex polynomials and λ i and µ j complex numbers. The Darboux theory states that if a system has p invariant algebraic curves with equations f i = 0 with cofactors k i , i ≤ i ≤ p, and q exponential factors exp h j g j with cofactors ℓ j , 1 ≤ j ≤ q, such that p i=1 λ i k i + q j=1 µ j ℓ j = 0 for some complex numbers {λ i } p i=1 and {µ j } q j=1 , not all zero, then the function H given in (1) is a first integral of the differential system.
A particular and desirable type of Darboux functions are rational functions because when H = f /g is a first integral, all the invariant curves of the system are algebraic and are determined from the equations λf + βg = 0, where the pair (λ : β) runs over the complex projective line. Poincaré in [39] observed that "to find out whether a differential equation of the first order and the first degree is algebraically integrable, it is enough to get an upper bound of the degree of the integral". This observation gave rise to the so-called Poincaré problem, which looks for a bound of the degree of the first integral in terms of the degree of the polynomial system, and generated a lot of literature. Although it is well-known that this upper bound does not exist in general, in some cases it can be computed. For instance, when the singularities of the corresponding vector field are non-degenerated [39], when they are of nodal type [13] or when the reduction of the before mentioned vector field admits only one non-invariant exceptional divisor [25]. Notice also that, when a bound of the degree of the rational first integral is known, efficient algorithms to compute that integral have been described [23,8].
Recently in [22], the authors considered a family of planar polynomial differential systems F formed by those systems admitting a polynomial first integral which factorizes as a product of bivariate polynomials, each of them defining a curve with only one place at infinity. These first integrals were called well-behaved at infinity, WAI for short. A plane curve has only one place at infinity when it meets the line at infinity in a unique point where it is reduced and unibranched. Abhyankar and Moh [1,2,3] introduced these curves. They have a very good local-global behavior, which makes them useful when studying some algebraic and geometric problems [10,11,19,20,24]. In addition, many interesting (but hard to compute) tools, introduced for improving the knowledge of the algebraic varieties, are much easier to describe when one considers surfaces having a close relation with curves with only one place at infinity [41,26,36,27].
Returning to the family F of differential systems, we proved in [22] that when a vector field, or equivalently a 1-form ω, corresponds to a system S in F , then the degree of the polynomial first integral can be bounded from the knowledge of a part of the Seidenberg reduction of ω. Furthermore, from this reduction, we are able to decide whether S belongs to F or not and, in the affirmative case, to compute the corresponding first integral. This solves the problem of deciding if a system has a polynomial first integral given by (natural) powers of curves with only one place at infinity.
We want to study whether a similar procedure can be performed for families of polynomial differential systems having a non-polynomial Darboux first integral defined by curves with only one place at infinity. So, in this paper, we consider a new family D of planar polynomial differential systems having what we call a Darboux positive well-behaved at infinity (DPWAI) first integral. This family satisfies D ∩ F = ∅ and roughly speaking (see Definition 4.1 for the precise concept) a DPWAI function is a (multi-valued) function are bivariate polynomials defining plane curves C i with only one place at infinity and satisfying that each one of them does not belong to the pencil at infinity defined by any other. In addition, the values α i , 1 ≤ i ≤ r, are positive real numbers satisfying a certain condition which holds when they are linearly independent over the rational numbers.
The main result in this paper is an algorithm whose input is a differential system X and whose output is either a first integral of X or "0". The output is a DPWAI first integral when X belongs to D and its first integral has generic exponents (see Definition 4.4); if the output is "0" then either X does not belong to D, or it belongs to D but the exponents of the first integral are not generic. Vector fields admit a (possibly infinite) extended reduction of singularities (see Definition 4.3). This extended reduction shows that simple singularities whose quotient of eigenvalues is a positive irrational number can be "simplified" by an infinite sequence of point blowing-ups and represented by means of a proximity graph (see Subsection 2.4 and Section 4). Our algorithm uses a (finite) part of that extended reduction and, also, when X belongs to D and its first integral has generic exponents, determines the complete extended reduction over the line at infinity. Notice that, with this algorithm, we are able to compute much more Darboux first integrals (which are not rational) than in [22].
The algorithm has two steps. The first one, Algorithm 5.3, uses the mentioned part of the extended reduction to get candidates to polynomials defining the invariant curves C i , and the second one computes the exponents α i by using Darboux theory of integrability (Theorem 5.1). We think that, in practice, our algorithm works for any system in D; however, due to our algebraic techniques, we can only guarantee that it computes a Darboux first integral when the exponents {α i } r i=1 are generic. Section 5 provides the mentioned algorithm together with an example showing how it works. The ingredients we need to develop the paper are given in Section 2. WAI first integrals are recalled in Section 3 and Section 4 introduces the concept of extended reduction of a vector field and describes it for vector fields in D (generic exponents).

Preliminaires
Let X be a complex planar polynomial differential system given bẏ where p, q ∈ C[x, y] and gcd(p, q) = 1. Assume that d = max{deg p, deg q} is the degree of the system X, deg meaning total degree. In the sequel X also denotes the corresponding vector field X = p ∂ ∂x + q ∂ ∂y . Recall that a function H = H(x, y) (may be multi-valued) is a first integral of X if H is constant on the solutions of the system. If H ∈ C 1 then it satisfies the equation whereas H is defined.
In this paper, we will study a certain family of vector fields X admitting a particular class of Darboux first integrals. We devote this section to summarize some concepts and properties we will need.
We have introduced the polynomial differential system (2) by using affine coordinates, however, in this paper, we will need to consider its complex projectivization. Therefore we start by studing the complex projectivization X of the vector fields X and their corresponding 1-forms.
2.1. Polynomial vector fields in CP 2 . Let A, B, and C be homogeneous polynomials of degree d + 1 in the variables X, Y , and Z with coefficients in the complex numbers. A homogeneous 1-form Ω = AdX + BdY + CdZ of degree d + 1 is called projective if XA + Y B + ZC = 0. This means that there exist three homogeneous polynomials P , Q, and R, in the variables X, Y, Z, of degree d such that The 1-form Ω is usually called a Pfaff algebraic form of the complex projective plane CP 2 [30], and the triple (P, Q, R) determines a homogeneous polynomial vector field in CP 2 of degree d: Let F ∈ C[X, Y, Z] be a homogeneous polynomial. The curve F = 0 in CP 2 is invariant under the flow of the vector field X if for some homogeneous polynomial K ∈ C[X, Y, Z] of degree d − 1, called the cofactor of F . The singular points of a projective 1-form Ω of degree d + 1 or of its associated homogeneous polynomial vector field X of degree d are those points in the projective plane satisfying the following system of equations: Next we show how to get the projectivization, as a 1-form or as a vector field, of System (2). System (2) is equivalent to the 1-form which extends to CP 2 as the projective 1-form of degree d + 1 where we have replaced (x, y) by ( As a consequence, the vector field X is extended to the homogeneous polynomial vector field of degree d in CP 2 which is called the complex projectivization of the vector field X. Notice that the line at infinity Z = 0 is a solution of the projective vector field because the third component R in X is identically zero. In addition, by (5), it turns out that the singular points of the complex projectivization of System (2) satisfy the following equalities: The third equation and the line Z = 0 determine the singular points at infinity. Setting Z = 1, the singular points which are not at infinity are obtained from the equalities P = Q = 0.
Recall that an invariant algebraic curve of the vector field X is an affine algebraic curve with local equation f (x, y) = 0, f ∈ C[x, y], such that Xf = kf , where k ∈ C[x, y] is called the cofactor of f = 0 and has degree at most d − 1. Now, if f (x, y) = 0 has degree n ∈ N, then F (X, Y, Z) = Z n f (X/Z, Y /Z) = 0 is an invariant algebraic curve of the vector field (7) with cofactor K(X, Y, Z) = Z d−1 k(X/Z, Y /Z).
We have briefly reviewed the projectivization procedure for affine systems. We conclude this subsection by explaining how the affinization works. We will consider the local chart determined by Z = 1. Let F = 0 be an invariant algebraic curve of degree n of the vector field defined by (3) with cofactor K. Applying Euler's Theorem for homogeneous functions and taking (4) into account, it holds that f (x, y) = F (X, Y, 1) = 0 is an equation of an invariant algebraic curve of the restriction of Ω to the affine plane: (P (x, y, 1) − xR(x, y, 1)) dy − (Q(x, y, 1) − yR(x, y, 1)) dx. This 1-form has degree d+1 and the cofactor of the invariant curve f (x, y) = 0 is k(x, y) = K(x, y, 1) − nR(x, y, 1). It has degree at most d whenever the line Z = 0 is not invariant. We notice that the line Z = 0 is invariant if and only if Z|R. In such a case, the degree of k is at most d − 1.
Next, we give a short overview of the blow-up technique to reduce the singularities of a planar vector field, which will be a key element in this paper.

2.2.
Reduction of singularities. The singularities of planar vector fields can be reduced by blowing-up (see [22,Section 4.1] for details). This procedure, due to Seidenberg, performs algebraic modifications and gives rise to a simpler vector field over a different to CP 2 surface, which makes easier the study of the original vector field [40,17,4]. Next we recall the concepts of singularity and simple singularity.
is called a singularity of a polynomial vector field X = p(x, y) ∂ ∂x + q(x, y) ∂ ∂y in C 2 , {x, y} being local coordinates at O, if the multiplicity of X at O (that is, the minimum of the orders of p = p(x, y) and q = q(x, y) at O) is strictly positive. Moreover O is called a simple singularity whenever X has multiplicity 1 at O and the matrix ∂p 1 ∂x ∂p 1 ∂y ∂q 1 ∂x ∂q 1 ∂y , defined by the first nonzero jet p 1 dy − q 1 dx of the differential 1-form pdy − qdx, has eigenvalues λ 1 , λ 2 satisfying either λ 1 λ 2 = 0 and λ 1 λ 2 ∈ Q + , or λ 1 λ 2 = 0 and λ 2 1 + λ 2 2 = 0. An ordinary singularity is a singularity that is not simple.
Seidenberg's reduction theorem [40] (see also [9]) shows that the singularities of a planar vector field can be transformed into simple singularities by means of blowing-ups: Let O ∈ C 2 be an isolated singularity of a polynomial vector field X = p ∂ ∂x + q ∂ ∂y in C 2 . Then there exists a finite sequence of blowing-ups centered at closed points of the successively obtained surfaces, π : Z → CP 2 , such that all the singularities of the strict transform of the vector field at the surface Z are simple.
From a global point of view, Seidenberg's result states that, given an homogeneous polynomial vector field X in CP 2 , there exists a set of points (or configuration, according with a forthcoming definition) is such that all the singularities of the strict transformX of X in Z are simple. We call S(X ) the singular configuration of X . For an explicit local description of the reduction of singularities and the obtention of the singular configuration, including a detailed example, see Section 4 of [22].
A solution of X at a point p ∈ CP 2 is a holomorphic (possibly singular) irreducible curve on a neighborhood of P which passes through p and is invariant by X . A singularity is called dicritical if there are infinitely many solutions through it (see [22,Definition 1] for an equivalent definition that allows us to detect the dicritical character of a singularity from the reduction process).
Along the paper, we will denote by D(X ) the dicritical configuration of X , which is the set of points Q i in S(X ) such that Q i is a dicritical singularity of the strict transform of the vector field X at Q i (see [22, page 360] for the definition of strict transform of a vector field and the straightforward translation of the concept of dicritical singularity to these vector fields over surfaces obtained by blowing-up).
In the following two subsections we recall the concepts of configuration of infinitely near points and its proximity graph, and that of proximity graph defined by a positive real number.
2.3. Proximity graph of a configuration: singular and dicritical graphs. Let P be a point of a complex surface. The exceptional divisor E P produced by blowing-up P is called the first infinitesimal neighborhood of P . By induction, if i > 0, then the points in the ith infinitesimal neighborhood of P are the points in the first infinitesimal neighborhood of some point in the (i − 1)th infinitesimal neighborhood of P . A point Q = P in some infinitesimal neighborhood of P is called proximate to P if Q belongs to the strict transform of E P . Also Q is a satellite point if it is proximate to two points; that is, if it is the intersection point of the strict transforms of two exceptional divisors. Non-satellite points are named free.
Points in the ith infinitesimal neighborhood of P , for some i > 0, are infinitely near to P . These points admit a natural ordering: a point R precedes Q if and only if Q is infinitely near to R. Note that we agree that a point is infinitely near to itself.
A configuration of infinitely near points (or, simply, a configuration) of a complex surface X 0 (it could be CP 2 ) is a (finite or infinite) set of points such that P 0 ∈ X 0 and, for all i ≥ 1, P i belongs to the blow-up X i of X i−1 with center at P i−1 .
The Hasse diagram of C, H C , with respect to the above alluded order relation is a union of rooted trees whose set of vertices is bijective with C. The proximity graph of C, Γ C , is a labeled graph formed by H C where, also, we join with a dotted edge those vertices corresponding with points P and Q of C such that Q is proximate to P but Q is not in the first infinitesimal neighborhood of P . For simplicity we delete those dotted edges that can be deduced from others.
If X is, as above, a projective vector field over CP 2 , the proximity graph Γ S(X ) (respectively, Γ D(X ) ) is called the singular graph (respectively, dicritical graph) of X .
2.4. The proximity graph defined by a positive real number. Let X 0 be a complex surface, P a point in X 0 and C a germ of curve on the local ring of X 0 at P having only one analytic branch. Assuming that P is singular, one can determine the configuration of infinitely near points D C = {P 0 , P 1 , . . . , P s } such that: (i) P 0 = P and, for all i ≥ 1, P i is the point where the exceptional divisor E P i−1 meets the strict transform of C. (ii) The composition of the blowing-ups centered at the points of D C gives rise to a minimal embedded resolution of the singularity of C at P .
For i ≥ 0, let m i denote the multiplicity at P i of the strict transform of C. Each one of these numbers m i satisfies the so-called proximity equalities: m i = 1 if i = s and, otherwise, m i = m j , where the sum runs over the set of indices j such that P j is proximate to P i [12]. Notice that the (s + 1)-tuple of multiplicities (m 0 , m 1 , . . . , m s ) uniquely determines the proximity graph of the configuration D C . If the singularity of C at P has only one Puiseux pair (i.e., the minimal embedded resolution is obtained by blowing-up some free points and, afterwards, finitely many satellite points), then the sequence of multiplicities of C at P has the shape where the subindices (c i ) ℓ i=0 indicate the number of times that each multiplicity is repeated. Moreover, the numbers c i come from the continued fraction expansion of the rational number . Similarly, the continued fraction expansion of any positive rational number β determines a proximity graph, which we shall denote by Prox(β). Now, let γ be a positive irrational number and consider its (infinite) continued fraction expansion Then, the proximity graph defined by γ, Prox(γ), is given by the limit of the graphs Prox(β i ) in the following sense: the vertices (respectively, edges) of Prox(γ) are the vertices (respectively, edges) of Prox(β i ) for i large enough. It has the shape described in Figure 1.  The relation between elimination of base points of certain linear systems and the reduction of singularities of planar vector fields having a rational first integral supports some reasonings in this paper. So we conclude this section with a brief of those concepts close to linear systems we will use. 2.5. Linear systems and pencils. A linear system on CP 2 is the set of algebraic curves defined by the polynomials in a subspace of C m [X, Y, Z] for some natural number m > 0, where C m [X, Y, Z] denotes the (projective) space of homogeneous polynomials of degree m in the variables X, Y, Z. Notice that a linear system has structure of projective space. A pencil is a linear system of projective dimension 1. Next, we introduce the concept of cluster of CP 2 . We desire to consider linear systems determined by clusters. To this purpose, we require some notations and concepts. We start by recalling the concept of virtual transform (respectively, passing virtually) at (respectively, through) a point of a cluster. For each Now consider a cluster K = (C, m), an algebraic curve C in CP 2 , and a point Q k ∈ C.
When ℓ(Q k ) = 1, we take a local chart at Q k with local coordinates (x, y) and a local equation Assume inductively that C passes virtually through Q j with respect to K, take local coordinates (x, y) at Q j and let f (x, y) = 0 be a local equation of C K Q j . The point Q k belongs to the surface obtained by blowing-up Q j and thus Q k = (0, λ) (respectively, Q k = (λ, 0)) in local coordinates (x, t = y/x) (respectively, (s = x/y, y)). This allows us to define the virtual transform of C at Q k with respect to the cluster K, C K Q k , as the (local) curve defined by x −m j f (x, x(t + λ)) = 0 (respectively, x −m j f ((s + λ)y, y) = 0). As above, the multiplicity of C K Q k at Q k is denoted by m Q k (C K Q k ) and C passes virtually through Q k with respect to K if m Q k (C K Q k ) ≥ m k . When the curve C passes virtually through Q i with respect to K for all Q i ∈ K, we say that C passes virtually through K.
Next we define the above mentioned linear system determined by a cluster and a positive integer.
Definition 2.4. Given a positive integer m and a cluster K = (C, m) of CP 2 , the linear system determined by m and K, denoted by L m (K) or L m (C, m), is the linear system in CP 2 given by those curves defined by polynomials in C m [X, Y, Z] that pass virtually through K.
Another important concept for us is that of the strict transform of a curve on a surface obtained by a sequence of point blowing-ups.
Definition 2.5. The strict transformC of an algebraic curve C on a complex surface Z obtained by the composition π : Z → CP 2 of the sequence of point blowing-ups associated with a (finite) configuration of infinitely near points C is the image of C by the birational map π −1 .
Let n be a positive integer, let F 1 , F 2 , . . . , F s ∈ C n [X, Y, Z] be linearly independent polynomials in C n [X, Y, Z] and assume that F 1 , F 2 , . . . , F s have no common factor. Set L = PV the linear system on CP 2 associated to the linear space over C, V = F 1 , F 2 , . . . , F s , spanned by the polynomials F i , 1 ≤ i ≤ s. Then, there exists a configuration of infinitely near points of CP 2 , BP(L), and a finite set of linear subspaces H i CP s−1 , 1 ≤ i ≤ t, such that the strict transforms of the curves with equations

Reduction of singularities of a vector field with WAI first integral
We start this section by recalling the concept of plane curve with only one place at infinity, which was initially considered in [1,2,3].
Definition 3.1. An algebraic projective curve C defined by a homogeneous polynomial F ∈ C[X, Y, Z] has only one place at infinity if C meets the line at infinity Z = 0 at a unique point P and C is reduced and unibranched (i.e., analytically irreducible) at P .
Next we introduce the concept of well-behaved at infinity (WAI) first integral.
Definition 3.2. A complex planar polynomial differential system (or vector field) X has a WAI first integral if it has a polynomial first integral of the form where r and n i , 1 ≤ i ≤ r, are positive integers and f i , 1 ≤ i ≤ r, are polynomials in C[x, y] of degree d i ∈ N such that each complex projective curve C i of CP 2 defined by the projectivization F i (X, Y, Z) = Z d i f i (X/Z, Y /Z) of f i has only one place at infinity. Along this paper we will also assume that, for having a WAI first integral H, gcd(n 1 , n 2 , . . . , n r ) = 1, r ≥ 2, and that H fulfills the following condition: . . , r} such that i = j and for all λ ∈ C.
where Q runs over the set of common points of C j and C i outside the line at infinity (defined by Z = 0), and (C j , C i ) Q is the intersection multiplicity between C i and C j at Q. We will assume in the remaining of this section that X is a complex planar polynomial vector field which admits a WAI first integral. By [22,Corollary 1], the dicritical configuration D(X ) of the complex projectivization X of X to CP 2 coincides with the configuration of the cluster of base points of the pencil This cluster is studied in [11]. Taking advantage of it we state the following result, which provides a very specific information about the dicritical configuration D(X ). Proposition 3.3. Let X and X be as above. Then where, for each i = 1, 2, . . . , r: (a) BP(P i ) is the configuration of base points of the pencil P i defined by the non-zero linear combinations of the polynomials F i and Z d i . (b) The configuration BP(P i ), ordered by the relation "to be infinitely near to", has only one maximal point Q i . Moreover, the strict transform of the curve C i with equation F i = 0 meets the exceptional divisor E Q i at a unique point S i . The local 1-form at S i defining the strict transform of X has the shape δ i u dt − n i t du, where u = 0 (respectively, t = 0) is a local equation of the strict transform of C i at S i (respectively, the exceptional divisor E Q i ) and Proof. Items (a), (b), and (e) follow from [11, Lemma 1] and its proof. The composition of the blowing-ups centered at the points of P i is an embedded resolution of the singularity of C i at infinity (see [2,34]) and, as a consequence, the point S i is free. This proves Item (d).
It remains to prove (c). Reasoning by contradiction, assume that ρ ji = 0 for some indexes i, j ∈ {1, 2, . . . , r} such that i = j. Let Y be the surface obtained by blowing-up the points in BP(P i ) and letC i andC j be the respective strict transforms of C i and C j on Y . By (b) and (e) and our assumption,C i andC j do not meet, and thenC i ·C j = 0. This means, by the projection formula, thatC j is contracted by the morphism defined by a basis of global sections of the sheaf O Y (C i ) [29]. Thus C j must be a curve of the pencil P i , and this contradicts Condition (8), which is assumed for the WAI first integral H.
is independent of the exponents n 1 , n 2 , . . . , n r appearing in the WAI first integral.

Extended reduction of singularities and DPWAI first integrals
An algorithm for deciding whether a polynomial differential system as (2) has a WAI first integral, and computing that integral in the affirmative case, was given in [22]. This algorithm uses a part of the reduction of the corresponding vector field X . We want to find out whether there is some close procedure to compute other types of Darboux first integrals involving curves with only one place at infinity. Next we introduce a class of Darboux functions and an extended reduction of singularities of vector fields suitable for our purposes. where: where ρ ji is the value defined in (9). Remark 4.2. Note that our last condition holds, in particular, when {α i } r i=1 is a linearly independent set over the field Q. Now, we define the concept of extended reduction of singularities. Definition 4.3. An extended reduction of singularities of an arbitrary singular polynomial vector field X on CP 2 is a sequence of blowing-ups obtained by performing, first, a reduction of singularities of X and, then, by successively blowing-up every simple singularity of the transformed vector field whose quotient of eigenvalues is a positive real number.
This extended reduction can be regarded as a more natural procedure than Seidenberg's reduction because we keep blowing-up points while the quotient of eigenvalues is a positive real number γ. Although we can obtain an infinite sequence of blowing-ups, this sequence is completely determined by the continued fraction expansion of γ. Seidenberg applies only this procedure when γ is rational giving rise to a finite sequence of point blowing-ups.
Let us denote by E(X ) the configuration of infinitely near points of CP 2 formed by the centers of the extended reduction of singularities of X . Also, E ∞ (X ) will denote the configuration of points in E(X ) whose images on CP 2 by the sequence (10) belong to the line at infinity. Definition 4.4. We will say that a property P is satisfied for generic exponents {α i } r i=1 if there exists a finite set of non-zero polynomials {h j (z 1 , z 2 , . . . , z r )} j∈J ⊆ C[z 1 , . . . , z r ], J a set of indexes, fulfilling the following condition: P is satisfied for all r-tuples (α 1 , α 2 , . . . , α r ) such that h j (α 1 , . . . , α r ) = 0 for all j ∈ J.
Until the end of this section, we will suppose that X is a polynomial vector field (or differential system) of C 2 having a DPWAI first integral Consider the complex projectivization X of X and set Ω X = AdX + BdY + CdZ a homogeneous reduced 1-form defining X . The following result explains how Ω X writes for generic exponents. See [33] for the affine version with a polynomial differential system having a generalized Darboux first integral.
Proposition 4.5. With the above notation it follows that, for generic exponents α 1 , . . . , α r , the reduced 1-form Ω X is, up to multiplication by a non-zero constant, equal to It is straightforward to check that r i=1 f α i i is a first integral the vector field obtained by the restriction of Ω X to the affine plane. So, it only remains to prove that Ω X is reduced.
Let X ′ be the map which sends every elementβ = (β 1 , β 2 , . . . , β r ) ∈ R r to the vector field X ′ (β) of CP 2 defined by the homogeneous 1-form Denote by Q + the set of positive rational numbers. It is straightforward to check that, for eachβ ∈ (Q + ) r , the vector field X ′ (β) has r i=1 F n i i /Z m as a first integral, where n i = eβ i , 1 ≤ i ≤ r, e is the least common multiple of the denominators of the irreducible expressions of the rational numbers β 1 , β 2 , . . . , β r and m = r i=1 n i deg(F i ). By [11,Lemma 1 (iv)], the pencil of curves defined by the equations has exactly two elements which are not integral (reduced and irreducible) curves. These curves are those with equations r i=1 F n i i = 0 and Z m = 0. We must recall that this result holds when the curves F i = 0 have only one place at infinity. Otherwise this number may be larger [21]. Now, Ω(β) is reduced for allβ ∈ (Q + ) r because, otherwise, the formula relating the degrees of the pencil and the form, and the factorization of the remarkable curves [28, Lemma 1.2], does not hold.
Theorem 4.6. Assume that X is the complex projectivization of a polynomial vector field X having a DPWAI first integral as above whose exponents α 1 , α 2 , . . . , α r are generic. Then the following equality of configurations holds: where, for 1 ≤ i ≤ r, the S i 's are the points defined in Proposition 3.3 and each J i = {R 1i , R 2i , . . .} is an infinite chain of infinitely near points such that R 1i (respectively, R ji , j ≥ 2) is a point that belongs to the exceptional divisor obtained by blowing-up S i (respectively, R j−1,i ). Moreover, the proximity graph of each chain {S i } ∪ J i is determined by the irrational number δ i /α i and named Prox(δ i /α i ), where and ρ ji are the integers Q (C j , C i ) Q defined in (9).
Proof. Consider the vectorᾱ = (α 1 , α 2 , . . . , α r ) ∈ (R + ) r given by some generic elements {α i } r i=1 . Let B := Bᾱ = {β n = (β 1n , β 2n , . . . , β rn )} ∞ n=1 be a sequence of vectors in (Q + ) r such that lim n→∞βn =ᾱ and, for each positive integer n, denote by X B n the vector field of CP 2 given by the homogeneous 1-form Ω(β n ) defined as in the proof of Proposition 4.5. Notice that each vector field X B n has the following rational first integral: where e n is the least common multiple of the denominators of the irreducible expressions of β 1n , β 2n , . . . , β rn and Hence, the restriction of X B n to the affine chart given by the complement of the line Z = 0 has a WAI first integral. Notice that the dicritical configurations of the vector fields X B n , n ≥ 1, contain the configuration of infinitely near points of Remark 3.4), and also that Let P B n be the pencil of curves defined by the equations where (λ 1 : λ 2 ) ∈ CP 1 . By Proposition 3.3, the configuration of base points of this pencil, which coincides with D(X B n ) [22, Corollary 1], is given by where {S i } ∪ L B in is the configuration of base points of the (local) pencil (at S i ) defined by the non-zero linear combinations of u enβ in and t δ B in , where u = 0 (respectively, t = 0) is a local equation of the strict transform of C i at S i (respectively, the exceptional divisor containing S i ) and Notice that, since (u, t) is a regular system of parameters of the local ring at S i [11, Lemma 1], the proximity graph of the configuration Now consider the configuration of infinitely near points of CP 2 The reduction of singularities of X shows that B ⊆ E ∞ (X ) becauseᾱ is taken to be generic. In addition, S 1 , S 2 , . . . , S r are the unique common points of E ∞ (X ) and the surface V obtained by blowing-up the points in ∪ r i=1 BP(P i ). This statement is a consequence of the forthcoming Lemma 4.7, [22, Lemma 1] (where it is proved that under our conditions the operations "blowing-up" and "taking associated 1-forms" commute) and the fact that the local equation of the strict transform of X at any point of V is the limit (when n tends to infinity) of the local equations of the strict transforms of X B n . To finish our proof and give a complete description of E ∞ (X ). We notice that by [22, Lemma 1] the 1-form e n β in t du − δ B in u dt, 1 ≤ i ≤ r, locally defines the strict transform of X B n at S i , where u = 0 is a local equation of the strict transform of C i at S i and t = 0 is a local equation of the exceptional divisor. Then, taking limits, the 1-form defines the strict transform of X at S i . From this local expression of the vector field, it is straightforward to deduce that the configuration of infinitely near points to S i belonging to E ∞ (X ) is an infinite chain whose proximity graph is Prox(δ i /α i ). In fact, this chain is infinite because Condition (3) in Definition 4.1 implies the irrationality of δ i /α i for all i ∈ {1, 2, . . . , r}.
We conclude this section by stating and proving the above used Lemma 4.7, which allows us to prove that, with the notation as in the proof of the above theorem, the surface V obtained by blowing-up the points in ∪ r i=1 BP(P i ) has no points in E ∞ (X ) different from the S i 's, 1 ≤ i ≤ r.
The proof of Lemma 4.7 will require to use some objects of algebraic geometry which we briefly summarize for convenience of the reader. We will consider divisors on a surface W and the Nerón-Severi group of W , NS(W ), which is the group of numerical (equivalently, linear, in our case) equivalence classes [C] of divisors C on W . Recall that two divisors in W are linearly equivalent whenever its difference is principal [29]. One can transform this group into an R-linear space by using tensorial product, NS(W ) ⊗ R, and then the cone of curves of W is defined as The topological closure of NE(W ) in NS(W ) ⊗ R, NE(W ), is the so-called closed cone of curves of W . Extremal rays of cones NE(X) of algebraic varieties X are crucial objects in the model minimal program in algebraic geometry [35,31,7]. Lemma 4.7. Keep the notation as in Theorem 4.6 and its proof. Let π : W → CP 2 be the composition of the blowing-ups centered at the points of the dicritical configuration, D(X B n ), of the vector field of CP 2 defined by Ω(β n ). Consider the set {Q 1 , Q 2 , . . . , Q r } of maximal points of D(X B n ) and the union Γ = r i=1Ẽ Q i of the strict transforms on W of the exceptional divisors obtained by blowing-up the points Q i , 1 ≤ i ≤ r.
Then, the singularities of the strict transform of X B n on W which belong to the exceptional locus of π, but not to Γ, are simple and the local equation of X B n at any of them has the form where a, b ∈ Q + ∪ {0}, a + b = 0 and, t 1 = 0 (respectively, t 2 = 0) is the local equation, at the singularity, of the strict transform of an irreducible exceptional divisor (respectively, the line at infinity Z = 0).
Proof. First of all notice that, by Proposition 3.3, the dicritical configuration of X B n and the base points configuration of P B n coincide; i.e., D(X B n ) = BP(P B n ). Let H be an arbitrary irreducible component of a curve of the pencil P B n , different from Z = 0, and denote byH its strict transform on W . To prove the lemma, it is enough to show that, outside Γ,H has no singularity on the exceptional locus of π.
Notice that the self-intersection ofH cannot be negative because, in this case, the class ofH in N S(W ) ⊗ R would generate an extremal ray of the closed cone of curves of W [32, Lemma 1.22], and this is not possible by [11,Theorem 3]. Hence,H 2 ≥ 0.
The pencil P B n defines a rational map CP 2 · · · → CP 1 , that is a morphism from an open set of CP 2 to CP 1 which cannot be extended to any larger open set. The elimination of its indeterminacies induces a morphism f : W → CP 1 contracting to a point the strict transform of any curve in the pencil [6,Theorem II.7]. In particular, it contractsH. The morphism f is defined by global sections of the invertible sheaf [29] associated to the divisor D on W given by the strict transform of a general curve of the pencil P B n . Notice that D 2 = 0 because the strict transforms on W of two different general curves of the pencil do not meet. Then, D ·H = 0 (andH 2 ≥ 0 by the previous paragraph). HenceH must be linearly equivalent to D [6, Lemma III.9].
To conclude the proof, we take into account that the unique exceptional irreducible divisors which are not contracted by the morphism f are the irreducible components of Γ [11, Lemma 1 (iii)], and this implies that, if E is the strict transform of an irreducible exceptional divisor, thenH · E = D · E > 0 if and only if E is contained in Γ. This proves thatH can only have singularities on Γ and the lemma.

The algorithm
In this last section we state the previously mentioned algorithm which computes a first integral of planar polynomial vector fields having a DPWAI first integral with generic exponents.
Darboux proved in [16] that if a polynomial vector field X of degree d has at least d+1 2 + 1 invariant algebraic curves, then it has a Darboux first integral, which can be computed using these invariant algebraic curves. This result was improved in [15] (see also [14]). Next we state the Darboux theorem.
Theorem 5.1. Suppose that a polynomial differential system X as in (2) of degree d admits r irreducible invariant algebraic curves f i (x, y) = 0 with respective cofactor k i (x, y), 1 ≤ i ≤ r. Then: (a) There exist λ i ∈ C, not all zero, such that if and only if the function is a first integral of the system X.
(b) If r = d+1 2 + 1, then there exist λ i ∈ C, not all zero, such that As a consequence of the above result, finding invariant algebraic curves is an important tool in the study of Darboux integrability; notice also that it is a very hard problem.
Next we present Theorem 5.2 which, together with some previous results, allows us to state our algorithm. This algorithm provides enough invariant curves to apply Theorem 5.1 and determine a Darboux first integral in case the input we supply is a polynomial vector field having a DPWAI first integral with generic exponents.
The mentioned theorem will use a cluster (K, m K ) attached to any finite chain K of infinitely near points of CP 2 . Recall that a configuration K = {Q 1 , Q 2 , . . . , Q s } is a chain if Q i , i > 1, belongs to the exceptional divisor created by Q i−1 . The sequence of positive integers m K := (m Q ) Q∈K is defined as follows: m Q = 1 if Q is the maximal point of K and m Q = m R otherwise, where the sum is taken over the set of points R in K which are proximate to Q. Also, given an arbitrary configuration C and any point Q ∈ C, we shall denote by C Q the finite chain defined by those points R in C such that Q is infinitely near to R.
Theorem 5.2. Let X be a projective vector field and α 1 , α 2 , . . . , α r real numbers as in Theorem 4.6. Keep the above notation and consider the clusters Then the following equalities hold: where κ i denotes the maximum index j such that the strict transform of the line at infinity passes through L ij . Moreover, C i is the unique curve in the linear system L κ i j=1 m L ij Proof. Let U be the surface obtained after blowing-up the points in BP(P i ). Consider the line at infinity L and two different general curves ∆ 1 and ∆ 2 of the pencil P i . Then, their strict transforms on U ,L,∆ 1 and∆ 2 , do not meet. Therefore∆ 1 ·∆ 2 = 0 and∆ 1 ·L = 0. Both equalities prove, respectively, the equalities (i) and (ii) after noticing that∆ 1 and ∆ 2 are linearly equivalent to the strict transform of C i . We conclude the proof by noticing that our last assertion follows from (i) and Bézout Theorem [6, I.9 (a)]. Now we present our algorithm which, applied to a polynomial vector field, computes candidates to be the polynomials f 1 , f 2 , . . . , f r appearing in a DPWAI first integral. Theorems 4.6 and 5.2 prove that when the input has a DPWAI first integral with generic exponents, the output will be the mentioned polynomials f i .
We will need the following notation: given an arbitrary configuration C we define, for each maximal point Q of C, the integer I Q (C) := d Q (C) 2 − P ∈C Q m 2 P , where m C Q = (m P ) P ∈C Q and d Q (C) := m P , the sum being taken over the points P in C Q such that the strict transform of the line at infinity passes through P . (1) Compute an homogeneous 1-form defining the complex projectivization X of X.
(2) Compute the set Ω ′ consisting of the points Q in the singular configuration S(X ) which are infinitely near to a point of the line at infinity. (3) Let Q 1 , Q 2 , . . . , Q ℓ be the maximal points of Ω ′ . For every i ∈ {1, 2, . . . , ℓ} compute the maximal configuration Ω i of points P infinitely near to Q i satisfying the following conditions: (a) P is free, (b) P ∈ E ∞ (X ) (that is, P is a simple singularity of the strict transform of the vector field X whose associated quotient of eigenvalues is a positive irrational number), (c) I P (E ∞ (X )) ≥ −1.
Our procedure to decide about DPWAI integrability of a vector field X has two steps. First we run Algorithm 5.3 with input X and, when the output is not 0, we get r candidates to be invariant algebraic curves of X given by equations f i = 0, 1 ≤ i ≤ r. When these curves are invariant by X, we compute their cofactors and then, we check whether there exist values λ i ∈ R + , 1 ≤ i ≤ r, satisfying Equality (11). Notice that we only need to solve a homogeneous linear system of equations and this linear system has d+1 2 equations, corresponding with the number of monomials of a polynomial of degree d − 1 in two variables, and r unknowns, say the λ i 's. If such values λ i exist, then (12) is a first integral of the system X.
When the input X has a DPWAI first integral with generic exponents, we also obtain its extended resolution of singularities over the line at infinity. Otherwise, X has not a DPWAI first integral with generic exponents, the output of Algorithm 5.3 could be 0 or some not necessarily invariant curves by X. However, the output of Algorithm 5.3 could also provide enough invariant curves and then, we would obtain a DPWAI first integral by means of Theorem 5.1.
We conclude this paper with an example where we detail our procedure to determine a Darboux first integral of the mentioned class of polynomial vector fields.
Therefore, the proximity graph of the extended reduction of singularities over the line at infinity, E ∞ (X ), is obtained from that in Figure 2 by adding three infinite chains J 1 , J 2 and J 3 over S 1 , S 2 and S 3 such that the proximity graph of J ). To complete our example we show, in Figure 3, the bottom part of the proximity graph of the chain J 1 ∪ {S 1 }, without labels. A similar procedure provides the remaining chains.