The following Maple session shows a computation using this method, on a contrived example where we start with the answer we desire at the end.

F := 1/2*log(x^2-2) + 1/3*log(x+1) - 3/5*log(x^7+x+1);

f:= normal(diff(F,x));

a := numer(f);

b :=denom(f);

resultant( a - z*diff(b,x), b, x);

factor(");

solve(",z);

{"};

gamma := ":

Error, attempting to assign to `gamma` which is protected

gam := ":

v := NULL;

for i to 3 do

v := v, gcd( a - gam[i]*diff(b,x), b );

od;

i := 'i';

sum( gam[i]*log(v[i]), i=1..3);

Thu Nov 16 13:46:20 PST 1995