What is a Variable in Math? Definition, Types

#Math Terms
TL;DR
A variable in math is a letter that stands for an unknown or changing value — typically $x$, $y$, $z$, $a$, $b$, or $n$. Variables are the language of algebra. There are two main types: independent variables (the input you choose) and dependent variables (the output that depends on the input).
BT
Bhanzu TeamLast updated on May 16, 20266 min read

What Is a Variable in Math?

A variable is a letter or symbol that represents a number whose value can change or is not yet known. Unlike a constant (a number whose value is fixed), a variable can take on many different values.

The most common letters used as variables:

  • $x$, $y$, $z$ — typically for unknowns (variables you're solving for)

  • $a$, $b$, $c$ — often constants in equations, but can be variables too

  • $n$ — typically for an integer or natural number

  • $t$ — time

  • $r$ — radius or rate

In the equation $3x + 5 = 14$, the letter $x$ is the variable — you're trying to find the specific number that makes the equation true.

What Are the Types of Variables?

Variables come in several types depending on context.

Independent and Dependent Variables

The most important distinction is between independent and dependent variables.

  • Independent variable — the input you choose or control. It doesn't depend on any other variable. Usually plotted on the x-axis.

  • Dependent variable — the output, whose value depends on the input. Usually plotted on the y-axis.

Example. In $y = 2x + 3$:

  • $x$ is the independent variable (you choose its value).

  • $y$ is the dependent variable (its value follows from $x$).

When you plot this on a graph, $x$ runs along the horizontal axis and $y$ along the vertical axis.

Discrete and Continuous Variables

  • Discrete variable — can only take certain specific values (usually whole numbers). Number of students in a class, number of cars in a parking lot.

  • Continuous variable — can take any value within a range. Height, temperature, time.

Qualitative and Quantitative Variables

In statistics:

  • Qualitative (categorical) variable — describes a category. Eye colour, favourite subject.

  • Quantitative (numerical) variable — describes an amount. Age, score, weight.

Variables vs. Constants

Both variables and constants appear in algebraic expressions, but they behave differently.

Feature

Variable

Constant

Value

Can change

Fixed

Notation

Letter ($x$, $y$, $t$)

Number ($5$, $-3$, $\pi$)

Example

$x$ in $3x + 5$

$5$ in $3x + 5$

Coefficient

The number multiplying it

N/A

Some "constants" are written with letters too — like $\pi \approx 3.14159$ (a fixed irrational number) or $e \approx 2.71828$ (Euler's number). These are named constants, not variables.

Where Did the Variable Concept Come From? (The Real-World GROUND)

"Let us call the unknown quantity A, and the known quantity B…" — François Viète, In Artem Analyticen Isagoge, 1591.

The variable as a symbolic object in mathematics is younger than most people assume. Before the late 16th century, mathematicians wrote out problems in words — "find the number such that twice the number plus three equals fifteen." The systematic use of letters for unknowns was introduced by François Viète in his 1591 book In Artem Analyticen Isagoge. Viète used vowels (A, E, I, O, U) for unknowns and consonants (B, C, D…) for known quantities — the first formal separation of variable and constant.

A century later, René Descartes refined the notation to what's used today: letters near the end of the alphabet ($x$, $y$, $z$) for unknowns and letters near the beginning ($a$, $b$, $c$) for constants. This is from his 1637 book La Géométrie. Every algebra textbook in the world uses Descartes's convention.

The reason the variable matters: it's the linguistic shift that turned mathematics from a collection of clever tricks into a general system. With variables, the quadratic formula $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ solves every quadratic, not just specific numerical ones.

Real-world variable use:

  • Physics. Time ($t$), position ($x$), velocity ($v$), acceleration ($a$) — independent and dependent in motion equations.

  • Economics. Price ($p$), quantity ($q$), interest rate ($r$) — variables in supply-demand and growth models.

  • Statistics. Sample size ($n$), mean ($\mu$), standard deviation ($\sigma$) — variables in every statistical formula.

  • Computer programming. Every line of code that stores a value uses a variable.

  • Spreadsheets. Cell references like A1, B5 act as variables in formulas.

  • Machine learning. Input features ($x_1, x_2, \ldots$), output labels ($y$), and model weights ($w$) are all variables.

Learn more: Algebraic Expression — Parts, Types, and Examples

A Worked Example

In the equation $y = 5x - 2$, identify the independent and dependent variables.

The intuitive (wrong) approach. A student in a hurry guesses based on the position in the equation:

$$y \stackrel{?}{=} \text{independent, because it's on the left side}$$

Why it fails. Position in the equation doesn't determine which variable is independent. The relationship is what matters: which variable's value is chosen freely, and which depends on it?

The correct method.

Step 1: Identify the variable being computed. $y$ is computed from $x$. So $x$ is the input (chosen) and $y$ is the output (depends on $x$).

Step 2: Independent = $x$. Dependent = $y$.

When graphed, $x$ goes on the horizontal axis, $y$ on the vertical. For every $x$ value, the formula spits out one $y$ value.

Check. Plug in $x = 3$: $y = 5(3) - 2 = 13$. You chose $x$; $y$ was forced.

At Bhanzu, our trainers teach the independent-dependent distinction by asking "which variable do you control?" The one you control (or choose) is independent; the one that follows is dependent.

What Are the Most Common Mistakes With Variables?

Mistake 1: Confusing variable with constant

Where it slips in: Treating $\pi$ or $e$ as a variable because they're written with letters.

Don't do this: Call $\pi$ a variable.

The correct way: $\pi$ is a named constant — its value ($\approx 3.14159$) is fixed. Same for $e$ ($\approx 2.71828$). Variables represent values that can change; constants have fixed values, even when written with symbols.

Mistake 2: Mixing up independent and dependent

Where it slips in: Plotting the dependent variable on the x-axis or vice versa.

Don't do this: Plot $y$ on the x-axis when $y$ depends on $x$.

The correct way: Independent (input, free choice) on x-axis. Dependent (output, computed) on y-axis. The graph reads "input → output" left-to-right.

Mistake 3: Treating "x" as always being the same variable across problems

Where it slips in: Two different problems both use $x$, and students assume the values must be the same.

Don't do this: Carry the value of $x = 3$ from one problem to another problem that also has $x$.

The correct way: Variables are local to their problem. $x$ in problem 1 has nothing to do with $x$ in problem 2. The letter is just a label.

A Practical Next Step

Try these three before moving on to algebraic expressions.

  1. In $z = 4w - 7$, which variable is independent and which is dependent?

  2. Identify the variables and constants in $2a + 5b - 3$.

  3. A water tank has 100 litres and drains at 5 litres per minute. Write an equation for the water remaining $L$ after $t$ minutes. Which variable is independent?

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is a variable in math?
A variable is a letter (like $x$, $y$, or $t$) that stands for a number whose value isn't fixed. In $3x + 5 = 14$, the letter $x$ is the variable — we're trying to find what number it equals.
What are the types of variables in math?
Main types: independent (input you choose), dependent (output that follows), discrete (specific values like integers), continuous (any value in a range), qualitative (categories), and quantitative (numbers).
What's the difference between a variable and a constant?
A variable's value can change; a constant's value is fixed. In $3x + 5$, $x$ is variable and $5$ is constant. The number $\pi$ is also a constant, even though it's written with a Greek letter.
What is an independent variable?
The variable you choose or control — the input. In $y = 2x + 1$, $x$ is independent because you pick its value first. Plotted on the x-axis.
What is a dependent variable?
The variable whose value depends on (is determined by) another variable — the output. In $y = 2x + 1$, $y$ is dependent because its value follows from $x$. Plotted on the y-axis.
Why do we use $x$ as a variable so often?
By convention from René Descartes (1637). He chose letters near the end of the alphabet ($x$, $y$, $z$) for unknowns specifically because they were the last letters and unlikely to be confused with known constants ($a$, $b$, $c$).
Can a variable be negative?
Yes — a variable can take any value, including negative numbers, fractions, irrational numbers, or even zero (unless the problem specifies a restricted domain).
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →