Weird assumption requirement in definite_integral

asked 2024-05-24 12:27:32 +0200

proy gravatar image
definite_integral(cos(y), y, 0, 3-x)

Instead of sin(3-x) it gives "ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help (example of legal syntax is 'assume(x-3>0)', see assume? for more details) Is x-3 positive, negative or zero?"

When the lower bound is not 0 (1 or something else), everything works correctly.

What is the reason for this and how to fix it?

edit retag flag offensive close merge delete


This is reproducible in Maxima :

(%i1) integrate(cos(y),y,0,x-3);
Is x - 3 positive, negative or zero?

(%o1)                             sin(x - 3)
(%i2) integrate(cos(y),y,%pi/2,x-3);
(%o2)                           sin(x - 3) - 1

You may try to find iftis hasn't yet been reported in the (long) list of (Maxima) bugs for definite integrals and, if so, open yt another tickt.

You may also pragmatically work around :

sage: integrate(cos(x),x,0,3-k, algorithm="giac")
sin(-k + 3)
sage: integrate(cos(x),x,0,3-k, algorithm="fricas")
-sin(k - 3)
sage: integrate(cos(x),x,0,3-k, algorithm="sympy")
-sin(k - 3)
Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-05-24 23:06:06 +0200 )edit