On this concept: Formula

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

Math · Algebra Fundamentals · Grade 6-8

Linear Functions

A linear function has a constant rate of change and graphs as a straight line.

y=mx+b
y = 2 · x0123456(1, 2)

A point testing a line for linearity: every equal step in $x$ moves $y$ by the same $+2$, everywhere on the graph.


Quick Answer

A linear function has a constant rate of change and graphs as a straight line. Use one whenever a quantity starts at some value and then grows or shrinks by a fixed amount per unit of input: a taxi fare, a candle burning 2 cm an hour, a tank filling at a steady rate. Written y=mx+b, the slope m is the change for each 1-unit step in x and b is the starting value, the output when x=0. Those two numbers let you predict any output, or work backwards to the input.

Why This Matters

A linear function packs a whole table into two numbers, so you can find the 100th value without listing the first 99, or work back from a total to the input. It is also the first model to try on data. Recognising when data are not linear, because the steps grow or shrink, tells you to switch to a different model, such as a quadratic or an exponential.

Intuitive Explanation

A taxi charges $4 when you get in and $2 for each mile. Make a table: 0 miles costs $4, 1 mile $6, 2 miles $8, 3 miles $10. Every extra mile adds exactly $2. That steady step is the slope, and the $4 you pay before moving is the y-intercept. Together they give the rule y=2x+4, and the table's points all lie on one straight line.

The two numbers do different jobs. Raise the starting fee to $6 and the line slides up but keeps its steepness: y=2x+6. Raise the per-mile price to $3 and the line tilts more steeply but still starts at 4: y=3x+4. When reading a story, ask which amount happens once (the intercept) and which happens at every step (the slope).

Not every rule with x in it is linear. For squares with sides 1, 2, 3 and 4, the areas are 1, 4, 9 and 16. The steps are 3, 5 and 7, growing each time, so the graph bends: that is y=x2, a quadratic. To test a table, check that equal input steps give equal output steps all the way through, not just between two points.

Think of it like this. Stack identical books on a table. The table top is the starting height, and every book adds the same thickness: on a 75 cm table with 3 cm books, n books reach 3n+75 cm. That is a linear function. Real stacks only allow whole books, but the function accepts any value of n, even fractions and negatives.

Core idea. A linear function adds the same amount to output for each equal input step.


When to Use

Model with a linear function when a story has a fixed starting amount plus a constant rate ("$5 per hour", "drops 6.5 °C per kilometre climbed"), when a table's outputs rise or fall by a fixed difference, or when a graph is a straight line. In an equation, x appears only to the first power: not squared, not in a denominator. If equal steps multiply the output by the same factor, use an exponential model; if the differences themselves grow steadily, use a quadratic.

Tip. Ask: Does the output change by the same amount each time the input step is the same?

How to Recognize It

Before you write y=mx+b, check that the story or table has one steady rate, and pin down what its starting value is.

  1. Is there an amount you pay or have before anything happens, such as a joining fee or a starting height?

    If yes, that is b, the output when the input is 0. If the starting amount is 0, the function is proportional, y=mx, and its graph passes through the origin.

  2. Does the quantity change by adding a fixed amount, rather than multiplying by a fixed factor?

    If it adds, as in $5 more each week, it is linear. If it multiplies, as in doubling each week or losing 10% a year, it is exponential, and the graph curves.

  3. Do the jumps between outputs themselves grow by the same amount each time, as in 1, 4, 9, 16?

    If yes, the first differences 3, 5, 7 are not constant but the second differences are, so the model is quadratic, not linear. A linear table has equal first differences.

  4. Can the input sensibly take any value, or only whole numbers?

    If only whole numbers make sense, such as tickets or books, the graph is really separate dots along a line. You can still use y=mx+b, but an answer like 3.5 tickets needs rounding back to the story.

Linear Functions compared with Proportional relationship and Nonlinear relationship

Linear, proportional and nonlinear relationships all link an input to an output, and all can be shown in a table. Ask whether the outputs rise or fall by equal jumps and, if they do, whether the output at 0 is 0.

Linear Functions

Meaning
Use this when a relationship changes by the same amount for each equal input step.
Key test
Does the output change by the same amount each time the input step is the same?
Formula
y=mx+b
Example
A taxi costs $4 before the trip begins and then adds $2 for each mile. Is the total fare a linear function of miles, and what do the slope and intercept mean?

Proportional relationship

Meaning
A linear relationship that goes through the origin.
Key test
Use when there is no starting amount.
Formula
y=kx
Example
Cost at $3 per ticket with no fee

Nonlinear relationship

Meaning
Rate of change is not constant.
Key test
Use when differences or slope change.
Example
Area of a square as side changes

Formula & Notation

y=mx+b
A function f:R→R is linear if ∃ m,b∈R such that f(x)=mx+b for all x. Equivalently, f is linear iff f(x2)−f(x1)x2−x1=m for all x1≠x2.

How to read it: m is slope and b is the y-intercept.

Worked Examples

Example 1 — Constant fare increase

Easy

A taxi costs $4 before the trip begins and then adds $2 for each mile. Is the total fare a linear function of miles, and what do the slope and intercept mean?
Show the steps and the answer
  1. Make a short table: 0 mi costs $4, 1 mi $6, 2 mi $8, 3 mi $10.

    Each extra mile adds the same $2, so the fare changes at a constant rate: that makes it linear.

  2. Read the slope: m=2 dollars per mile.

    The amount added for every 1-mile step is the slope.

  3. Read the intercept: b=4 dollars, the fare at 0 miles.

    The fee paid before the taxi moves is the output when the input is 0.

  4. Write y=2x+4 and test it at 3 miles: 2(3)+4=10.

    The rule matches the table, so it gives the fare for any distance.

Answer: Linear: y=2x+4

Takeaway: A one-time amount plus a fixed amount per step is linear: the per-step amount is the slope and the one-time amount is the intercept.

Example 2 — Square area

Standard

The side length of a square increases by 1 each time: 1, 2, 3, 4. The areas are 1, 4, 9, 16. Is area a linear function of side length?
Show the steps and the answer
  1. Find the output changes: 4−1=3, 9−4=5, 16−9=7.

    The inputs rise by 1 each time, so a linear function would show one repeated change.

  2. See that the changes themselves grow by 2 each time.

    Changes that grow by a constant amount are the signature of a quadratic, here A=s2.

  3. See the danger of using only two points: the line through (1,1) and (2,4) is y=3x−2, which predicts 3(4)−2=10 at s=4, not 16.

    Any two points fit some line; only the whole table reveals the curve.

Answer: No, area is not linear in side length.

Takeaway: Test every step of a table, not just two points; a square's area grows faster and faster because A=s2.

Example 3 — Find the mistake: slope and intercept swapped

Application

A plumber charges $60 to come out plus $45 per hour of work. Lena writes the cost as C=60h+45 and says 3 hours cost $225. What did Lena mix up, and what do 3 hours really cost?
Show the steps and the answer
  1. Sort the charges: the $60 call-out fee is paid once; the $45 is paid for every hour.

    The amount repeated each hour is the rate of change, and the one-time amount is the starting value.

  2. Match them to y=mx+b: slope m=45, intercept b=60, so C=45h+60.

    Lena put the one-time fee where the hourly rate belongs.

  3. Evaluate at 3 hours: 45(3)+60=135+60=195.

    Three hours of labour plus one call-out fee.

  4. Test Lena's rule at h=0: it gives $45, but a visit with no work still costs the $60 fee.

    Plugging in 0 exposes a swapped intercept at once.

Answer: C=45h+60, so 3 hours cost $195.

Takeaway: The per-step amount multiplies x; the one-time amount is added on. Plug in x=0 to check the starting value.

Where You'll See It

  • Filling a swimming pool

    A pool already holds 2,000 litres and a hose adds 15 litres a minute, so V=15t+2000. Reaching 11,000 litres takes 900015=600 minutes, which is 10 hours.

  • Temperature on a mountain

    In the lower atmosphere, air cools by about 6.5 °C for every kilometre you climb. On a 20 °C day at sea level, the temperature at height h km is roughly T=20−6.5h, so at 3 km it is about 0.5 °C.

  • Fuel left in the tank

    A car starting with 50 litres of fuel and using 6 litres per 100 km has F=50−0.06d litres left after d km. Solving 50−0.06d=0 shows it runs dry after about 833 km.

Common Mistakes

  1. The slip: Calling every equation with x linear

    Instead: check for constant rate and no powers like x2.

  2. The slip: Confusing slope with y-intercept

    Instead: slope is the repeated change, while the y-intercept is the starting value when the input is 0.

  3. The slip: Using two points without checking the whole pattern

    Instead: a line through two points is linear, but a table or story still needs every equal input step to fit the same rate.


Mini Practice

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

  1. A candle is 20 cm tall and burns down 1.5 cm each hour. Write its height h after t hours, and find its height after 6 hours.

    Hint: Start at 20 and take away 1.5 for every hour.

  2. A line passes through (0,−3) and (2,5). Write its equation in the form y=mx+b.

    Hint: The point with x=0 gives you b straight away.

  3. Is this table linear? x: 1, 2, 3, 4 and y: 5, 9, 13, 17. If so, find its rule.

    Hint: Check the change in y for each step of 1 in x, then work back to x=0.

  4. Plan A costs $25 a month plus $5 per GB. Plan B costs $10 per GB with no monthly fee. At how many GB do the plans cost the same, and what is that cost?

    Hint: Write each plan as a linear function of GB, then set them equal.

  5. Account 1 grows by $50 every year. Account 2 starts at $1,000 and grows by 5% of its balance each year. Which balance is a linear function of time?

    Hint: Work out each account's growth in year 1 and in year 2.

  6. A plumber's bill is y=7+3x dollars for x hours. Ana says the plumber charges $7 per hour plus a $3 call-out fee. Correct her.

    Hint: Which number gets multiplied by the hours?

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

Is y=5 a linear function?

Yes. It is y=0x+5y = 0x + 5: the slope is 0, so the output stays at 5 for every input, and the graph is a horizontal line. A vertical line such as x=5x = 5 is a different story. The single input 5 would have infinitely many outputs, so it is not a function at all, even though its graph is perfectly straight.

Why is the starting value called the y-intercept?

To intercept means to cut across. At x=0x = 0 you are standing on the yy-axis, so the output there is the height at which the line cuts that axis. In a story, x=0x = 0 usually means before anything has happened, which is why the same number is both the crossing point on the graph and the starting amount in the situation.

Can two different stories share the same linear function?

Yes, because the function records only the numbers. y=2x+10y = 2x + 10 fits a savings jar that starts with $10 and gains $2 a week, and also a 10 cm seedling that grows 2 cm a day. The algebra is identical; only the units and meanings differ. Once you can work with 2x+102x + 10, you can answer questions about every story it describes.

How can I tell whether three points lie on one line?

Find the slope from the first point to the second and from the second to the third. If the two slopes match, the points lie on one line. For (0,1)(0, 1), (2,5)(2, 5) and (5,11)(5, 11), the slopes are 42=2\frac{4}{2} = 2 and 63=2\frac{6}{3} = 2, so they do. If the slopes differ, the path bends at the middle point.

Learning Path

Linear Functions

You are here

You need Slope (rise over run), Equations (to solve for unknowns) and the Coordinate Plane (to graph points) first. Linear functions combine a slope and a starting value into the rule y=mx+b, which predicts every output. Next, Systems of Equations find where two lines meet, and Quadratic Functions handle patterns whose rate of change grows, giving curved graphs.

See Also