Possible bug in the symbolic differentiation of N unknown variables

56 views
Skip to first unread message

Snow Summer

unread,
May 27, 2022, 6:41:07 PM5/27/22
to sage-devel
Hello, Sage Developers,

I want to calculate the symbolic differentiation of a variable in an expression with a sum of N unknown variables, and it seems sage cannot handle it. I posted my question in https://ask.sagemath.org/question/62451/how-to-symbolic-differentiate-a-sum-of-n-unknown-variables/ , and the answer says it is a bug in sage. How can I report a bug? Is this bug already reported somewhere?

Thanks,

Nils Bruin

unread,
May 28, 2022, 2:51:37 AM5/28/22
to sage-devel
The bug is perhaps concisely illustrated with the following:

sage: var('k,n')
(k, n)
sage: function('f')
f
sage: sum(f(x,k),k,1,n).diff(x)
diff(f(x, k), x)*D[0](sum)(f(x, k), k, 1, n)

it shows that  sage doesn't have a  differentiation rule in place for symbolic sums and just applies the chain rule on the first argument (and undoubtedly on the others, but those are constants in x). I would expect that there is a ticket lying around about this (some care needs to be taken to do something sensible with the other arguments as well), but I wasn't able to locate one.

Nils Bruin

unread,
May 28, 2022, 3:02:53 AM5/28/22
to sage-devel
Actually, this case is fully covered by


which is, unfortunately, stalled on what looks like a non-trivial problem with a more general solution. Given that the problem arises again here, perhaps it's worth accepting first a more limited solution and just stick with errors on non-constant summation bounds.

Snow Summer

unread,
May 28, 2022, 10:55:09 AM5/28/22
to sage-devel
Thanks!

Emmanuel Charpentier

unread,
May 29, 2022, 2:42:56 AM5/29/22
to sage-devel

As I understand it, differentiating a discrete sum with respect to its bounds is nonsense ; see my comment in the ticket.

Reply all
Reply to author
Forward
0 new messages