Integrate v Derivative Implementation for Symbolics

61 views
Skip to first unread message

MartinX

unread,
Jul 27, 2012, 3:25:01 PM7/27/12
to sage-...@googlegroups.com
I have had a go at implementing trac #3401, symbolic Li, and would like to override the behaviour of integrate(), but I can't see how to do it.   We have the  _derivative_  method in BuiltinFunction to define the derivative of a function but no equivalent _integrate_ method.  Is there reason why this is so? 

kcrisman

unread,
Jul 27, 2012, 4:24:35 PM7/27/12
to sage-devel
I don't know that this is something we have - integrate just goes
through Maxima (or Sympy or whatever if you choose a different
algorithm). Pynac doesn't support integrate methods. I suppose if
one were sufficiently clever one could do this (_integrate_), but that
shouldn't hold up #3401, which should be much easier now that #11143
is ready to go in - that is, if Volker or someone can verify which
patches should actually be applied there ;-)

Also, how would the integral of Li be different from the integral of
li - by a linear term, presumably? If we send it to Maxima
appropriately, this would probably solve the issue (not because Maxima
has both Li and li, but because we could perhaps get around that).
Why don't you put up your code at #3401 and we'll see if there is a
way to massage this into shape!

MartinX

unread,
Jul 27, 2012, 4:44:17 PM7/27/12
to sage-...@googlegroups.com
Yes,  I have simply tweaked log_integral, to get Li and it is the linear term that is my headache.  I can't see Li in any of the integrators, but I can get a valid integration if I return Li as li(x)-li(2) in _eval(). But to me that seems untidy. It would be nice if _eval returned Li(x) but  pass to integrate() li(x)-li(2).  I'll post code to trac when I get an account set up.  The #11143 patches I downloaded, applied ok on 5.2.rc02, I'll see if there are any updates but given I am a newbie with Mercurial I may go horribly wrong.

rjf

unread,
Jul 28, 2012, 5:03:24 PM7/28/12
to sage-...@googlegroups.com


On Friday, July 27, 2012 12:25:01 PM UTC-7, MartinX wrote:
I have had a go at implementing trac #3401, symbolic Li, and would like to override the behaviour of integrate(), but I can't see how to do it.   We have the  _derivative_  method in BuiltinFunction to define the derivative of a function but no equivalent _integrate_ method.  Is there reason why this is so? 

It may be related to the fact that derivatives for nearly all special functions of physics (Like Li) can be listed, one per function,
 on a few pages of a reference book.  Yet integral tables are hundreds of pages long, and even then, they are incomplete.

RJF
Reply all
Reply to author
Forward
0 new messages