Variable in Maths

Last Updated : 14 Apr, 2026

A variable is a symbol(usually a letter) that is used to represent a number whose value can change or is not fixed.

Example: In the equation y = 2x + 3, the value of y changes when x changes. If x = 2, then y = 7.

variable

Types of Variables

In Mathematics, variables represent values that can change. Based on how their values behave in an equation or expression, variables are mainly classified into two types:

Independent Variable

An independent variable is a variable whose value does not depend on any other variable. It can take different values freely, and other variables depend on it.

Example: In the expression y = xΒ², x is the independent variable because its value can be chosen freely, and y is the dependent variable because its value depends on x.

Dependent Variable

A dependent variable is a variable whose value depends on the value of another variable. When one variable changes, the dependent variable also changes accordingly.

Example: In the equation y = 4x + 3, the value of y depends on the value of x. As x changes, y also changes. Therefore, y is called the dependent variable.

types_of_variable
Types of variable

Besides dependent and independent variables, there are other classifications of variables in mathematics based on the nature or types of things that the variable can represent. Some of these types are:

  • Discrete Variables: Discrete variables are those that can only take on specific, distinct values. They are often associated with counting or categorizing, such as the number of students in a class or the outcomes of a dice roll.

Eg: The number of books on a shelf. This variable can only take on specific, distinct values, such as 0, 1, 2, 3 and so on but cannot take fractional or continuous values.

  • Continuous Variables: Continuous variables can take on any value within a certain range or interval. They are typically associated with measurements or quantities that can be infinitely divided such as time, distance or temperature.

Eg: The height of students in a class. This variable can take on any value within a certain range such as between 150 cm and 200 cm and can be infinitely divided into smaller units.

  • Categorical Variables: Categorical variables represent qualitative characteristics or attributes that can be divided into distinct categories or groups. Examples include gender, nationality, or type of vehicle.

Eg: The type of car owned by individuals (e.g., sedan, SUV, truck). This variable represents qualitative characteristics or categories that cannot be ordered or measured on a numerical scale.

Note: We can add, subtract, multiply, or divide variables in the same way as numbers, but the result depends on the values assigned to the variables. For example, x + y will give a different result depending on the values of x and y, and x Γ· y is valid only if y β‰  0.

Application of Variables

Variables are not only used in Mathematics but also in many other fields. They are used to store, represent, and change values as needed. Some common applications of variables are:

β€’ Programming – Variables are used to store data such as numbers, text, and results that can change during program execution.

β€’ Research – Variables are used to represent factors that can be measured, changed, or studied during experiments and surveys.

β€’ Science – Variables help describe changing quantities such as speed, time, temperature, mass, and distance in scientific formulas.

β€’ Statistics – Variables are used to collect, organize, and analyze data, such as age, height, marks, or income.

Solved Examples of Variables

Example 1: Solve for x in the equation 3x + 5 = 17.

Solution:

3x + 5 = 17

β‡’ 3x = 17 - 5

β‡’ 3x = 12

β‡’ x = 12/3

β‡’ x = 4

Therefore, the value of "x" in the given equation is 4.

Example 2: Solve for "x" in the equation x2 βˆ’ 4x + 3 = 0.

Solution:

x2 βˆ’ 4x + 3 = 0

β‡’ (x -3) (x - 1) = 0

Now, Let's set each factor equal to 0.

(x -3) = 0 β‡’ x = 3

β‡’ (x - 1) = 0 β‡’ x = 1.

Example 3: Solve x in the equation 2/x = 3.

Solution:

2/x = 3

β‡’ 2 = 3x

β‡’ x = 2/3

Therefore, the value of x is 2/3.

Comment

Explore