According to some point of view, denotation and reference are synonyms; see your link:
To say that an expression E denotes a specific object B means that E refers to B [...] B is sometimes called the denotation of E. Examples "The symbol π denotes the ratio of the circumference of a circle to its diameter."
In modern philosophy, denotation received a paramount relevance with B.Russell's On Denoting (1905): "The subject of denoting is of very great importance, not only in logic and mathematics, but also in the theory of knowledge."
By a "denoting phrase" I mean a phrase such as any one of the following: a man, some man, any man, every man, all men, the present King of England, the present King of France, the center of mass of the solar system at the first instant of the twentieth century, the revolution of the earth round the sun, the revolution of the sun round the earth. Thus a phrase is denoting solely in virtue of its form. We may distinguish three cases: (1) A phrase may be denoting, and yet not denote anything; e.g., "the present King of France". (2) A phrase may denote one definite object; e.g., "the present King of England" denotes a certain man. (3) A phrase may denote ambiguously; e.g. "a man" denotes not many men, but an ambiguous man.
Thus, according to Russell, the denotation relation is not what relates a proper name to its reference. See The Principles of Mathematics (1903), discussing Frege's theory about Sense and reference, §476. Meaning and indication
The distinction between meaning (Sinn) and indication (Bedeutung) is roughly, though not exactly, equivalent to my distinction between a concept as such and what the concept denotes. [Footnote: I do not translate Bedeutung by denotation, because this word has a technical meaning different from Frege’s, and also because bedeuten, for him, is not quite the same as denoting for me.]
According to Russell's reading of Frege:
The indication of a proper name is the object which it indicates; the presentation which goes with it is quite subjective; between the two lies the meaning, which is not subjective and yet is not the object. A proper name expresses its meaning, and indicates its indication. This theory of indication is more sweeping and general than mine, as appears from the fact that every proper name is supposed to have the two sides.
It seems to me that only such proper names as are derived from concepts by
means of the can be said to have meaning, and that such words as John merely indicate without meaning.
Thus, trying to summarize the discussion, we have proper names, like "Napoleon", that refer directly to the corresponding individual, and we have denoting phrases, like "the present King of England", that denote by way of concepts, i.e. they "point to" an individual in case that the corresponding concept is instantiated by an individual.
See PoM, §56: A concept denotes when, if it occurs in a proposition, the proposition is not about the concept, but about a term connected in a certain peculiar way with the concept. If I say “I met a man”, the proposition is not about a man: this is a concept which does not walk the streets, but lives in the shadowy limbo of the logic-books. What I met was a thing, not a concept, an actual man with a tailor and a bank-account or a public-house and a drunken wife. Again, the proposition “any finite number is odd or even” is plainly true; yet the concept “any finite number” is neither odd nor even. It is only particular numbers that are odd or even; there is not, in addition to these, another entity, any number, which is either odd or even.
Regarding variables, we can see Ch.5 The variable:
§86. The variable is perhaps the most distinctively mathematical of all notions; it is certainly also one of the most difficult to understand. When a given term occurs as term in a proposition, that term may be replaced by any other while the remaining terms are unchanged. The class of propositions so obtained have what may be called constancy of form, and this constancy of form must be taken as a primitive idea.
This is what has been originally discussed in G.Frege's Begriffsschrift (1879), starting from simple natural language examples.
Consider the phrase "The capital of France is Paris"; in it we have two names: "Paris" and "France". If we replace into this phrase the name "France" with a different name, e.g. "Italy" what we get is a different phrase with a different meaning. And the same if we replace the name "Paris" with "Rome".
Having performed this "operation", we may imagine that the expression is composed of a stable part: "The capital of... is___", expressing the relation between two objects standing in this relation.
We can describe this fact in an abstract way saying that the first component is a function and the latter its arguments (like the usual way of managing functions in mathematics; see e.g. the sine and cosine) functions.
Russell introduced the term propositional function for this kind of "incomplete" expression.
Now Russell again:
§93. It appears from the above discussion that the variable is a very complicated logical entity, by no means easy to analyse correctly. The following appears to be as nearly correct as any analysis I can make. Given any proposition, let a be one of its terms, and let us call the proposition ϕ(a). Then in virtue of the primitive idea of a propositional function, if x be any term, we can consider the proposition ϕ(x), which arises from the substitution of x in place of a. We thus arrive at the class of all propositions ϕ (x). If all are true, ϕ (x) is asserted simply. If ϕ (x) is sometimes true, the values of x which make it true form a class, which is the class defined by ϕ (x): the class is said to exist in this case. If ϕ (x) is false for all values of x, the class defined by ϕ (x) is said not to exist.
This (in some way convoluted) elucidation is consistent with the usual mathematical practice derived from algebra. See G.Boole's The Laws of Thought (1854):
§13. To determine the logical value and significance of the symbols 0 and 1. The symbol 0, as used in Algebra, satisfies the following formal law,
0 × y = 0, or 0y = 0,
whatever number y may represent. That this formal law may be obeyed in
the system of Logic, we must assign to the symbol 0 such an interpretation that the class represented by 0y may be identical with the class represented by 0, whatever the class y may be. A little consideration will show that this condition is satisfied if the symbol 0 represent Nothing. In accordance with a previous definition, we may term Nothing a class.
The key point here, for the present discussion, is the phrase "whatever number y may represent".
The further step, achieved by Frege and Russell, is to extend the use of variables to general expression (instead of only numerical ones). Thus, in conclusion, variables are symbols used in mathematics (and modern formal languages) to express generality.
See also the post Concept of a function and idea of a formula as a function for the modern origin of the mathematical concept of function as a sort of "rule" [expressed symbolically] that, having received a value as “input” allows us to calculate a corresponding “output” value.