I am desperately looking for a JavaScript that can calculate the first derivative of a function. The function always includes only one variable, x.
Try nerdamer .
It can do derivatives and build JavaScript functions with it.
//Derivative of x^2
var result = nerdamer('diff(x^2,x)').evaluate();
document.getElementById('text').innerHTML = "f'(x)="+result.text()+'
';
//Build a new function
var f = result.buildFunction();
//Evalute f'(3)
document.getElementById('text').innerHTML += "f'(3)="+f(3).toString()+'
';