Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/calculus/notes.txt
4057 views
1
On 4/22/07, Ondrej Certik <[email protected]> wrote:
2
> As to the extensibility - I think it would be quite difficult to
3
> extend for example Maxima's limits facility (there are some limits
4
> that Maxima cannot do, but SymPy can), or Maxima's differential
5
> equations solver module. Either it would have to be done in LISP, or
6
> rewrite the whole module to python, neither of which I find easy. Or
7
> is there a better approach?
8
9
I had in mind the following iterative approach:
10
11
(1) Implement the basic limit formulas for products, sums, quotients, etc.,
12
in Python.
13
(2) This reduces computing limits of symbolic expressions to computing
14
the limits of the leaves in the tree, i.e., symbolic variables, constants, and
15
primitive functions (like sinh, exp, log, erf).
16
(3) Limits of symbolic variables and constants are trivial.
17
(4) For some special functions one writes an optional method _limit_
18
that computes the limit of that special function at a point from a given
19
direction. The default _limit_ method in the base class computes the
20
limit using maxima. So for each function for which you want better
21
speed or a different behavior from maxima, you just fill in the _limit_ method.
22
23
Exactly the steps above would also work for symbolic differentiation.
24
(Integration is a completely different story.)
25
26
Ondrej doesn't this will work (I totally disagree):
27
28
"I don't think that would work for limits (it should work for
29
differentiation though) except some simple cases. As an example, let's
30
take this limit, that Maxima cannot do:
31
32
limit((5**x+3**x)**(1/x), x, infty)
33
34
(if you type this in SymPy, you will get 5, because we use the Gruntz
35
algorithm, as described here:
36
http://sympy.googlecode.com/svn/trunk/doc/gruntz.pdf). The only thing
37
that occurs to me how to fix maxima is to match the expression and
38
return 5 immediatelly, or implement the whole algorithm from scratch,
39
but then you will just write the same code as we did for SymPy.
40
41
Integration is quite easy - just match the expression and return a
42
table integral. The general Risch algorithm is difficult, but I think
43
Axiom can do it."
44
45