What is a variable? For example, in x2+2x, what is x? Or in x5−10x−12=0, what is x?
The quick answer is, x is a place-holder. It's a blank slot, in which we can place a number, and then we get either a numerical expression or a numerical sentence (which may be true or false). We may write a number in place of x in the expression x2+2x. If we choose 5, we get 52+2⋅5, which simplifies to 35. If we choose 2, we get 22+2⋅2, which simplifies to 8. Or we may write a number in place of x in the equation x5−10x−12=0. If we choose 5, we get 55−50−10=0, which is a false statement. If we choose 2, we get 25−20−12=0, which is true.
To go deeper into this, we need to recognize that letters in algebra may be used in two ways: as constant symbols or as variable symbols.
Constant symbols
A letter may stand for a number. Some letters stand for particular number. For example e by convention stands for a number near 2.7. Sometimes, we use a letter in the context of a particular problem to stand for a specific number.
Example. If Ann's age is one quarter Bill's today and will be one third of Bill's five years from now, then how old is Ann? Let a stand for Ann's age today and let b stand for Bill's age today. Then 4a=b and 3(a+5)=b+5, so 3a+15=4a+5, so 10=a.
In the example, from the moment we introduced the symbol a, it stood for the number 10. However, we did not know that until we had done a little thinking.
In this case, the symbol a is NOT a variable, it is a name for 10. The symbol a, in this context, is called a constant symbol. The example shows that we may have a constant symbol whose value we do not immediately know. (Let c stand for my father's age on January 1, 2016. Then c is a number, but you have no way of knowing what is is, unless I tell you. But nonetheless, as long as we agree to give the symbol c this meaning, it is a constant symbol.)
Note: some people call any letter in a math problem a variable. But this just leads to confusion, because sometimes (as the example shows) a letter may refer to one fixed and unchanging thing.
Variable symbols
In contrast to constant symbols, we have variable symbols. A variable symbol does not stand for anything at all. It simply holds a place in an expression or an equation, in the same way a blank space or a box does. If we write an expression with a variable symbol in it, then we may think about all the different values that the expression acquires when specific numbers are written in place of the variable symbol. If we write an equation with a variable symbol in it, then when we write a number in place of the variable symbol, we get a sentence that may be true or may be false.