📘 CodingMarble Learn

Linear Functions

A linear function adds the same amount to y every time x goes up by 1. Its rule is y = mx + c (also written f(x) = mx + b). m is the slope: rise ÷ run, the change in y for each 1 step in x. c is the y-intercept: the value of y when x = 0. Its graph is always a straight line.

🎬 Step-by-step story

  1. A function is a machine: put in x, get out one y. This one doubles x and adds 1. Each time x grows by 1, y grows by 2.
  2. Plot each (x, y) pair as a dot. The dots sit on one straight line. That is why we call it linear.
  3. The slope m is rise ÷ run. Go 1 step right, climb 2 up: m = 2. The stair is the same everywhere on the line.
  4. c is where the line cuts the y-axis. Change c and the line slides up or down but keeps its tilt. Same slope means parallel lines.
  5. If m is positive the line goes up; if negative it goes down; if zero it is flat. A taxi fare of 50 + 12 per km is a linear function.
  6. Free play: move the m and c sliders. Guess where the line will cut the y-axis, then check.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why is it called linear?

Because its graph is a straight line. Equal steps in x always give equal steps in y, so the dots never bend.

Does the slope change along the line?

No. On a straight line the rise-and-run stair is the same everywhere, so m is the same between any two points.

What happens to the graph when only c changes?

The line slides up or down without turning. The tilt comes from m, so it stays parallel to the old line.

What does a negative slope mean in real life?

Something goes down at a steady rate, like water in a leaking tank or money left as you spend a fixed amount each day.

Is y = 5 a function? It has no x.

Yes. It gives y = 5 for every x. It is a linear function with m = 0: a flat line.

Is every straight line a function?

Almost. A vertical line like x = 3 is not, because one x gives many y values. Every other straight line is a linear function.

What is a linear function?

A function is a rule that gives exactly one output for each input. We call the input x and the output y (or f(x)).

A function is linear when y changes by the same amount every time x goes up by 1. This fixed change is the rate of change.

Every linear function can be written as y = mx + c. Some books write f(x) = mx + b or y = ax + b. They mean the same thing.

Tables, graphs and rules

One linear function can be shown in four ways:

Test from a table: if x goes up in equal steps and the differences in y are all equal, the function is linear.

Slope and intercepts

Slope m

m = rise ÷ run = (change in y) ÷ (change in x) = (y₂ − y₁) ÷ (x₂ − x₁).

Intercepts

y-intercept: put x = 0, so y = c. The point is (0, c).

x-intercept (the zero or root): put y = 0 and solve 0 = mx + c, so x = −c ÷ m.

Parallel lines

Lines with the same slope never meet: they are parallel.

Finding the rule and solving real problems

From two points: find m with the slope formula, then put one point into y = mx + c to find c.

From a story: the fixed starting amount is c (initial value); the amount per unit is m (rate).

Linear or not? y = 3x − 4 is linear. y = x², y = 1/x and y = 2ˣ are not: their graphs curve and the y-differences are not equal.

Solving: to find when a linear function reaches a value, set y equal to it and solve the equation. Two lines cross where both rules give the same y.

Key formulas and definitions

Worked examples

1. For y = 3x − 2, make a table for x = 0, 1, 2, 3.

x = 0: y = −2. x = 1: y = 1. x = 2: y = 4. x = 3: y = 7. The y values go up by 3 each time, which is the slope.

2. Find the slope and y-intercept of y = −4x + 9.

Compare with y = mx + c: m = −4 (the line goes down), c = 9, so it cuts the y-axis at (0, 9).

3. Find the slope of the line through (1, 3) and (4, 12).

m = (12 − 3) ÷ (4 − 1) = 9 ÷ 3 = 3.

4. Find the equation of the line through (2, 5) and (6, 13).

Step 1: m = (13 − 5) ÷ (6 − 2) = 8 ÷ 4 = 2. Step 2: put (2, 5) in y = 2x + c: 5 = 4 + c, so c = 1. Answer: y = 2x + 1.

5. Find the x-intercept of y = 4x − 10.

Set y = 0: 0 = 4x − 10, so 4x = 10 and x = 2.5. The line cuts the x-axis at (2.5, 0).

6. A taxi charges a fixed 50 plus 12 per km. Write the rule and find the cost of 8 km. How far can you go for 170?

Cost y = 12x + 50. For 8 km: 12 × 8 + 50 = 146. For 170: 12x + 50 = 170, 12x = 120, x = 10 km.

7. Plan A costs 100 + 5 per GB; plan B costs 20 per GB. When do they cost the same?

100 + 5x = 20x, so 100 = 15x and x ≈ 6.67 GB. Below that B is cheaper; above that A is cheaper.

Common mistakes

Practice quiz

1. In y = 5x − 3, the slope is:
2. Where does y = 2x + 7 cross the y-axis?
3. The slope of the line through (0, 1) and (2, 9) is:
4. Which is NOT a linear function?
5. Which line is parallel to y = 3x + 1?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a linear function in simple words?

A rule where y goes up (or down) by the same amount every time x goes up by 1. Its rule is y = mx + c and its graph is a straight line.

What is the difference between y = mx + c and f(x) = mx + b?

None. Different countries use different letters for the y-intercept. Both mean slope times x plus a starting value.

How do I find the slope from a graph?

Pick two clear points on the line. Count how far up (rise) and how far across (run) you go from one to the other. Slope = rise ÷ run.

Where this is taught

Canada (Ontario)Grade 9C. Algebra
NetherlandsVWO 2 (onderbouw)Patterns and relations
NetherlandsHAVO 5 (eindexamenjaar)Relationships (part 2)
PolandLiceum ogólnokształcące, klasa IIFunctions
RomaniaClasa a VIII-aFunctions
Spain4º ESOMeasurement sense
Spain4º ESOMeasurement sense
USA (Common Core, NGSS, AP)Grade 8Expressions and Equations (8.EE)
USA (Common Core, NGSS, AP)Grade 8Functions (8.F)
Japan中学2年Functions
South Korea중학교 2학년Linear functions
Germany (Bavaria)Jahrgangsstufe 8Linear functions
FranceTroisièmeData, probability and functions
FranceSecondeFunctions
FrancePremièreModelling change with functions
Russia7 классFunctions
Russia7 классFunctions
China八年级(初二)Ch.23 Linear functions

Learn first

Learn next

Related lessons

All Maths lessons