josdejong / josdejong/mathjs

Nested derivatives fail

Open
#3,528 3 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

**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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.