JSFH This maple file illustrates the use of the procedure DarbouxPolynomials of the package RationalFirstIntegrals writen by A. Bostan, G. Ch\303\250ze, T. Cluzeau, and J.-A. Weil. For explanations and details about the algorithms behind the procedure, see our related paper: Efficient algorithms for computing rational first integrals of planar polynomial vector fields. restart: with(RationalFirstIntegrals); NyxJM0RhcmJvdXhQb2x5bm9taWFsc0c2IklDRGV0ZXJtaW5pc3RpY1JhdGlvbmFsRmlyc3RJbnRlZ3JhbEdGJEk9R2VuZXJpY1JhdGlvbmFsRmlyc3RJbnRlZ3JhbEdGJEk3R3Vlc3NNaW5pbWFsUG9seW5vbWlhbEdGJEk/SGV1cmlzdGljUmF0aW9uYWxGaXJzdEludGVncmFsR0YkSTVQYWRlSGVybWl0ZUhldXJpc3RpY0dGJElDUHJvYmFiaWxpc3RpY1JhdGlvbmFsRmlyc3RJbnRlZ3JhbEdGJEksU2ltcGxpZnlSRklHRiRJKHNpbXBsaTFHRiRJKHNpbXBsaTJHRiQ= Consider the jacobian derivation associated with the polynomial: f:=(y*x-1)*(x-y^2)*(y-x-1); KigsJiomSSJ4RzYiIiIiSSJ5R0YmRidGJyEiIkYnRicsJiokRigiIiNGKUYlRidGJywoRihGJ0YlRilGKUYnRic= Namely, the planar polynomial vector field {x'=A(x,y), y'=B(x,y)} by giving the polynomials A and B: A:=simplify(-diff(f,y)); B:=simplify(diff(f,x)); LDYqJkkieEc2IiIiI0kieUdGJUYmISIkKiZGJCIiIkYnIiIkIiIlKiRGJEYrRioqJkYkRiZGJ0YqISIjKiZGJEYqRidGJkYoKiRGJEYmRioqJkYkRipGJ0YqRiYqJEYnRiZGKEYkRipGJ0Ym LDYqJkkieEc2IiIiIkkieUdGJSIiJCIiIyokRiciIiUhIiIqJkYkRilGJ0YmISIkKiZGJEYmRidGKUYpKiRGJ0YoRiYqJkYkRiZGJ0YmISIjKiRGJ0YpRixGJEYpRidGLEYmRiY= We define the associated derivation: DD:=proc(f) A*diff(f,x)+B*diff(f,y) end: Let us search for all irreducible Darboux polynomials of the derivation DD of degree at most 3. We need a point pt for which A(pt,y) <> 0: pt:=0; check_pt:=eval(A,x=pt); IiIh LCYqJEkieUc2IiIiIyEiJEYkRiY= We first check using for example the ProbabilisticRationalFirstIntegral procedure that it does not admit a rational first integral of degree at most 3. ProbabilisticRationalFirstIntegral(A,B,pt,[-1,1],3); USVOb25lNiI= We run our Darboux polynomial procedure: DP:={DarbouxPolynomials(A,B,pt,3)}; PCMsKEkieUc2IiIiIkkieEc2IiEiIiEiIiIiIg== We check that it is a Darboux polynomial. Lambda:=normal(DD(DP[1])/DP[1]); LC4qJkkieEc2IiIiIkkieUdGJSIiIyEiJCokRiciIiQhIiIqJEYkRihGJiomRiRGJkYnRiZGKEYnRihGLEYm We find only one irreducible Darboux polynomial. However by construction, we know that the two other factors of f are also Darboux polynomials so that we miss them. The reason why we miss these two Darboux polynomials is that we are not in a "generic" situation (for more explanations, see our paper). Let us make a change of coordinates in order to be in a "generic situation". a:=2; IiIj Aa:=simplify(subs(x=x+a*y,A)-a*subs(x=x+a*y,B)); LDwqJkkieEc2IiIiI0kieUdGJUYmISIkKiZGJCIiIkYnIiIkISM3KiRGJyIiJSEjNSokRiRGK0YqKiZGJEYmRidGKiIjNSomRiRGKkYnRiYiI0AqJEYnRisiIikqJEYkRiZGKiomRiRGKkYnRipGMiokRidGJiIjOkYkRihGJyEiI0Y7Rio= Ba:=simplify(subs(x=x+a*y,B)); LDYqJkkieEc2IiIiIkkieUdGJSIiJCIiIyokRiciIiVGKComRiRGKUYnRiYhIiQqJkYkRiZGJ0YpISM1KiRGJ0YoISIoKiZGJEYmRidGJiEiIyokRidGKSEiJkYkRilGJ0YoRiZGJg== DPa:={DarbouxPolynomials(Aa,Ba,pt,3)}; PCUsKCIiIkYkSSJ4RzYiRiRJInlHRiZGJCwoIyEiIiIiI0YkKiZGJUYkRidGJCNGJEYrKiRGJ0YrRiQsKEYuRiRGJUYqRichIiM= Now we correctly find 3 irreducible Darboux polynomials of degree at most 3. We perform the inverse change of coordinates to get all irreducible Darboux polynomials of the original polynomial vector field. DPgood:={seq(simplify(subs(x=x-a*y,DPa[i])),i=1..nops(DPa))}; PCUsJiMhIiIiIiMiIiIqJkkieEc2IkYnSSJ5R0YqRicjRidGJiwoRidGJ0YpRidGK0YlLCYqJEYrRiZGJ0YpRiU= We can chech that they are Darboux polynomials by computing their cofactors. Lambdagood:={seq(normal(DD(DPgood[i])/DPgood[i]),i=1..3)}; PCUsLComSSJ4RzYiIiIiSSJ5R0YmIiIjISIiKiRGKCIiJEYsKiRGJUYpISIjKiRGKEYpRi5GJUYqLC5GJCEiJEYrRipGLUYnKiZGJUYnRihGJ0YpRihGKUYqRicsMkYkIiIlRitGLkYtRidGMkYuRi9GKUYlRidGKEYuRidGJw== JSFH