Question: how to make a new function from a derivative?

dgdx := (x, T) -> diff(g(x, T), x);

g := (x, T) -> T*x + x^2;#just an example

dgdx(1, 2);
Error, (in dgdx) invalid input: diff received 1, which is not valid for its 2nd argument

So, I like to introduce a new function dgdx(x,T) from the x-derivative of g(x,T) but if I insert a value for x I get an error message. It would be great if you can help me out!

Please Wait...