Open 56048686-9665-4c5e-973e-6c3add3aa805 opened 12 years ago
Yep, sage is trying to learn how to translate "conjugate" and gets tripped up. The following does work because it primes the dictionary.
sage: integrate(conjugate(Ei((I+1)*x)),x)
integrate(-conjugate(Ei(-(I + 1)*x)), x)
sage: integrate(sin(x)*exp(x)/x, x)
-1/4*I*conjugate(Ei(-(I - 1)*x)) + 1/4*I*conjugate(Ei((I + 1)*x)) + 1/4*I*Ei(-(I - 1)*x) - 1/4*I*Ei((I + 1)*x)
The problem is that sage tries to learn what conjugate is from this expression:
sage: expr=maxima("conjugate(gamma_incomplete(0,(-%i-1)*x))")
conjugate(gamma_incomplete(0,(-%i-1)*x))
but its conversion to SR pulls out a minus sign:
sage: SR(expr)
-conjugate(Ei((I + 1)*x))
so in max_to_sr line 1530 text-based fallback we find that the corresponding operator is:
sage: SR(expr).operator()
<built-in function mul>
Once conversion of multiplication is broken, we of course get all kinds garbage. A warning for exactly this problem is in the source.
Work-around for this particular issue: Prepopulate sage_op_dict with conjugate
A better solution would be to once and for all solve this problem by initializing sage_op_dict from the same source where the text-based interface gets its knowledge from.
Changed keywords from none to integral
Something seems to be going wrong in maxima_lib:
This happens in 5.0 and beyond. Unfortunately I don't have a 4.8 at hand so I can't track it down before that.
Strangely enough, if you do it again, you get a different error:
So -- and this might be independent -- something's stateful which probably shouldn't be.
CC: @kcrisman
Component: symbolics
Keywords: integral
Issue created by migration from https://trac.sagemath.org/ticket/13071