Opened 15 months ago

Last modified 4 weeks ago

#28207 new defect

Derivative of piecewise function returns junk

Reported by: rburing Owned by:
Priority: major Milestone: sage-9.3
Component: symbolics Keywords: piecewise, derivative, diff
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:


Reported in Ask SageMath question #47169, we can't differentiate the bump function:

sage: f(x) = piecewise([((-oo, -1), 0), ((-1, 1), exp(-1/(1 - x^2))), ((1, oo), 0)])
sage: f.diff()
x |--> (0, 0, 0)*D[0]piecewise(x|-->0 on (-oo, -1), x|-->e^(1/(x^2 - 1)) on (-1, 1), x|-->0 on (1, +oo); x) + D[1]piecewise(x|-->0 on (-oo, -1), x|-->e^(1/(x^2 - 1)) on (-1, 1), x|-->0 on (1, +oo); x)
sage: f.diff()(0)
(0, 0, 0)*e^(-1) + e^(-1)
sage: f.diff()(0) in RR

That's not right...

Change History (3)

comment:1 Changed 9 months ago by embray

  • Milestone changed from sage-8.9 to sage-9.1

Ticket retargeted after milestone closed

comment:2 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

comment:3 Changed 4 weeks ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3
Note: See TracTickets for help on using tickets.