Question: Defining a simple function


I have a simple expression  g1:=x^2+x;

Then its derivative D1:=diff(g1,x); which is 2x+1

Then I want to make a function with this derivative f1:=x->D1;

And I want to evalute this function at any point, for instance f1(3)

And what I get for f1(3) is the the derivative 2x+1 and not the value 7 as I would expect.

What am I missig?

Please Wait...