What it is
A variable is a letter, usually x, that stands for a number. Which number is not fixed by the letter but by the situation: sometimes it can be any number, sometimes it is one particular number to be found.
- In an expression the letter stands for a number you choose. In 3x + 5, x = 4 gives 3 · 4 + 5 = 17 and x = −2 gives 3 · (−2) + 5 = −1.
- In a formula the letters stand for quantities. The area of a circle is A = πr²: with r = 3 that is A = 9π, about 28.27. Distance is s = v · t: with v = 80 and t = 1.5, s = 120.
- In an equation the letter is the unknown being looked for. In 3x + 5 = 17, x = 4 is the one number that makes the equation true.
- In a rule the letters stand for any numbers at all. In (a + b)² = a² + 2ab + b² you can put in a = 3 and b = 4: the left side is 7² = 49 and the right side is 9 + 24 + 16 = 49.
These are not variables:
- π is one fixed number, about 3.14. It is a constant, although it is written with a letter.
- m in “5 m” is a unit (metres), not a number that can be swapped.
- The numbers in 3x + 5. They are fixed. Only x can be replaced.
The letter need not be x. The choice often hints at the subject: t for time, r for radius, n for a count.
Why it matters
Without variables you can only write down single calculations, like 3 · 4 + 5. With a variable you can write a rule that holds for every number at once, which is what makes algebra more than arithmetic:
- A formula is a rule with variables. Replace them with numbers and it gives an answer, as in the square of a sum and the difference of squares, where a and b stand for any numbers.
- An equation asks a question about the variable: which number makes this true? See the linear equation and x on both sides.
- The difference between an expression and an equation is about what you do with the variable: put a value in, or look for one.
The equation solver solves an equation in one unknown and shows each step.
Common misconceptions
- “x is always the unknown.” The letter can be an unknown number (in an equation), any number (in a rule) or a quantity that changes (in a formula). The context decides.
- “Different letters are different numbers.” Not necessarily. In (a + b)² a and b may be equal: with a = b = 2 the left side is 4² = 16 and the right side is 4 + 8 + 4 = 16.
- “xy means x + y.” Two letters side by side mean multiplication. With x = 3 and y = 4, xy = 12, not 7. The same goes for 2x, which is 2 · x.
- “2x and x² are the same.” With x = 3, 2x = 6 and x² = 9.
- “The letter abbreviates a unit.” In A = πr², r is the radius, a number. That is a different thing from the m in 5 m, which is a unit.
Common questions
What is the difference between a variable and an unknown?
The same kind of letter in different roles. Call it an unknown when an equation is to determine it, like x
in 3x + 5 = 17. Call it a variable when it can take different values, like x in the function y = 3x + 5.
Can a variable be something other than a number?
In school mathematics it stands for a number. Later a letter can stand for a vector, a matrix or a
function, but the rule is the same: you may replace the letter with a value of the right kind.
Why x?
It is a convention, not a rule. Any letter works as long as it means the same thing throughout one
problem.