math.wiki
Functions › What a function is › Definition of a function › Independent and dependent variables
Open on the map
Math 6 · 6.EE.C.9

Independent and dependent variables

When two amounts change together, which one do you get to choose, and how do you write the other in terms of it?

Where you are 3 in Definition of a function

Why this exists

Abeni runs a dog walking business: the more dogs she walks, the more she earns. Valen drops an ice cube into a glass: the longer it sits, the less ice is left. Each has two amounts that change together, but they do not play the same part. Abeni decides how many dogs to take, and her earnings follow. Nobody decides how much ice is left; it follows from the minutes that have passed. One amount is set first and the other is worked out from it.

Saying which is which lets you write the relationship down: one short equation that turns any number of dogs into earnings, a table built from it, and a picture on a grid. The machine picture is the idea underneath: one amount goes in, the other comes out.

Definition

When two quantities change together and one is worked out from the other:

  • the independent variable is the quantity whose value is chosen, or which runs on by itself, like time. Nothing in the situation works it out;
  • the dependent variable is the quantity whose value is worked out from the independent variable. Its value depends on the value chosen.

A quick test is the sentence “the ___ depends on the ___”, with the dependent variable in the first blank. “The earnings depend on the number of dogs” makes sense; “the number of dogs depends on the earnings” describes nothing Abeni does.

Each variable gets a letter, as in what a letter stands for, and a unit. For Abeni, at 6 dollars a dog, let n be the number of dogs and e her earnings in dollars:

e = 6n

The dependent variable stands alone on the left, and the right side says how to work it out from the independent variable. This is an equation in two variables, read “e equals 6 times n”. In the machine picture, n is the input and e the output.

Tables and graphs

In a table, the independent variable goes in the first column and the dependent variable in the second, so each row reads “choose this, get that”. On a graph, the independent variable runs across the bottom (the x-axis) and the dependent variable up the side (the y-axis). Each row of the table becomes one point: the value chosen is how far across, the value worked out is how far up. In this lesson every value is zero or positive, so every point sits in the first quadrant, the quarter of the grid where both numbers are zero or more.

Intuition

Think of the independent variable as a dial you set and the dependent variable as a meter that reads the result. Turn the dial to 3 dogs and the meter shows 18 dollars; you never set the meter directly. Time is a dial that turns by itself, which is why it is so often independent.

0 1 2 3 4 5 0 6 12 18 24 30 dogs walked, n earnings (dollars), e (3, 18)
Figure 1Choose the number of dogs along the bottom, then read the earnings up the side.

Figure 1 puts the dial and the meter on a grid. Choose a number of dogs along the bottom, go up to the dot, then across to read the earnings. The dashed path does this for 3 dogs and arrives at 18 dollars, the point (3, 18): first the value chosen, then the value it gives.

Tables and graphs

A table lists the pairs; a graph draws them, so the pattern shows at once. In Figure 1 each dot is 6 higher than the one before, because each extra dog adds 6 dollars. Equal steps across give equal steps up, and that is why the dots line up.

Results

The dependent variable stands alone. An equation like p = 11h or c = 5 + 3n gives the dependent variable by itself on one side. Putting any allowed value of the independent variable into the other side gives exactly one value of the dependent variable.

Equal steps in, equal steps out. In c = b + kn, with b and k zero or positive, each time n goes up by 1, c goes up by k. In m = b - kt, each time t goes up by 1, m goes down by k, for as long as m stays zero or more.

The number standing alone is the starting value. In c = b + kn or m = b - kt, when the independent variable is 0 the dependent variable equals b.

Tables and graphs

Rows are points. A row with independent value x and dependent value y is the point (x, y) on the graph, and a point of the graph is a row of the table.

Equal steps make a straight line. When equal steps across always give equal steps up (or down), the points lie on one straight line.

Why it is true

Equal steps. Raising n by 1 in c = b + kn gives b + k(n + 1), which is b + kn + k by the distributive property: the old value with k more. In m = b - kt, raising t by 1 takes away k once more.

The starting value. When the independent variable is 0, the part kn is k \times 0 = 0, so only b is left.

Tables and graphs

Rows are points because a point is plotted by going across by the row’s first number and up by its second.

Straight line. Draw a staircase from each point to the next: across 1, then up k. Every stair is the same shape, just slid along, so the slant from one corner to the next is the same every time, and the slanting pieces join with no bend.

Worked examples

Example 1

Naming the two variables

For each pair, say which quantity is independent and which is dependent, and complete “the ___ depends on the ___”.

  • (a) The number of dogs Abeni walks on a Saturday, and the money she earns.
  • (b) The minutes since Valen dropped an ice cube into a glass, and the grams of ice left.
  • (c) The hours Nadim babysits, and his pay.
  • (d) The temperature of the room Valen’s glass stands in, and the time the ice cube takes to melt.
Solution

(a) Abeni chooses how many dogs to take. The money depends on the number of dogs: dogs are independent, money is dependent.

(b) Minutes pass by themselves. The grams of ice left depend on the minutes.

(c) Nadim agrees the hours before he starts. The pay depends on the hours.

(d) A warm room melts the cube faster, so the melting time is worked out from the temperature. The melting time depends on the room temperature: here time is the dependent variable. Time turns by itself only when the question is “how much after this long?”, not “how long does it take?”.

Example 2

Writing an equation

Nadim earns 11 dollars for each hour of babysitting. Name the variables, write an equation for his pay in terms of the hours, and find his pay for 3 hours and for 2.5 hours.

Solution

Let h be the hours (independent) and p the pay in dollars (dependent). Every hour adds 11 dollars, so h hours bring h lots of 11:

p = 11h

For 3 hours, put 3 in place of h: p = 11 \times 3 = 33, so 33 dollars. Part of an hour is allowed, so p = 11 \times 2.5 = 27.5, which is 27.50 dollars.

Example 3

A fee plus a rate

Abeni charges a 5 dollar visit fee for each house she collects from, plus 3 dollars for each dog she takes from that house. Write an equation for the charge c in terms of the number of dogs n, and find the charge for 4 dogs. Does c = 3n + 5 say the same thing?

Solution

The owner chooses the number of dogs, so n is independent and c dependent. Build the rule from small cases: one dog costs 5 + 3 = 8 dollars, two dogs 5 + 3 + 3 = 11. The fee is paid once and 3 is added once per dog, so

c = 5 + 3n

For 4 dogs, multiply before adding: c = 5 + 3 \times 4 = 5 + 12 = 17, so 17 dollars.

Yes, c = 3n + 5 says the same thing: the same two parts in the other order, and by the commutative property of addition the order does not change a sum.

Example 4

Which one is chosen depends on the question

Nadim still earns 11 dollars an hour. Write an equation for each question, and say which variable is independent in each.

  • (a) How much does he earn if he works h hours?
  • (b) How many hours must he work to earn p dollars? Find the hours for 66 dollars.
Solution

(a) Hours are chosen and pay is worked out, as in Example 2: p = 11h, with h independent.

(b) Now the money is chosen first, perhaps because Nadim is saving for something that costs 66 dollars, and the hours are worked out. The number of hours is how many 11s fit into p:

h = p \div 11

Here p is independent. For 66 dollars, h = 66 \div 11 = 6 hours. Check: 11 \times 6 = 66. Both equations hold the same pairs, such as 6 hours with 66 dollars; what changed is which number is known first.

Example 5

From an equation to a table and a graph

Valen drops an ice cube of 24 grams into a glass of water. Suppose it loses 3 grams of ice every minute until it is gone. Write an equation for the ice left, make a table every 2 minutes, and draw the graph.

Solution

The minutes t run on by themselves, so t is independent and the grams left, m, dependent. After t minutes, 3t grams have melted, so

m = 24 - 3t

The ice is gone when 3t reaches 24, at t = 8, since 3 \times 8 = 24. Putting each value of t into the equation, for instance 24 - 3 \times 6 = 24 - 18 = 6:

Minutes tIce left (grams) m
024
218
412
66
80
0 1 2 3 4 5 6 7 8 0 6 12 18 24 minutes, t ice left (grams), m
Figure 2Valen’s ice cube, with the points of the table and the line through them.

On the graph (Figure 2) each row is a point: (0, 24), (2, 18), (4, 12), (6, 6) and (8, 0). Every 2 minutes the ice falls by 6 grams, so the points line up. Time also passes through every moment between them, and the ice melts then too, so a line through the points shows the whole 8 minutes. It stops at (8, 0), where the ice is gone.

Example 6

From a graph to a table and an equation

Figure 3 shows what Zeke charges for a group walk, by the number of dogs on it. Make a table, write an equation, and find the charge for 7 dogs.

0 1 2 3 4 5 0 4 8 12 16 20 24 dogs on the walk, n charge (dollars), c
Figure 3What Zeke charges for one group walk.
Solution

The dogs n are across the bottom, so they are independent; the charge c in dollars is dependent. Reading the dots:

Dogs nCharge (dollars) c
110
214
318
422

Each extra dog adds 4 dollars. One step back from 1 dog, to 0 dogs, gives 10 - 4 = 6. So the charge is 6 dollars to start with and 4 for each dog:

c = 6 + 4n

Check every row: 6 + 4 \times 1 = 10, 6 + 4 \times 2 = 14, 6 + 4 \times 3 = 18, 6 + 4 \times 4 = 22. For 7 dogs, c = 6 + 4 \times 7 = 6 + 28 = 34, so 34 dollars, trusting the pattern to carry on past the dots shown. The dots are not joined: a walk can have 2 or 3 dogs but not 2.5.

Example 7

Comparing two babysitters

A family needs a babysitter. Pim charges 10 dollars an hour. Zeke charges a 6 dollar bus fare plus 8 dollars an hour. Write an equation for each, make a table for 0 to 5 hours, and decide who costs less for a 5 hour evening. When do they cost the same?

Solution

For both, the hours h are chosen and the pay p depends on them. Pim: p = 10h. Zeke: p = 6 + 8h.

Hours hPim’s payZeke’s pay
006
11014
22022
33030
44038
55046

For 5 hours Pim costs 50 dollars and Zeke 46, so Zeke costs 4 dollars less. They cost the same at 3 hours, 30 dollars each; for shorter jobs Pim costs less. Zeke starts 6 dollars higher, but each hour Pim’s total grows by 10 and Zeke’s by 8, so the gap shrinks by 2 an hour and closes after 6 \div 2 = 3 hours.

0 1 2 3 4 5 0 10 20 30 40 50 hours, h pay (dollars), p Pim Zeke (3, 30)
Figure 4Pim’s pay (solid) and Zeke’s pay (dashed). Where the lines cross, the two cost the same.

On the graph (Figure 4) the two lines cross at (3, 30). Both can share one grid because both use the same independent variable across the bottom.

Boundaries

Not every pair has a dependent one. The number of letters in a person’s name and that person’s height both vary, but neither is worked out from the other.

Which is independent comes from the question. In Example 4 hours and pay swapped roles when the question changed, and in Example 1(d) time was dependent.

An equation holds only for allowed values. For t = 9, the equation m = 24 - 3t would melt 3 \times 9 = 27 grams from a cube of only 24 grams, which cannot happen: the relationship stops at 8 minutes. In c = 6 + 4n, n can only be a whole number: 0, 1, 2, 3 and so on.

Dots or a line. Join the points only when the independent variable can take every value in between, as time can. When it counts whole things, such as dogs, the graph is separate dots.

A steady rate is a model. A real ice cube melts faster or slower as the water around it changes. “Suppose it loses 3 grams every minute” is a simpler picture to reason with.

Where this goes next

Saying that the dependent variable is worked out from the independent one is, in Math 8, saying it is a function of it, and Figure 2 is a graph of a function. Reading a statement such as “C of 12 equals 40” is function notation in a real situation, and turning a paragraph of words into an equation is building a model from a description.

Equations with no number standing alone, such as p = 11h, have graphs through (0, 0): the proportional relationships of recognizing a proportional relationship in a graph. The step the dependent variable takes for each step of 1 grows into the rate of change. When negative values are allowed, the graph spreads into all four quadrants, and the allowed values become domain and range.

Exercises

Exercises 1 to 11 go with the first day, and 12 to 24 with the second.

Naming the variables

  1. Which is independent and which dependent: the number of days since a seed was planted, or the height of the seedling? Complete “the ___ depends on the ___”.
  2. Which is independent and which dependent: the number of cinema tickets bought, or the total cost?
  3. Zeke packs one lead for each dog on a walk, plus one spare. Name the independent and dependent variables, write an equation for the number of leads l in terms of the number of dogs n, and find the leads for 5 dogs.
  4. Valen plans 3 ice cubes for each guest at a party. Name the variables, write an equation for the number of cubes c in terms of the number of guests g, and find the cubes for 12 guests.

Writing the equation

  1. Pim earns 9 dollars an hour babysitting. Write an equation for her pay p in terms of the hours h, then find her pay for 4 hours and for 1.5 hours.
  2. Valen’s freezer trays each make 14 ice cubes. Write an equation for the number of cubes c made from t trays, and find c for 5 trays.
  3. For a short walk, Abeni charges a 7 dollar visit fee plus 2 dollars a dog. Write an equation for the charge c for n dogs, and find the charge for 4 dogs.
  4. An ice cube of 18 grams loses 2 grams each minute. Write an equation for the grams left m after t minutes. How much is left after 5 minutes, and when is it all gone?
  5. For a late evening, Nadim is paid a 5 dollar taxi fare plus 12 dollars an hour. Write an equation for his pay p for h hours, and find it for 3 hours.
  6. Pim earns 8 dollars an hour and wants to know how many hours h she must work to earn p dollars. Which variable is independent here? Write the equation, and find the hours for 56 dollars.
  7. In y = 4x + 1, which letter is the independent variable? Find y when x = 2.5 and when \displaystyle x = \frac{3}{4}.

Tables

  1. Copy and complete the table for c = 3 + 4n, for n = 0, 1, 2, 3, 4.
  2. A table pairs hours h = 1, 2, 3, 4 with pay p = 13, 26, 39, 52 dollars. Which variable is independent? Write an equation for p, and find the pay for 6 hours.
  3. By Monday Abeni had done 6 walks this month, and she does 4 more every day after that. Make a table of her total walks w after d days, for d = 0 to 3, write an equation, and find her total after 10 days.
  4. A table claims to follow c = 2 + 5n. Its rows are (1, 7), (2, 12), (3, 16) and (4, 22). Which row is wrong, and what should it say?

Graphs

0 1 2 3 4 5 0 4 8 12 16 20 minutes, t ice left (grams), m
Figure 5A second ice cube, for the exercises.
  1. For e = 2.5n, list the points for n = 0, 2, 4, 6. Which variable goes across the bottom of the graph?
  2. Use Figure 5. (a) Which variable is independent? (b) How much ice is left after 3 minutes? (c) Write an equation for m in terms of t. (d) When is the ice all gone?
  3. Which of these points lie on the graph of c = 4 + 2n: (0, 4), (3, 10), (5, 12), (1.5, 7)?
  4. For a group walk, Pim charges 5 dollars a dog and Zeke charges 8 dollars plus 3 dollars a dog. Write both equations, make a table for n = 0 to 6 dogs, and find when they charge the same. Who is cheaper for 6 dogs?

Reasoning

  1. Explain why time is so often the independent variable, and give a situation from this lesson where it is not.
  2. Valen’s trays each make 14 cubes. Write one question in which the number of trays is the independent variable and one in which the number of cubes is, with an equation for each.
  3. Show that in c = 7 + 2n, raising n by 1 always raises c by exactly 2.
  4. Should the dots of Figure 1 be joined by a line? Should the line of Figure 2 carry on past 8 minutes? Explain both.
  5. Zeke plots Pim’s babysitting pay with pay across the bottom and hours up the side. Is his graph wrong? What is different about it?
Answers
  1. The height depends on the days. Days pass by themselves; the height is what they have grown.
  2. The cost depends on the number of tickets. Tickets are independent, cost dependent.
  3. Dogs n are independent, leads l dependent: l = n + 1. For 5 dogs, l = 5 + 1 = 6 leads.
  4. Guests g are independent, cubes c dependent: c = 3g. For 12 guests, c = 3 \times 12 = 36 cubes.
  5. p = 9h. For 4 hours, 9 \times 4 = 36 dollars; for 1.5 hours, 9 \times 1.5 = 13.5, so 13.50 dollars.
  6. c = 14t. For 5 trays, c = 14 \times 5 = 70 cubes.
  7. c = 7 + 2n. For 4 dogs, c = 7 + 2 \times 4 = 15 dollars.
  8. m = 18 - 2t. After 5 minutes, m = 18 - 10 = 8 grams. It is gone when 2t = 18, at t = 9 minutes.
  9. p = 5 + 12h. For 3 hours, p = 5 + 36 = 41 dollars.
  10. The money p is chosen first, so p is independent: h = p \div 8. For 56 dollars, h = 56 \div 8 = 7 hours (check: 8 \times 7 = 56).
  11. x is independent, since y stands alone. y = 4 \times 2.5 + 1 = 11, and \displaystyle y = 4 \times \frac{3}{4} + 1 = 3 + 1 = 4.
  12. c = 3, 7, 11, 15, 19: start at 3 + 4 \times 0 = 3 and add 4 each step.
  13. Hours are independent. Each hour adds 13, and 1 hour gives 13, so p = 13h, which fits every row. For 6 hours, p = 13 \times 6 = 78 dollars.
  14. w = 6, 10, 14, 18 for d = 0, 1, 2, 3, so w = 6 + 4d. After 10 days, w = 6 + 40 = 46 walks.
  15. (3, 16) is wrong: 2 + 5 \times 3 = 17, so it should be (3, 17). The others fit.
  16. (0, 0), (2, 5), (4, 10), (6, 15). The independent variable n goes across the bottom.
  17. (a) The minutes t. (b) 8 grams. (c) It starts at 20 grams and falls 4 grams a minute, so m = 20 - 4t. (d) After 5 minutes, where the line meets the bottom axis: 20 - 4 \times 5 = 0.
  18. (0, 4), (3, 10) and (1.5, 7) lie on it: 4 + 0 = 4, 4 + 6 = 10, 4 + 3 = 7. Not (5, 12), since 4 + 2 \times 5 = 14.
  19. Pim c = 5n: 0, 5, 10, 15, 20, 25, 30. Zeke c = 8 + 3n: 8, 11, 14, 17, 20, 23, 26. The same for 4 dogs, 20 dollars each. For 6 dogs Zeke is cheaper: 26 dollars against 30.
  20. Nothing in a situation speeds time up or slows it down, so it runs on by itself and other amounts are worked out from it. In Example 1(d) the melting time was worked out from the room temperature.
  21. “How many cubes do t trays make?”: trays independent, c = 14t. “How many trays are needed for c cubes?”: cubes independent, t = c \div 14.
  22. 7 + 2(n + 1) = 7 + 2n + 2 by the distributive property: the old value 7 + 2n with 2 more, whatever n was.
  23. No line in Figure 1: there is nothing between 2 dogs and 3. The line of Figure 2 stops at 8 minutes: the ice is gone, and the equation would melt more ice than the cube had.
  24. Not wrong: the points hold the same pairs, but written (pay, hours), such as (30, 3), so a reader must choose up the side and read across. Putting the independent variable across the bottom is the shared habit that lets anyone read a graph the same way.
kg1128 · updated 2026-10-13 · CC-BY-SA-4.0