Computing A and B such that A*(\partial f / \partial x) + B*(\partial f / \partial y) = 1.
> fxpartial:=diff(f(x,y),x);
> fypartial:=diff(f(x,y),y);
Here before using the GCD function on polynomials, we make the following adjustment.... namely we assume that B = y *C and then solve for A and C such that
A*fxpartial + C*2(x^3 + x*c1 + c2) = 1.
That we we are taking the gcd with respect to just one variable, namely x.
> lydia:=2*(x^3 + x*c1 + c2);
> gcdex(fxpartial,lydia,x, 's', 't');
> A:=simplify(s);
> B:=y*simplify(t);
> Ap:=A^p;
> Bp:=B^p;
>