On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Algebra Fundamentals · Grade 9-12

Dependent vs Independent Variables

The independent variable is the input you choose; the dependent variable is the output the rule produces from it.

y=f(x) where x is independent and y is dependent

Quick Answer

The independent variable is the input you choose; the dependent variable is the output the rule produces from it. In y=3x+2 you pick x and y follows: choose x=4 and y must be 14. You use the distinction to set up a function, to decide which quantity goes on the horizontal axis (independent) and which on the vertical axis (dependent), and to design an experiment, where you control one quantity and measure how another responds.

Why This Matters

Getting the roles right decides how a graph reads and what a formula can answer. Plot phone charge against time and the slope is the charging rate in percent per minute; flip the axes and the slope becomes minutes per percent, which is easy to misread. In an experiment, mixing up the roles means you end up measuring the thing you meant to control.

Intuitive Explanation

Picture a vending machine. You press a button, say B4, and the machine drops a snack, say pretzels. You choose the button; the snack is decided by the machine's wiring. The button is the independent variable and the snack is the dependent one. In y=3x+2, x plays the button: choose x=0, 1 or 4 and the rule returns y=2, 5 or 14. You never pick y directly; you get it by picking x.

In real situations, ask what someone controls or what simply passes. Time is almost always independent: you decide when to look, and the plant's height, the bank balance or the temperature is whatever it is at that moment. In an experiment the independent variable is the one the scientist sets, such as the amount of fertilizer, and the dependent variable is the one measured, such as plant height after three weeks.

The roles come from the question, not from the quantities themselves. With F=1.8C+32, a traveller converting a Celsius forecast treats C as independent. Someone with a Fahrenheit oven dial who needs Celsius uses C=F−321.8, and now F is the independent one. A fixed number like the 1.8 is neither: it never changes, so it is not an input you choose or an output you get.

Think of it like this. Ordering in a café shows the two roles: you choose the drink size, and the price on the receipt follows from the menu. You cannot pick the price and have the size adjust, unless you turn the question around to "what size does $4 buy?", which swaps the roles.

Core idea. The independent variable is chosen freely; the dependent variable is whatever the function then returns.


When to Use

Sort variables into independent and dependent when you must label axes, set up a function y=f(x), or plan an experiment. The independent variable is the one you set, choose or let pass (often time); the dependent one is computed or measured from it. If you need to separate fixed numbers from changing ones, use constants versus variables; if a letter picks which function you have, like m in y=mx+b, it is a parameter.

Tip. Ask: Which quantity do I choose freely, and which one is then determined by it?

How to Recognize It

Before labelling, look at how the two quantities are linked in the situation: which one is set, and which is measured or computed.

  1. Could the person running the situation set this quantity directly, like a dose, a time or a ticket price?

    Yes points to the independent variable, which goes on the horizontal axis. A quantity you can only read off or measure afterwards, such as a plant's height, is the dependent one, on the vertical axis.

  2. Does the quantity stay the same throughout the whole situation?

    Then it is neither of the two: it is a constant, or a parameter if it would change in another version of the problem, like the price per litre in a fuel-cost graph.

  3. Would the roles swap if the question were turned around?

    Often they do. Asking how far a car goes in 3 hours makes time the input; asking how long 240 km takes makes distance the given and time the output. Label the roles for the question actually asked.

  4. Is the claim that one quantity causes the other, rather than that one is computed from the other?

    Independent and dependent name roles in a rule or an experiment; they do not prove cause. If two measured quantities merely rise together in data, that is correlation, and neither one was set by you.

Dependent vs Independent Variables compared with Constant vs variable, Parameter, and Function notation

All four rows sort the letters of a formula like y=mx+b, so they overlap. Ask what a letter does: inputs or outputs along one graph (independent, dependent), fixed or changing (constant vs variable), picks the graph (parameter), or names the rule (f in function notation).

Dependent vs Independent Variables

Meaning
Use this when two quantities are linked and you must decide which is the freely chosen input and which is the determined output.
Key test
Which quantity do I choose freely, and which one is then determined by it?
Formula
y=f(x) where x is independent and y is dependent
Example
A plant's height depends on days since planting. Which variable is independent?

Constant vs variable

Meaning
Distinguishes changing from fixed quantities, not input from output.
Key test
Use when asking 'does this value change at all?', not 'which drives which?'
Formula
A=πr2
Example
π fixed, r varies

Parameter

Meaning
A value held fixed for one case but changeable between cases; not the per-point input.
Key test
Use for the dials (m,b) that select a function, not the point-by-point input.
Formula
y=mx+b
Example
m, b choose the line

Function notation

Meaning
Writes the input/output relationship as f(x); the variables are what it relates.
Key test
Use when naming the rule, not labeling roles.
Formula
y=f(x)
Example
Name the rule f

Formula & Notation

y=f(x) where x is independent and y is dependent
In a function f:X→Y, the independent variable x∈X (domain) is freely chosen; the dependent variable y=f(x)∈Y (codomain) is uniquely determined by x via f.

How to read it: Independent variable on the horizontal axis (x-axis), dependent variable on the vertical axis (y-axis). In function notation y=f(x), x is independent, y is dependent.

Worked Examples

Example 1 — Plant growth

Easy

A plant's height depends on days since planting. Which variable is independent?
Show the steps and the answer
  1. Read the phrase 'height depends on days'.

    The quantity that depends on something is the output; the thing it depends on is the input.

  2. Ask which one you choose: you can decide to measure on day 5 or day 10, but you cannot decide that the plant will be 14 cm tall.

    The day is set by you or by time passing; the height is whatever the plant has grown to by then.

  3. Assign the roles: days is independent (horizontal axis), height is dependent (vertical axis).

    A table of results would list days 0, 5 and 10 in the first column and the measured heights beside them.

Answer: Days is independent, height is dependent

Takeaway: 'A depends on B' makes B the independent variable and A the dependent one.

Example 2 — Fixed vs changing

Standard

In A=πr2, is π the independent variable?
Show the steps and the answer
  1. Try two circles: r=2 gives A=4π≈12.57, and r=4 gives A=16π≈50.27.

    Between the two circles r and A changed, but π was about 3.14159 both times.

  2. Classify π: it never changes, so it is neither chosen nor computed.

    An independent variable has to be something you can set to different values, and π cannot be set.

  3. Classify r and A: you choose the radius, and the area follows from it.

    Choosing r fixes A, so r is independent and A is dependent.

Answer: π is a constant; r is the independent variable

Takeaway: Constants are neither input nor output; the independent variable is the quantity you can actually vary.

Example 3 — Find the mistake: swapped axes

Application

A phone at 20% charge gains 2% per minute, so its charge after t minutes is B=20+2t. Kai plots the points (20,0), (40,10) and (60,20), with charge on the horizontal axis. Find the mistake and give the correct points.
Show the steps and the answer
  1. Decide which quantity is chosen: you pick the time to check, t=0, 10 or 20 minutes, and the charge follows from the rule.

    Time is the input, so t is independent and B is dependent.

  2. Compute the outputs: B(0)=20, B(10)=40, B(20)=60.

    Kai's numbers are right; only their order in each pair is wrong.

  3. Write each point as (independent, dependent): (0,20), (10,40), (20,60).

    The horizontal axis carries the input, so time comes first in each coordinate pair.

  4. Read the slope of the corrected graph: it rises 20 percentage points every 10 minutes, or 2% per minute.

    With the axes the right way round the slope matches the charging rate in the rule; Kai's graph shows 0.5 minutes per percent instead.

Answer: Time on the horizontal axis: (0,20), (10,40), (20,60).

Takeaway: Put the quantity you choose on the horizontal axis, so the slope reads as output per unit of input.

Where You'll See It

  • A science-fair ramp experiment

    A student releases a toy car from ramp heights of 10, 20 and 30 cm and measures how far it rolls. Height is independent because the student sets it; distance is dependent because it is measured. Changing height and car weight at the same time would make it impossible to say which one caused a change in distance.

  • Reading a phone bill

    A plan charges $15 a month plus $2 per gigabyte, so the bill is C=15+2g. Data used is independent and the bill is dependent: 6 GB gives $27. Asking how many gigabytes $25 buys swaps the roles, and g=25−152=5.

Common Mistakes

  1. The slip: Swapping the axes

    Instead: independent goes on the horizontal x-axis, dependent on the vertical y-axis.

  2. The slip: Assuming the dependent variable can be chosen

    Instead: only the independent input is free; the output follows the rule.

  3. The slip: Confusing correlation direction

    Instead: the dependent quantity responds to the independent one, not the reverse.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Name the independent and dependent variable in each: (a) hours studied and test score, (b) number of guests at a party and pizzas ordered.

    Hint: Ask which quantity responds to the other.

  2. A phone's battery level is B=100−8h percent after h hours of use. Which variable is independent? Find B when h=4.5.

    Hint: Which variable do you choose, and which does the rule work out?

  3. A table gives time t (minutes): 0, 5, 10, 15 and tea temperature T (°C): 90, 75, 60, 45. Which variable is independent, what is the rule, and which axis does each go on?

    Hint: Find how much T drops for every 5 minutes.

  4. Renting a bike costs C=6+4h dollars for h hours. Write this in function notation, find C(3), and name the dependent variable.

    Hint: Function notation shows the output depending on the input.

  5. For a car moving at a set speed, d=vt with v=50 km/h. Is v the independent variable on this trip? Name the independent and dependent variables.

    Hint: Does v change during this one trip?

  6. Ice cream sales depend on the temperature. A student graphs sales on the horizontal axis and temperature on the vertical axis. What is wrong?

    Hint: Which quantity responds to the other, and where does that one belong?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Can the same quantity be independent in one problem and dependent in another?

Yes. On a taxi ride, the fare depends on the distance when you ask what a 12 km trip costs. If you ask how far $30 will take you, the fare becomes the input and the distance the output. Mathematically this swaps a function for its inverse. The quantities are the same; the question decides their roles.

Why is time almost always the independent variable?

Because nothing in the experiment changes it: time passes whatever else happens, so other quantities are recorded against it. Temperature, height and savings are measured at chosen moments, which makes time the natural input. Exceptions exist: in a question like how long a drink takes to cool to 20∘C20^\circ\text{C}, time is what you solve for, so it plays the output role there.

In an experiment, what are control variables, and are they independent variables?

Control variables are quantities you deliberately keep fixed so that they cannot affect the result, such as the same pot size and soil for every plant while you vary the water. They are not the independent variable, because you never change them during the experiment. Holding them fixed is what lets you say the difference in height came from the water.

Can a dependent variable depend on more than one independent variable?

Yes. The area of a rectangle, A=lwA=lw, depends on both length and width, and a phone bill may depend on minutes and data used. You write A=f(l,w)A=f(l,w). A flat graph can show only one input at a time, so you hold the others fixed, which turns them into parameters for that graph.

Learning Path

← Before

FunctionVariables
Dependent vs Independent Variables

You are here

You need Function (a rule giving one output per input) and Variables first. This concept adds the roles: which quantity is the input you choose, which is the output the rule returns, and which axis each belongs on. Next, Function Notation writes those roles as f(x), and Graphing Parabolas puts the input on the horizontal axis and the output on the vertical axis for quadratic rules.

See Also