I think the bug is in the routine integrate-use-rootsof:

(defun integrate-use-rootsof (f q variable &aux qprime ff qq (dummy (make-param)) lead)

;; p2e is squarefree polynomial in cre form, p1e is lower degree

(setq lead (p-lc q)) <--- Problem

(setq qprime (disrep (pderivative q (p-var q))))

(setq ff (disrep f) qq (disrep q))

`((%lsum) ((mtimes)

,(div* (mul* lead (subst dummy variable ff))

(subst dummy variable qprime))

((%log) ,(sub* variable dummy))) ,dummy

(($rootsof) ,qq)))

There is no DISREP for the leading coefficient of q, but for the example of this bug report we get an CRE expression as a coefficient. When we do a DISREP

(setq lead (disrep (p-lc q)))

the integral of this bug report will work:

(%i4) integrate_use_rootsof : true;

(%o4) true

(%i5) integrate((d*QA^2+2*c*QA+3*b)/(g*QA^3*R+d*QA^2+c*QA+b),QA);

(%o5) 'lsum((%r2^2*d+2*%r2*c+3*b)*g*log(QA-%r2)*R/(3*%r2^2*g*R+2*%r2*d+c),%r2,

rootsof(g*QA^3*R+d*QA^2+c*QA+b))

The testsuite has no examples for this type of integrals, but the example of the documentation will work as expected with this change.

Dieter Kaiser