If I want to get the solution for a simple function, e.g. a^x, I can use:
a = 2;
Function[x, a^x][2]
However, if I have the function in a variable, I can't get it to work:
a = 2;
func = a^x
Function[x, func][2]
Similarly, this doesn't work as wished, which is that the last line provides the result if 2 is put into x:
a = 2;
func = a^x;
der = D[func, x]
Function[x, der][2]
FunctionisHoldAllsoFunction[x, #][2] &[func], let me find a duplicate. – Kuba Dec 04 '15 at 10:10