Opened 10 years ago

Last modified 8 years ago

#13221 needs_work defect

Limit should not depend on dummy variable.

Reported by: Karl-Dieter Crisman Owned by: Burcin Erocal
Priority: minor Milestone: sage-pending
Component: calculus Keywords:
Cc: Andrey Novoseltsev Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Karl-Dieter Crisman)

See #12438 as well.

Somewhere between Sage 4.4.4 and 4.8 we changed behavior - not correctly, I'd say.

$ Downloads/sage-4.8/sage
----------------------------------------------------------------------
| Sage Version 4.8, Release Date: 2012-01-20                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: f(x) = x^2
sage: limit(f,x=1)
x |--> 1
sage: limit(f(x),x=1)
1
sage: 
Exiting Sage (CPU time 0m1.15s, Wall time 0m10.57s).
$ Desktop/sage-4.4.4-mcbc/sage
----------------------------------------------------------------------
| Sage Version 4.4.4, Release Date: 2010-06-23                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
Loading Sage library. Current Mercurial branch is: hackbranch
sage: f(x) = x^2
sage: limit(f,x=1)
1
sage: limit(f(x),x=1)
1

Change History (10)

comment:1 Changed 10 years ago by Andrey Novoseltsev

Cc: Andrey Novoseltsev added

comment:2 Changed 10 years ago by Karl-Dieter Crisman

Description: modified (diff)

comment:3 Changed 10 years ago by Andrey Novoseltsev

The problem is that limit ends with

return ex.parent()(l)

and functions depending on certain variables have limits depending on the same variables. I wonder where else such a behaviour may pop-up and what would be a good generic way to handle it.

comment:4 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:5 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:6 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:7 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:8 Changed 8 years ago by Ralf Stephan

Milestone: sage-6.4sage-duplicate/invalid/wontfix
Status: newneeds_review

I don't see this behaviour anymore. Please confirm and close.

comment:9 Changed 8 years ago by Nils Bruin

Milestone: sage-duplicate/invalid/wontfixsage-pending
Status: needs_reviewneeds_work

I do get the reported behaviour in 6.5beta

sage: f(x) = x^2
sage: limit(f,x=1)
x |--> 1

This is coming from the fact that sage does this transformation (well, it's a side-effect of the implementation above):

limit( E.function(t), t=1) ---> E.limit(t=1).function(t)

That transformation really has no merit whatsoever. The thing that's hard about this is that the type of E.function(t) is just SymbolicExpression. The callable bit is entirely stored in the parent.

Another way would be to subclass to CallableSymbolicExpression? and override things like limit and integral to produce errors instead (or do something useful if there is a reasonable choice).

Arithmetic on callable expressions in general seems pretty sane:

sage: f(x)=x^2
sage: g(y)=1+y
sage: f+g
(x, y) |--> x^2 + y + 1

comment:10 Changed 8 years ago by Andrey Novoseltsev

And why should it be (x,y) instead of (y,x)? What if one depends on (a, b) and the other on (alpha, beta), what should the result be? I think that in such cases the result should be a symbolic expression (which is unambiguous), but without any default order of variables. This is why polynomials in different variables cannot be added - ordering is non-canonical.

Note: See TracTickets for help on using tickets.