NPM package for symbolic differentiation plugin math.diff.js
.
npm install math-diff --save
let math_diff = require('math-diff');
let equation = '2x^5-cos(x)-x*exp(x)';
let derivative = math_diff(equation, 'x').toString(); // Output: 10 * x ^ 4 - -sin(x) - (exp(x) + x * exp'(x))