## #2081 integrate(t*cos(a*t^2 + b*t + c), t, 0, 1) => division by 0

closed
nobody
5
2014-09-26
2010-09-23
No

integrate (t*cos(a*t^2 + b*t + c), t, 0, 1);
=> Division by 0

Maxima version: 5.22.1
Maxima build date: 22:6 8/11/2010
Host type: i686-redhat-linux-gnu
Lisp implementation type: CLISP
Lisp implementation version: 2.48 (2009-07-28) (built 3459348196) (memory 3490574775)

## Discussion

• Barton Willis - 2010-09-24

Related, I think:

rectform(integrate (t*cos(a*t^2 + b*t + c), t)) --> division by zero

• Dieter Kaiser - 2010-10-02

The example of the last posting is related to the reported bug ID: 3079975 - rectform(atan2(y,0)) -> division by zero.

Dieter Kaiser

• Dieter Kaiser - 2010-10-02

The bug rectform(atan2(y,0)) -> division by zero has been fixed in revision 1.37 or rpart.lisp. The following example now works:

(%i1) rectform(integrate (t*cos(a*t^2 + b*t + c), t));

(%o1) -(sqrt(abs(a))*sqrt(4*a^2*t^2+4*a*b*t+b^2)
*(((1024*(gamma_incomplete(1/2,
(4*%i*a^2*t^2+4*%i*a*b*t
+%i*b^2)
/(4*a))
[...] and a lot of more terms

But the division by 0 for the example of this bug report is still present:

integrate (t*cos(a*t^2 + b*t + c), t, 0, 1);
Division by 0
-- an error. To debug this try: debugmode(true);

Dieter Kaiser

• Dieter Kaiser - 2010-10-02

Maxima can integrate the indefinite integral of the example of this bug report. The difference is the flag generate-atan2 which is set to NIL in the function antideriv, when calling sinint to integrate the problem:

(%i4) integrate(t*cos(a*t^2+b*t+c),t),?generate\-atan2:false;

Division by 0
-- an error. To debug this try: debugmode(true);

(%i5) integrate(t*cos(a*t^2+b*t+c),t),?generate\-atan2:true;
(%o5) -(sqrt(abs(a))*sqrt(4*a^2*t^2+4*a*b*t+b^2)
*(((2048*gamma_incomplete(1/2,
(4*%i*a^2*t^2+4*%i*a*b*t+%i*b^2)
/(4*a))
[...] and more terms

Dieter Kaiser

• Dieter Kaiser - 2010-10-02

After revision 1.38 of rpart.lisp we get a further problem with the example of this bug report:

(%i3) integrate (t*cos(a*t^2 + b*t + c), t, 0, 1),ratprint:false;
Is b positive or negative?
p;
sign: argument cannot be imaginary; found %i
-- an error. To debug this try: debugmode(true);

Now, limit has a problem, because it tries to get the sign of a complex expression.

Dieter Kaiser

• Dieter Kaiser - 2010-10-02

With revision 1.102 of limit.lisp we now get a result for the integral of this example:

(%i1) integrate (t*cos(a*t^2 + b*t + c), t, 0, 1),ratprint:false;
Is b positive or negative?
p;
(%o1) (((gamma_incomplete(1/2,%i*b^2/(4*a))
+gamma_incomplete(1/2,-%i*b^2/(4*a)))
*sqrt(abs(a))*b*sin(atan2(b^2/a,0)/2)
+(%i*gamma_incomplete(1/2,%i*b^2/(4*a))
-%i*gamma_incomplete(1/2,-%i*b^2/(4*a)))
*sqrt(abs(a))*b*cos(atan2(b^2/a,0)/2)
+(-2*gamma_incomplete(1,%i*b^2/(4*a))
-2*gamma_incomplete(1,-%i*b^2/(4*a)))
*a)
*sin((4*a*c-b^2)/(4*a))
+((%i*gamma_incomplete(1/2,%i*b^2/(4*a))
-%i*gamma_incomplete(1/2,-%i*b^2/(4*a)))
*sqrt(abs(a))*b*sin(atan2(b^2/a,0)/2)
+(-gamma_incomplete(1/2,%i*b^2/(4*a))
-gamma_incomplete(1/2,-%i*b^2/(4*a)))
*sqrt(abs(a))*b*cos(atan2(b^2/a,0)/2)
+(2*%i*gamma_incomplete(1,-%i*b^2/(4*a))
-2*%i*gamma_incomplete(1,%i*b^2/(4*a)))
*a)
*cos((4*a*c-b^2)/(4*a)))
/(8*a^2)
-(((gamma_incomplete(1/2,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
+gamma_incomplete(1/2,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*sqrt(abs(a))*b*sin(atan2((b^2+4*a*b+4*a^2)/a,0)/2)
+(%i*gamma_incomplete(1/2,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
-%i*gamma_incomplete(1/2,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*sqrt(abs(a))*b*cos(atan2((b^2+4*a*b+4*a^2)/a,0)/2)
+(-2*gamma_incomplete(1,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
-2*gamma_incomplete(1,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*a)
*sin((4*a*c-b^2)/(4*a))
+((%i*gamma_incomplete(1/2,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
-%i*gamma_incomplete(1/2,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*sqrt(abs(a))*b*sin(atan2((b^2+4*a*b+4*a^2)/a,0)/2)
+(-gamma_incomplete(1/2,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
-gamma_incomplete(1/2,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*sqrt(abs(a))*b*cos(atan2((b^2+4*a*b+4*a^2)/a,0)/2)
+(2*%i*gamma_incomplete(1,-(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a))
-2*%i*gamma_incomplete(1,(%i*b^2+4*%i*a*b+4*%i*a^2)/(4*a)))
*a)
*cos((4*a*c-b^2)/(4*a)))
/(8*a^2)

The numerical value for a=3, b=2, and c=1 is correct:

(%i2) rectform(float(psubst([a=3,b=2,c=1],%)));
(%o2) -.1134426855743835

Closing this bug report as fixed.
Dieter Kaiser

• Dieter Kaiser - 2010-10-02
• status: open --> closed