compute-engine icon indicating copy to clipboard operation
compute-engine copied to clipboard

"Root" isn't differentiated by "D" operator.

Open rasmus-rasmus opened this issue 9 months ago • 0 comments

Description

The "D" operator on an expression whose first operand is an expression containing a "Root" operator doesn't compute the derivative, when .evaluate()'ed.

Steps to Reproduce

const ce = new ComputeEngine();
const expr = ce.parse('\\sqrt[3]{x}')
const der = ce.box(["D", expr, "x"]).evaluate()

console.log(der.json)

Actual Result

Logs [ 'D', [ 'Root', 'x', 3 ], 'x' ] to the console, i.e., expression is not differentiated.

Expected Result

The derivative of \sqrt[3]{x}, i. e., [ 'Multiply', [ 'Rational', 1, 3 ], [ 'Power', 'x', [ 'Rational', -2, 3 ] ] ], to be printed.

Environment

I think it is a bug in version 0.26.0, which introduced "Root" as operator (as opposed to taking general roots by reciprocal exponentiation).

Compute Engine version 0.26.0

rasmus-rasmus avatar Jan 09 '25 13:01 rasmus-rasmus