Defining a function from a derivative?



["Alasdair McAndrew" <amca01 at gmail.com>, Sun, 7 May 2006 01:07:32 +1000]:
> How do I create a function from a derivative?  For example, if I have a
> function, say f(x):=x^3+x^2; then I can find its derivative with
> diff(f(x),x); but how do I turn this into a function?  I can do it with
> df(x):=subst(x,t,diff(f(t),t)): but that seems very clumsy.

define(df(x), diff(f(x),x));

HTH,

Albert.