Ask Your Question

Revision history [back]

The default backend for symbolic integration is Maxima. You can find out more about the Maxima interface here:

In Maxima, there is a global flag called logabs which changes the default behavior when integrating functions like 1/x or tan(x). Here is how you can get Maxima (via Sage) to return the anti-derivative of 1/x on its full natural domain:

sage: x=var('x')
sage: maxima.eval('logabs:true')
sage: maxima.integrate(1/x,x)
sage: maxima.integrate(tan(x),x)

I don't know if there is currently a way to accomplish this through the Sage integrate function directly. I do know that for definite integrals, log(abs(x)) is used as an anti-derivative of 1/x:

sage: integrate(1/x, x)
sage: integrate(1/x, x, -2, -1)

which is correct.