A literal number that represents a changeable quantity is called a variable.
The true meaning of the word variable is a changeable quantity. In algebra, a symbol, known as a literal is usually used to represent a quantity but it is changed accordingly, which means it represents a new value in every case and it does not represent a unique value all the time. Similarly, a variable is also used to represent an unknown quantity.
The concept of a variable is used in two cases. Observe the following examples to understand the concept of variable in algebra.
Take any letter to represent the total number of apples. Here, the letter $a$ is used to represent the quantity.
Initially, there is only one apple on the floor and it is expressed as an equation in algebra.
$a = 1$
The meaning of the equation $a = 1$ is, the total number of apples is one.
After some time, second apple is fallen from the tree. Now, there are two apples on the floor.
$a = 2$
After that, the third apple is also fallen from tree on floor. Now, there are three apples on the floor.
$a = 3$
In this example, the value of the letter $a$ is changed for every case and it does not have a fixed value. Hence, the literal number $a$ is called as a variable.
A variable is also used to represent an unknown quantity.
There are some walnuts in a box and also outside of the box. The walnuts outside of the box are appearing well and they can be counted easily but the walnuts in that box are not appeared well. So, it is not possible to count the total number of walnuts.
In this case, the total number of walnuts is represented by a literal. For example, $\large w$.
The literal number $\large w$ represents an unknown quantity. It can be anything.
Thus, a variable is used to represent a changeable quantity and also used to represent an unknown quantity in mathematics.