What is an independent variable in math?
An independent variable is an input value that can be chosen or changed. The dependent variable changes based on it. In y = 3x, x is the independent variable and y is the dependent one. On a graph the independent variable goes on the horizontal axis; in an experiment it is the factor you change on purpose.
Independent Variable in a picture
Formal definition and notation
In a relationship between two quantities written as y = f(x), the independent variable x can take any value in the domain, and the value of the dependent variable y is determined by it. Which variable is independent comes from the situation: it is the quantity that comes first, is controlled or chosen, or is the cause being studied. By convention it is graphed on the horizontal axis and listed in the first column of a table.
| Symbol | Read it as | Meaning |
|---|---|---|
| x | x | the usual letter for the independent variable |
| f(x) | f of x | the output, which depends on the independent variable x |
| t | t | time, a common independent variable in word problems |
Key facts
- Use the sentence test: “__ depends on __.” The quantity after “depends on” is the independent variable: pay depends on hours worked.
- The independent variable is usually the input, not the result.
- It goes on the horizontal axis (the x-axis) of a graph and in the first column of a table.
- In a science experiment, it is the one thing the experimenter changes on purpose, such as the amount of fertilizer.
- Time is very often the independent variable: distance, temperature and savings depend on time, not the other way round.
Try it: choose the input
The machine pays 15 dollars per hour. Type any number of hours (the independent variable) and press Run to see the pay it produces (the dependent variable). Each new input you choose sets a new output.
Independent Variable examples, step by step
Example 1: Name the variables
Gas costs 2.50 dollars per gallon, so C = 2.5g, where C is the cost in dollars and g is the number of gallons. Which variable is independent? Find the cost of 8 gallons.
- Sentence test: the cost depends on the number of gallons, not the other way round.
- So g is the independent variable and C is the dependent variable.
- Choose g = 8: C = 2.5 × 8 = 20.
Answer: g (gallons) is independent; 8 gallons cost 20 dollars.
Example 2: Write the equation from words
A seedling is 5 cm tall and grows 2 cm each week. Write an equation for its height, name the independent variable, and find the height after 6 weeks.
- The height depends on the number of weeks, so weeks w is the independent variable and height h is dependent.
- Start at 5 cm and add 2 cm per week: h = 5 + 2w.
- Choose w = 6: h = 5 + 2(6) = 5 + 12 = 17.
Answer: h = 5 + 2w, with weeks w independent; after 6 weeks the seedling is 17 cm tall.
Example 3: Interpret a model
The balance on a gift card is y = 40 − 3x dollars after x weeks. Which variable is independent, what does the 3 mean, and after how many weeks is the balance 4 dollars?
- The balance depends on the weeks that have passed, so x (weeks) is independent and y (dollars) is dependent.
- Each 1-week increase in x lowers y by 3, so the card loses 3 dollars per week.
- Set the dependent variable to 4: 40 − 3x = 4, so 3x = 36.
- x = 12.
Answer: x (weeks) is independent, 3 dollars is spent each week, and the balance is 4 dollars after 12 weeks.
Common mistakes
The independent variable is usually the input, not the result. Ask which quantity depends on the other.
The convention lets anyone read the graph left to right as “input goes up, see what the output does.” Swapping the axes changes the slope and confuses readers.
A quantity that never changes is a constant, like the 15 dollars per hour in P = 15h. Both h and P are variables.
Not to be confused with
The dependent variable is the output that responds. In d = 60t, time t is independent and distance d is dependent.
An input is one particular value you put in, like t = 2. The independent variable is the quantity that all the inputs are values of, like t itself.
A constant stays fixed in a problem, like the 60 in d = 60t. The independent variable takes different values.
Quick check: 3 questions
The number of pages a printer prints depends on how many minutes it runs. What is the independent variable?
Answer: B. Pages depend on minutes, so minutes is the independent variable and pages is dependent. The printer is not a quantity, and pages per minute is a rate (a constant in this situation).Show answer and explanation
In y = 4x + 7, the independent variable equals 3. What is the value of the dependent variable?
Answer: D. The independent variable is x, so y = 4(3) + 7 = 19. −1 sets y = 3 instead, 3 just repeats the input, and 28 adds before multiplying.Show answer and explanation
A graph shows distance in miles against time in hours. Where should time, the independent variable, go?
Answer: A. By convention the independent variable goes on the horizontal (x) axis and the dependent variable, distance, on the vertical axis. The origin is a point and the slope is a rate, not an axis.Show answer and explanation
Independent Variable: frequently asked questions
How do you tell the independent variable from the dependent variable?
Fill in the sentence “___ depends on ___.” Whatever fits after “depends on” is independent. “Plant height depends on amount of water” makes water independent and height dependent. If the sentence sounds wrong the other way round (“water depends on plant height”), you have the order right. In equations like y = 2x + 1, x is independent.
Which axis does the independent variable go on?
The horizontal axis, also called the x-axis. The dependent variable goes on the vertical axis. A graph of savings over time puts months across the bottom and dollars up the side. The same rule applies to tables: the independent variable usually goes in the first column or row.
Can there be more than one independent variable?
Yes. In A = lw, the area depends on both length and width, so l and w are both independent and A is dependent. In a careful experiment, scientists usually change only one independent variable at a time, so they can tell which change caused the result.
Practice and tools
Sources
- Common Core State Standards, Grade 6 Expressions and Equations (6.EE.C.9)
- Common Core State Standards, Grade 8 Functions (8.F.B.4)
- OpenStax, Intermediate Algebra 2e, 3.5 Relations and Functions
Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS 6.EE.C.9, CCSS 8.F.B.4
Cite this entry
Effortless Math Team. “Independent Variable.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/independent-variable/
Flashcard
Browse all terms in the Math Dictionary · More functions terms · Random term