The difference between replacement and substitution Is there any difference replacement and substitution?
For example, Let $f(x)=x^2$ be a function defined on real values. If we replace $x$ by $x+1$, we get $$f(x+1)=(x+1)^2$$
In this case, can we say that we substitute $x$ with $x+1$? 
Normally, when we substitute $i$ with $j+1$, that means $i=j+1$. But as the former case, when we replace $x$ by $x+1$, that does not mean $x=x+1$. 
When we get $f(x+1)=(x+1)^2$ by replacement from $f(x)=x^2$, how to explain clearly that does not mean $x=x+1$?
 A: I believe that it is a logical substitution, without making use of the substitution property of equality. 


*

*https://en.wikipedia.org/wiki/Substitution_%28logic%29

*https://en.wikipedia.org/wiki/Change_of_variables

*https://en.wikipedia.org/wiki/Equality_%28mathematics%29#Some_basic_logical_properties_of_equality
Part of the subtlety here is the scope or binding of the variables. In a  function definition like $f(x) = x^2$, the $x$ doesn't refer to anything outside this definition, and may be replaced/substituted by any series of symbols.  This is called having a "bound variable" or a "dummy variable" (that latter name, which is what I've heard most often, unfortunately collides with a different usage in statistics for regression analysis). 


*

*https://en.wikipedia.org/wiki/Free_variables_and_bound_variables
So the syntax allows us to replace the $x$ in the function definition with whatever symbol we like, such as $x+1$, which is logically called substitution within that scope, without asserting globally that $x = x + 1$. This is analogous in computer programming to using the letter $x$ for a variable in one place (say, global scope), and then using the same letter for a different purpose within a function (local scope). It may be confusing if we are unclear about the scoping of particular statements. 
Coincidentally, I ran into this same issue just today with my college algebra students (in the context of using the sum of cubes factoring formula, when a specific problem used the same letters as the given formula). 
