Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong limit in derivative #17428

Open
sagetrac-wonder mannequin opened this issue Dec 1, 2014 · 9 comments
Open

wrong limit in derivative #17428

sagetrac-wonder mannequin opened this issue Dec 1, 2014 · 9 comments

Comments

@sagetrac-wonder
Copy link
Mannequin

sagetrac-wonder mannequin commented Dec 1, 2014

I'm seeing this behavior in sage 6.4, just built from git:

$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4, Release Date: 2014-11-14                         │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: e = SR('a*f(x)+g(x)')
sage: e
a*f(x) + g(x)
sage: e.limit(x=0)
limit(a*f(x) + g(x), x, 0)
sage: e.limit(x=0).limit(a=0)
limit(g(x), x, 0)
sage: de = diff(e,SR('x'))
sage: de
a*D[0](f)(x) + D[0](g)(x)
sage: de.limit(x=0)
limit(a*D[0](f)(x) + D[0](g)(x), x, 0)
sage: de.limit(x=0).limit(a=0)
D[0](g)(x)

The last result should be limit(D[0](g)(x), x, 0).

For reference, this report was also posted to sage-devel.

Upstream: Reported upstream. No feedback yet.

CC: @kcrisman @nbruin @sagetrac-jakobkroeker

Component: symbolics

Keywords: derivative limit

Stopgaps: wrongAnswerMarker

Issue created by migration from https://trac.sagemath.org/ticket/17428

@sagetrac-wonder sagetrac-wonder mannequin added this to the sage-6.5 milestone Dec 1, 2014
@sagetrac-wonder sagetrac-wonder mannequin added the p: major / 3 label Dec 1, 2014
@sagetrac-wonder

This comment has been minimized.

@pjbruin
Copy link
Contributor

pjbruin commented Dec 2, 2014

Changed keywords from none to derivative limit

@pjbruin
Copy link
Contributor

pjbruin commented Dec 2, 2014

Upstream: Not yet reported upstream; Will do shortly.

@pjbruin
Copy link
Contributor

pjbruin commented Dec 2, 2014

comment:2

The same happens in Maxima:

Maxima 5.34.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) e: a*f(x) + g(x);
(%o1)                            g(x) + a f(x)
(%i2) limit(e, x, 0);
(%o2)                       limit  (g(x) + a f(x))
                            x -> 0
(%i3) limit(limit(e, x, 0), a, 0);
(%o3)                             limit  g(x)
                                  x -> 0
(%i4) de: diff(e, x);
                           d              d
(%o4)                      -- (g(x)) + a (-- (f(x)))
                           dx             dx
(%i5) limit(de, x, 0);
                              d              d
(%o5)                 limit  (-- (g(x)) + a (-- (f(x))))
                      x -> 0  dx             dx
(%i6) limit(limit(de, x, 0), a, 0);
                                   d
(%o6)                              -- (g(x))
                                   dx

Possibly related: #7401 [edit: it is not]

@pjbruin
Copy link
Contributor

pjbruin commented Dec 5, 2014

comment:3

A slightly simpler example:

(%i1) dg: diff(g(x), x);
                                   d
(%o1)                              -- (g(x))
                                   dx
(%i2) lim: limit(dg, x, 0);
                                      d
(%o2)                          limit  -- (g(x))
                               x -> 0 dx
(%i3) limit(lim, x, 0);
                                          d
(%o3)                      limit  (limit  -- (g(x)))
                           x -> 0  x -> 0 dx
(%i4) limit(lim, a, 0);
                                   d
(%o4)                              -- (g(x))
                                   dx

In %i3 the double limit over x is not simplified (this might be a different problem); in %i4 taking the limit over a (which does not occur in the expression at all) removes the limit over x.

@kcrisman
Copy link
Member

kcrisman commented Dec 5, 2014

comment:4

Well, that is definitely a problem. Did you report upstream yet?

@pjbruin
Copy link
Contributor

pjbruin commented Jan 7, 2015

comment:5

Replying to @kcrisman:

Well, that is definitely a problem. Did you report upstream yet?

I just opened https://sourceforge.net/p/maxima/bugs/2877/ for this.

@pjbruin
Copy link
Contributor

pjbruin commented Jan 7, 2015

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Mar 4, 2017

Stopgaps: wrongAnswerMarker

@mkoeppe mkoeppe removed this from the sage-6.5 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants