I had a look at wolfram alpha and I have got as a reference the following result:

integral (d x^2+2 c x+3 b)/(g r x^3+d x^2+c x+b) dx

= RootSum[#1^3 g r+#1^2 d+#1 c+b&,

(#1^2 d log(x-#1)+3 b log(x-#1)+2 #1 c log(x-#1))/(3 #1^2 g r+2 #1 d+c)&]+constant

This corresponds to your solution. Maxima has an extra factor g*r.

So, the algorithm now is working, but it seems to be wrong. The extra factor is the leading coefficient of the denominator. This factor is extracted and multiplied into the result by the algorithm.

Dieter Kaiser