Skip to content
tryhardprep
All lessons

Linear functions

14 minute read · 11 sections

Read first: Math: how the section works, Desmos basics for the test

0 of 11 sectionsSections

What the questions look like

You'll get a linear function as a formula like f(x)=6x−5f(x)=6x-5, a table, a straight-line graph, two values like f(2)=11f(2)=11, or a story with a one-time amount and an amount per unit.

Every linear function can be written as f(x)=mx+bf(x)=mx+b. In the gym's c(x)=15x+40c(x)=15x+40, mm is 15 and bb is 40.

  • mm is the How steep a line is, measured by how much it goes up for each unit it moves to the right.. It's how much the The number a function gives back, like the 13 when f(4) = 13. changes each time the The number you put into a function, like the 4 in f(4). goes up by 1. In a story it's the rate, like $15 a month.
  • bb is the output when the input is 0. Call it the starting value. On a graph, the line crosses the vertical One of the two lines a graph is measured against, one running across and one running up. at (0,b)(0,b), which is the The output when the input is 0, which is where a graph crosses the vertical axis..

Read the last line first. It might say:

  • “What is the value of f(3)f(3)?”
  • “For what value of xx does f(x)=21f(x)=21?”
  • “Which equation defines ff?”
  • “Which of the following is the best interpretation of 45 in this context?”

Some questions ask only for a difference like f(5)−f(2)f(5)-f(2), or only for bb. Keep the last line in mind so you stop at the number it wants.

Put a number in, or work backward

In Writing a function as f(x), where the number in the parentheses is the one going in., the number in the parentheses is the input. In f(4)=19f(4)=19, 4 goes in and 19 comes out.

To find f(4)f(4), replace every xx with 4.

Right
For f(x)=6x−5f(x)=6x-5, f(4)=6(4)−5=19f(4)=6(4)-5=19.
Wrong
For f(x)=6x−5f(x)=6x-5, f(4)f(4) means solving 6x−5=46x-5=4, which gives x=1.5x=1.5.

That treats 4 as the output. In f(4)f(4), 4 is the input, so it goes where xx is.

When the question gives you the output and asks for the input, set the formula equal to that output and solve. Say g(x)=35x+4g(x)=\frac{3}{5}x+4, and the question asks for the value of xx where g(x)=19g(x)=19.

  1. Set the formula equal to the output.

    35x+4=19\frac{3}{5}x+4=19
  2. Subtract 4 from both sides.

    35x=15\frac{3}{5}x=15
  3. Multiply both sides by 5.

    3x=753x=75
  4. Divide both sides by 3.

    x=25x=25
  5. Check: 15 plus 4 is 19.

    35(25)+4=19\frac{3}{5}(25)+4=19

Trap: Input and output swapped

15.4 is a choice when the question asks for the xx that makes g(x)=19g(x)=19. It comes from putting 19 in as the input: 35(19)+4=15.4\frac{3}{5}(19)+4=15.4.

What to do: Before you compute, name the number in the parentheses and the number after the equals sign. The one in the parentheses is the input.

Put a number in, or work backward

  1. Type f(x)=6x-5 on line 1 and f(4) on line 2. Desmos shows 19 next to line 2.
  2. To work backward, type the whole equation on a new line, such as 6x-5=37. Desmos draws a vertical line at the answer. Click where it crosses the horizontal axis to read x=7x=7.
  3. If the formula has a fraction, press the right arrow after the bottom number. For gg, type 3/5, press the right arrow, then type x+4=19. Without the arrow, x+4=19 ends up in the bottom of the fraction.
  4. That line sits at x=25x=25, off the starting screen, so zoom out until you see it.

A letter in the formula

Sometimes the formula has a second letter you don't know yet, like the kk in f(x)=kx+12f(x)=kx+12. You still put each input in for xx. Say the question tells you f(6)=3f(1)f(6)=3f(1) and asks for kk.

  1. Put 6 in for xx.

    f(6)=6k+12f(6)=6k+12
  2. Put 1 in for xx.

    f(1)=k+12f(1)=k+12
  3. Write f(6)=3f(1)f(6)=3f(1) with those.

    6k+12=3(k+12)6k+12=3(k+12)
  4. Multiply all of k+12k+12 by 3, including the 12.

    6k+12=3k+366k+12=3k+36
  5. Subtract 3k3k and 12 on both sides.

    3k=243k=24
  6. Divide both sides by 3.

    k=8k=8

With k=8k=8, f(6)=60f(6)=60 and f(1)=20f(1)=20, and 60 is 3 times 20, so it checks.

Trap: Only part of the output tripled

k=0k=0 comes from writing 3k+123k+12, which triples the kk and leaves the 12 alone.

What to do: Put parentheses around the whole output before you multiply, then multiply every term inside them.

Do these by hand. Until you know kk, there's no line for Desmos to draw.

Build the equation from two points

The two values might come as f(3)=195f(3)=195, as table rows, as points on a graph, or as readings in a story. Write each one as a point, input first.

A linear function ff models a food bank's supply of canned soup xx days after a delivery arrived. If f(3)=195f(3)=195 and f(7)=135f(7)=135, which equation defines ff?

  1. Write each value as a point.

    (3,195) and (7,135)(3,195) \text{ and } (7,135)
  2. Slope: the change in output over the change in input. Subtract in the same order on top and bottom.

    m=135−1957−3m=\frac{135-195}{7-3}
  3. Divide. The supply drops 15 cans a day.

    m=−604=−15m=\frac{-60}{4}=-15
  4. Put one point into f(x)=mx+bf(x)=mx+b.

    195=−15(3)+b195=-15(3)+b
  5. Multiply.

    195=−45+b195=-45+b
  6. Add 45 to both sides.

    b=240b=240
  7. Write the equation.

    f(x)=−15x+240f(x)=-15x+240
  8. Check the point you didn't use. It matches.

    −15(7)+240=135-15(7)+240=135
A falling line on a grid of x against f(x). The two readings (3, 195) and (7, 135) are marked on it, and following the line back to x = 0 reaches (0, 240), higher than either reading.
Neither reading is the starting value. Follow the line back to day 0 and the supply is 240 cans.

If the question gives you the slope and one point, skip to the row where a point goes into f(x)=mx+bf(x)=mx+b.

Don't skip the last row. The point you used to find bb will always fit, because you made it fit. Only the other point can catch a slip.

You need these two formulas by heart. The The page of formulas you can open at any point in the Math section.Read the lesson doesn't print them.

Slope, and the equation of a line

m=y2−y1x2−x1 m=\frac{y_2-y_1}{x_2-x_1} f(x)=mx+b f(x)=mx+b

Getting the slope right

The slope is the change for one unit of input, so you divide by how far the input moved. At the food bank, the supply went from 195 at day 3 to 135 at day 7.

Divide the change in output by the change in input.

Right
From (3,195)(3,195) and (7,135)(7,135), m=135−1957−3=−15m=\frac{135-195}{7-3}=-15.
Wrong
From (3,195)(3,195) and (7,135)(7,135), m=135−195=−60m=135-195=-60.

The supply drops 60 cans over four days, which is 15 a day. A slope of −60-60 gives f(x)=−60x+375f(x)=-60x+375, which says −45-45 cans at day 7.

Trap: A slope from one point

f(x)=65xf(x)=65x comes from 195÷3=65195\div3=65. It fits (3,195)(3,195), but at day 7 it gives 455 cans instead of 135.

What to do: Use both points, or a rate the story gives you. Dividing one output by its input works only when the line passes through (0,0)(0,0).

In a table, look at how far the input moves from row to row. It isn't always 1.

xxf(x)f(x)
210
622
1034
  1. The output goes up 12 from row to row.

    22−10=1222-10=12
  2. The input goes up 4 from row to row.

    6−2=46-2=4
  3. Divide the output change by the input change.

    m=124=3m=\frac{12}{4}=3
  4. Put in the first row.

    10=3(2)+b10=3(2)+b
  5. Subtract 6 from both sides.

    b=4b=4
  6. Write the equation.

    f(x)=3x+4f(x)=3x+4

Using 12 as the slope gives f(x)=12x−14f(x)=12x-14, which fits the first row and misses the other two. And 10 isn't the starting value, because the first row has x=2x=2.

When the inputs are years far apart, count years from the first one. Say a model gives a town 46 thousand people in 1994 and 94 thousand in 2010, and the question asks for its estimate for 2018.

  1. 1994 becomes 0. Then 2010 is 16 and 2018 is 24.

    x=years since 1994x=\text{years since 1994}
  2. The town grows by 3 thousand people a year.

    m=94−4616−0=4816=3m=\frac{94-46}{16-0}=\frac{48}{16}=3
  3. 1994 is now input 0, so b=46b=46.

    f(x)=3x+46f(x)=3x+46
  4. Put in 24 for 2018.

    f(24)=3(24)+46=118f(24)=3(24)+46=118

Getting the starting value right

Once you have the slope, put one point into f(x)=mx+bf(x)=mx+b and solve for bb. At the food bank, the slope is −15-15 and the supply was 195 at day 3.

A given output is bb only when its input is 0. A reading on day 3 or a count after 2 weeks is a point you use to find bb.

Right
With m=−15m=-15 and (3,195)(3,195), 195=−15(3)+b195=-15(3)+b, so b=240b=240.
Wrong
With m=−15m=-15 and (3,195)(3,195), b=195b=195.

195 is the supply at day 3. The starting value is the supply at day 0.

Trap: A flipped sign

f(x)=−15x+150f(x)=-15x+150 comes from 195−45=150195-45=150. It takes away the 45 cans that went out in the first three days, when it should add them back. At day 7 it gives 45 cans instead of 135.

What to do: On a falling line, the output goes up as you move back toward input 0. Check your equation against the other point.

The same steps work when the readings are decimals. If the answer is a A question where you type your own answer instead of picking one of four.Read the lesson, the grid-in lesson covers what fits in the box. Here's one to try.

Worked example

At Sorensen Canoe Rental, a rented canoe returns toward the dock at a constant speed. The linear function dd gives its distance, in kilometers, from the dock tt hours after tracking begins. The records show d(2)=3.8d(2)=3.8 and d(6)=2.6d(6)=2.6.

What is the value of d(0)d(0)?

Show the answer

Accepted answer: 4.4

Solution

The hourly rate is 2.6−3.86−2=−1.24=−0.3\frac{2.6-3.8}{6-2}=\frac{-1.2}{4}=-0.3 kilometer per hour. Moving from t=2t=2 back to t=0t=0 adds 0.60.6 kilometer, so d(0)=3.8−(−0.3)(2)=4.4d(0)=3.8-(-0.3)(2)=4.4.

A common wrong answer is 3.83.8, which reports the recorded value d(2)d(2) without extending the A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson back to The number you put into a function, like the 4 in f(4).Read the lesson 00. Another common wrong answer is 3.23.2, which subtracts 0.60.6 when moving backward from t=2t=2 to t=0t=0, reversing the direction of the change.

Check your equation in Desmos

Desmos mostly catches slips here, so use it when a fraction or a negative number makes one likely. Here's how to test the food bank's choices.

Test the choices against the points

  1. Open the plus menu and choose Table. Type 3 and 7 in the x1x_1 column and 195 and 135 in the y1y_1 column.
  2. Zoom out until you can see both dots.
  3. On a new line, type a choice with y= in front, such as y=-15x+240.
  4. If the line misses either dot, that choice is out. Change the line to the next choice.

The right choice goes through both dots. A line with the wrong sign misses at least one, so this catches sign slips too.

Desmos can also find mm and bb from the same table.

Get the slope and starting value from the table

  1. On a new line, type y1~mx1+b. The ~ needs Shift.
  2. The box under that line shows m=−15m=-15 and b=240b=240.

Desmos for data shows more of this. To read where a graphed line crosses an axis, click the line, then click the gray dot that appears there.

Now try one, and test its choices in Desmos.

Worked example

At a paper mill, Ilona uses the linear function ww to model a finished roll’s width, in centimeters, at guide setting ss. She records w(4)=79w(4)=79 and w(7)=121w(7)=121.

Which equation defines ww?

  1. A

    w(s)=19.75sw(s) = 19.75s

  2. B

    w(s)=42s−89w(s) = 42s - 89

  3. C

    w(s)=14s+23w(s) = 14s + 23

  4. D

    w(s)=23s+14w(s) = 23s + 14

Show the answer
  • A

    w(s)=19.75sw(s) = 19.75s

    This uses 79/4=19.7579/4=19.75 as the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson, which incorrectly computes the rate from one point and assumes the line passes through the origin. The slope must come from the change between the two recorded points.

  • B

    w(s)=42s−89w(s) = 42s - 89

    This uses the total width change, 121−79=42121-79=42, as the rate per setting. That change occurs over 7−4=37-4=3 settings, so the per-setting rate is 42/342/3.

  • C

    w(s)=14s+23w(s) = 14s + 23

    Correct answer

    The How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson is (121−79)/(7−4)=14(121-79)/(7-4)=14. Substituting s=4s=4 and w(4)=79w(4)=79 gives 79=14(4)+b79=14(4)+b, so b=23b=23 and w(s)=14s+23w(s)=14s+23.

  • D

    w(s)=23s+14w(s) = 23s + 14

    This reverses the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson and Where a graph crosses an axis.Read the lesson. The width increases by 1414 centimeters per setting, and the intercept is 2323, so those values cannot switch positions.

Solution

Use the two recorded points, (4,79)(4,79) and (7,121)(7,121), to find the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson:

m=121−797−4=423=14m=\dfrac{121-79}{7-4}=\dfrac{42}{3}=14. Write the A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson as w(s)=14s+bw(s)=14s+b. Substitute w(4)=79w(4)=79:

79=14(4)+b79=14(4)+b

79=56+b79=56+b

b=23b=23. Therefore, the Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson is w(s)=14s+23w(s)=14s+23. Checking the other point gives w(7)=14(7)+23=121w(7)=14(7)+23=121, as required.

When only the change is asked

For f(x)=6x−5f(x)=6x-5, f(5)=25f(5)=25 and f(2)=7f(2)=7, so f(5)−f(2)=18f(5)-f(2)=18. You can skip finding the two outputs, though. The −5-5 cancels when you subtract, and each step of 1 in the input adds 6 to the output.

The change in output is the slope times the change in input.

Right
For f(x)=6x−5f(x)=6x-5, f(5)−f(2)=6(5−2)=18f(5)-f(2)=6(5-2)=18.
Wrong
For f(x)=6x−5f(x)=6x-5, f(5)−f(2)=5−2=3f(5)-f(2)=5-2=3.

3 is how far the input moved. Three steps of 6 make 18.

A question can also give the change like this:

h(x+3)=h(x)−12 h(x+3)=h(x)-12

It says that when the input goes up 3, the output goes down 12. So if h(2)=20h(2)=20, then h(5)=8h(5)=8. Say the question gives h(2)=20h(2)=20 and asks which equation defines hh.

  1. Change in output over change in input.

    m=−123=−4m=\frac{-12}{3}=-4
  2. Put in h(2)=20h(2)=20.

    20=−4(2)+b20=-4(2)+b
  3. Add 8 to both sides.

    b=28b=28
  4. Write the equation.

    h(x)=−4x+28h(x)=-4x+28
  5. Check: 3 more in, 12 less out.

    h(5)=−4(5)+28=8h(5)=-4(5)+28=8

Trap: The whole drop as the slope

h(x)=−12x+44h(x)=-12x+44 uses −12-12 as the slope. It fits h(2)=20h(2)=20, but it gives h(5)=−16h(5)=-16 where it should give 8.

What to do: Divide the output change by the input change, which is 3 here.

Write the equation from a story

In a story, find the amount that comes once and the amount per unit. The amount per unit multiplies the input, and the one-time amount stands alone. A gym charges $40 to join and $15 a month, so after xx months you've paid c(x)=15x+40c(x)=15x+40.

Trap: Rate and starting value swapped

c(x)=40x+15c(x)=40x+15 has both right numbers in each other's places. It says the gym charges $40 a month.

What to do: Read the equation aloud with units: 15 dollars a month times xx months, plus 40 dollars once. The number multiplied by the input has to be the rate.

The words also tell you the sign. When something is used up or given out, the amount left goes down, so its slope is negative. The food bank gives out 15 cans a day.

When the amount falls, the slope is negative. A wrong sign can fit one point, so check the other one.

Right
Cans left after xx days: f(x)=−15x+240f(x)=-15x+240.
Wrong
Cans left after xx days: f(x)=15x+150f(x)=15x+150.

The supply goes down 15 a day, so the slope is −15-15. The wrong equation fits day 3, where it gives 195, but it gives 255 at day 7.

Some stories charge one price for the first day and another for each day after. A rental costs $60 for the first day and $25 for each day after that.

  1. $60 for day 1, then $25 for each of the other x−1x-1 days.

    60+25(x−1)60+25(x-1)
  2. Multiply out 25(x−1)25(x-1).

    60+25x−2560+25x-25
  3. Combine 60 and −25-25.

    25x+3525x+35

Trap: The first day counted twice

25x+6025x+60 charges $25 for the first day on top of the $60. At x=1x=1 it gives 85, but one day costs 60.

What to do: Put x=1x=1 into your equation. It should give the first-day price.

The first price can cover more than one unit. At $50 for the first 3 hours and $12 for each hour after, the $12 is charged for x−3x-3 hours, so the cost is 50+12(x−3)=12x+1450+12(x-3)=12x+14.

Words like “twice” or “half” add one more step. Write the model for one time first, then multiply the whole thing. A cleaning costs $30 to set up plus $5 per room, so one cleaning of xx rooms costs 5x+305x+30.

  1. Two cleanings: double all of it.

    2(5x+30)2(5x+30)
  2. Multiply both parts by 2.

    10x+6010x+60

If the $30 setup is charged only once, two cleanings cost 10x+3010x+30. Check which parts the story repeats.

What a number in the model means

s(w)=45w+120s(w)=45w+120 gives the dollars in a student's savings account ww weeks after she starts a summer job.

The number multiplying the input, its The number multiplying a letter, like the 5 in 5x.Read the lesson, is the change for each one unit of input. The number standing alone is the output at input 0, here $120 at week 0.

Right
45 is the number of dollars added each week.
Wrong
45 is the total after one week.

After one week the total is 45(1)+120=16545(1)+120=165. The 45 is how much the total grows each week.

Trap: A sentence about the other number

Asked about 45, a choice says the account held $120 when the job started. That's true, but it's what 120 means.

What to do: First decide whether the number multiplies the input or stands alone. Then read only the choices that describe that role.

Check the input's unit too. If a hose adds 5 gallons a minute and tt counts hours, the rate in the model is 5×60=3005\times60=300 gallons an hour. A choice that says 300 gallons a minute has the wrong unit. Change a rate to the input's unit before you use it.

A question can also ask what the The value of x where a graph crosses the horizontal axis, so the output there is 0.Read the lesson means. That's where the output is 0. For the food bank's f(x)=−15x+240f(x)=-15x+240:

  1. Set the output to 0.

    −15x+240=0-15x+240=0
  2. Add 15x15x to both sides.

    240=15x240=15x
  3. Divide both sides by 15.

    x=16x=16

The food bank runs out of soup 16 days after the delivery arrived.

A question that asks only what a number means has nothing to compute, so leave Desmos closed. Try one where the units differ.

Worked example

Petra installs roof tiles at a constant daily rate. The function rr, defined by r(w)=144(7w)+216r(w)=144(7w)+216, gives her cumulative tile count ww weeks after recording began. She works every day.

Which of the following is the best interpretation of the coefficient of ww in this context?

  1. A

    Petra has installed 1,008 tiles when recording begins.

  2. B

    Petra installs 1,008 additional tiles each week after recording begins.

  3. C

    Petra installs 1,008 additional tiles each day after recording begins.

  4. D

    Petra has installed 1,008 tiles in total one week after recording begins.

Show the answer
  • A

    Petra has installed 1,008 tiles when recording begins.

    This swaps the meanings of the The number multiplying a letter, like the 5 in 5x.Read the lesson and the Where a graph crosses an axis.Read the lesson. The count when recording begins is the A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson term, 216216, because w=0w=0 at that time.

  • B

    Petra installs 1,008 additional tiles each week after recording begins.

    Correct answer

    Multiplying 144144 by 77 gives r(w)=1,008w+216r(w)=1{,}008w+216. Since ww measures weeks, the The number multiplying a letter, like the 5 in 5x.Read the lesson means Petra installs 1,0081{,}008 additional tiles each week.

  • C

    Petra installs 1,008 additional tiles each day after recording begins.

    This assigns the weekly increase of 1,0081{,}008 tiles to each day, overlooking that ww measures weeks. The daily rate is 144144 tiles.

  • D

    Petra has installed 1,008 tiles in total one week after recording begins.

    This treats the The number multiplying a letter, like the 5 in 5x.Read the lesson as r(1)r(1), leaving out the 216216 tiles already installed when recording begins. The cumulative count after one week is 1,008+216=1,2241{,}008+216=1{,}224 tiles.

Solution

Multiply the factors in the term containing ww: 144(7w)=1,008w144(7w)=1{,}008w. The A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson becomes r(w)=1,008w+216r(w)=1{,}008w+216, so the The number multiplying a letter, like the 5 in 5x.Read the lesson of ww is 1,0081{,}008.

Each increase of 11 in ww represents one week and increases r(w)r(w) by 1,0081{,}008. Therefore, Petra installs 1,0081{,}008 additional tiles each week after recording begins.

Practice

Before each one, decide whether you're putting a number in, working backward, building the equation, or saying what a number means. When you build an equation, check it against a value you didn't use.

Try it

5 questions on this skill, with every choice explained.

Start the drill

Next steps