## #1832 Incorrect Integral with option integrate_use_rootsof :true

closed
nobody
None
5
2010-03-28
2009-12-02
Anonymous
No

This integral previously crashed maxima, see bug 2906049. Now it gives the wrong answer.

integrate_use_rootsof : true;
integrate((d*QA^2+2*c*QA+3*b)/(g*QA^3*R+d*QA^2+c*QA+b),QA);
yields:
lsum(((%r1^2*d+2*%r1*c+3*b)*g*log(QA-%r1)*R)/(3*%r1^2*g*R+2*%r1*d+c),%r1,rootsof(g*QA^3*R+d*QA^2+c*QA+b))

lsum(((%r1^2*d+2*%r1*c+3*b)*log(QA-%r1))/(3*%r1^2*g*R+2*%r1*d+c),%r1,rootsof(g*QA^3*R+d*QA^2+c*QA+b))

I'm using
Maxima version: 5.20post
Maxima build date: 9:7 12/2/2009
Host type: i686-pc-linux-gnu
Lisp implementation type: CLISP
Lisp implementation version: 2.44.1 (2008-02-23) (built 3427367244) (memory 3468751644)

## Discussion

• Dieter Kaiser - 2009-12-02

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

• Raymond Toy - 2010-03-26

I think multiplying by the leading factor is wrong. I think the algorithm is basically a partial fraction expansion of N(x)/D(x) = sum(A(n)/(x-r(n)), n=1,N) where r(n) is a root of D(x). The constant A(n) can be determined by computing limit(N(x)*D(x)/(x-r), x, r), but that's basically N(r)*at(diff(D(x),x), [x=r]). The code basically does this, but multiplies by the leading factor.

• Raymond Toy - 2010-03-28

Fixed in sinint.lisp, rev 1.10

• Raymond Toy - 2010-03-28
• status: open --> closed