substitute(f, g) produces the function (f o g) : x -> f(g(x)).
substitute(f, t) is the constant f(t). Note that the constant is
represented by its expression until it has been evaluated (exactly the same
way as if you type the expression f replacing instances of the free variable
by t).
If f is stored in a variable F, the effect of the commands substitute(F,g) or substitute(F,t) is absolutely equivalent to
writing F(g) resp. F(t).