josdejong/mathjs

Nested derivatives fail

Offen

#3.528 geöffnet am 08.09.2025

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.314 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (15.065 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Describe the bug mathJs evaluates this derivative correctly: derivative('x * e^x', "x") // returns "e ^ x * (x + 1)"

however, if the expression to be differentiated is involves another derivative mathJs returns an incorrect answer: derivative('x * derivative("e^x", "x")', "x") // returns "e^x"

To Reproduce enter expression in mathJs demo window: derivative('x * derivative("e^x", "x")', "x")

Contributor Guide