In algebra the process of substituting a number for a variable, or a more general expression, is taught in passing. All instances of a given variable have to be replaced, simultaneously and by the same expression. This may require parentheses to be used. One practical hazard is the bound variable clash: letters for variables in the two formulae should be disjoint, or confusion can arise.
The formalization of the process of substitution is carried out as a basic step in developing lambda calculus.
A further difficulty is the possibility of obtaining an indeterminate form as a result.