Difference between a function and an expression

### 7.2.1 Difference between a function and an expression

Functions are often defined with expressions; for example, the command line f(x):=x^-1 defines a function f, whose value at x is given by x2+1. (The function f can also be defined by f:=x->x^2-1.) But the function is not the same as the expression; the variable x is only a placeholder for the function; it is not part of actual definition of the function. Compare this with g:=x^2-1, where g is a variable which stores the expression x^2-1 and so the identifier x is part of the definition of g. To find the value of f for x=2, you can enter f(2), but to use g to find the same value you have to do an explicit substitution and enter subst(g,x=2).

When a command expects a function as argument, this argument should be either the definition of the function (e.g. x->x^2-1) or a variable name assigned to a function (e.g. f previously defined by f(x):=x^2-1).

When a command expects an expression as argument, this argument should be either the definition of the expression (for example x^2-1), or a variable name assigned to an expression (e.g. g previously defined by g:=x^2-1), or the evaluation of a function (e.g. f(x) where f is the previously defined function by f(x):=x^2-1).