Linear Function

Definitionnoun phrase

What is a linear function?

A linear function is a function whose graph is a straight line. You can write it as f(x) = mx + b, where m is the slope, or constant rate of change, and b is the y-intercept. Each time x increases by 1, the output changes by the same amount, m.

In Spanish
función lineal
Also called
linear relationship, straight-line function, first-degree function
Grade level
6-8
Grade 8Algebra 1CCSS 8.F.A.3CCSS 8.F.B.4CCSS HSF-LE.A.1.bSATACTGEDPSATHiSET

Linear Function in a picture

A linear function in a table and a graphA table for f(x) = 2x + 1 with x from 0 to 3 and outputs 1, 3, 5, 7, each 2 more than the last. Beside it, the graph is a straight line through (0, 1) with steps of run 1 and rise 2.xf(x)01132537+2+2+2x goes up 1,f(x) goes up 2123−112345678xyrun 1rise 2(0, 1)f(x) = 2x + 1slope m = 2y-intercept b = 1
The same constant change shows up twice: in the table the outputs go up by 2 each row, and on the graph every run of 1 has a rise of 2. That constant rate is what makes the graph a straight line.

Formal definition and notation

A function f is linear if it can be written as f(x) = mx + b for constants m and b and every real number x. Equivalently, equal changes in the input always give equal changes in the output: f(x2) − f(x1)x2 − x1 = m for any inputs x1 ≠ x2. If m > 0 the function is increasing, if m < 0 it is decreasing, and if m = 0 it is the constant function f(x) = b. A vertical line x = a fails the vertical line test, so it is not a linear function.

Symbol Read it as Meaning
f(x) f of x the output of the function f for the input x; it plays the role of y
m m the slope: the change in output for each 1-unit increase in input
b b the y-intercept, or initial value: the output when x = 0

Key facts

  • In a table with equally spaced inputs, the outputs change by the same amount every step. For f(x) = 3x − 2 and x = 0, 1, 2, 3: −2, 1, 4, 7.
  • The highest power of x is 1. Functions like f(x) = x2 or f(x) = 1x are not linear.
  • m > 0: the line rises left to right. m < 0: it falls. m = 0: it is flat (a constant function).
  • A proportional relationship y = kx is the special linear function with b = 0; its graph passes through the origin. See constant of proportionality.
  • Linear functions model a fixed start plus a constant rate: a taxi ride that costs 3 dollars plus 2 dollars per mile is f(x) = 2x + 3.

Linear function formula

Linear function formula
f(x) = mx + b
x
the input (independent variable)
f(x)
the output (dependent variable)
m
the slope, m = y2 − y1x2 − x1 for any two points on the line
b
the starting value, where the line crosses the y-axis at (0, b)

To build the function from two points, find m first, then substitute one point into y = mx + b and solve for b. In a table, b is the output in the row where x = 0.

Try it: feed the machine

Interactive

This machine runs the linear function f(x) = 3x − 2. Type more inputs, such as 4, 5 or −1, and press Run. Check that the outputs change by 3 for every step of 1 in the input.

This interactive needs JavaScript. The worked examples below show the same ideas step by step.

Linear Function examples, step by step

Example 1: Evaluate a linear function

Warm-up

For f(x) = 4x − 7, find f(5).

  1. Replace x with 5: f(5) = 4(5) − 7.
  2. Multiply first: 4 × 5 = 20.
  3. Subtract: 20 − 7 = 13.

Answer: f(5) = 13.

Example 2: Write the function from two points

Core

A linear function passes through (2, 5) and (6, −3). Write it in the form f(x) = mx + b.

  1. Slope: m = −3 − 56 − 2 = −84 = −2.
  2. Substitute the point (2, 5): 5 = −2(2) + b.
  3. 5 = −4 + b, so b = 9.
  4. Check with the other point: −2(6) + 9 = −3. Correct.

Answer: f(x) = −2x + 9.

Example 3: A linear model with a starting fee

Test-style

A gym charges a 50-dollar sign-up fee plus 25 dollars per month. Write the total cost C as a function of the number of months m. How much do 8 months cost, and after how many months will the total reach 375 dollars?

  1. The fee is the starting value and 25 is the rate: C(m) = 25m + 50.
  2. For 8 months: C(8) = 25(8) + 50 = 200 + 50 = 250.
  3. Set the cost to 375: 25m + 50 = 375.
  4. Subtract 50: 25m = 325. Divide by 25: m = 13.

Answer: C(m) = 25m + 50. Eight months cost 250 dollars, and the total reaches 375 dollars after 13 months.

Common mistakes

✗ MistakeReading the slope of f(x) = 4 + 3x as 4.
✓ InsteadThe slope is the number multiplied by x: m = 3, and b = 4.

The order of the terms does not matter. The slope is always the coefficient of x.

✗ MistakeCalling a table linear because the outputs keep increasing: x = 0, 1, 2, 3 gives 1, 2, 4, 8.
✓ InsteadThe changes are +1, +2, +4. They are not equal, so the function is not linear (it doubles each time).

Linear means the change is constant, not just that the outputs go up.

✗ MistakeWith inputs 0, 1, 3 and outputs 2, 5, 8, saying the rate is 3 because each output goes up by 3.
✓ InsteadDivide by the input change: 5 − 21 − 0 = 3 but 8 − 53 − 1 = 1.5. The rates differ, so the function is not linear.

The rate of change is change in output divided by change in input. When the input steps are not equal, you must divide.

✗ MistakeCalling the vertical line x = 3 a linear function.
✓ Insteadx = 3 is a line, but not a function: the input 3 has infinitely many outputs.

A function gives each input exactly one output, so a vertical line fails the vertical line test.

Not to be confused with

Linear Functionvs.Linear equation

A linear equation is any equation whose graph is a line, such as 2x + 3y = 6 or x = 4. A linear function is a rule f(x) = mx + b that gives one output per input, so vertical lines are left out.

Linear Functionvs.Slope-intercept form

Slope-intercept form, y = mx + b, is one way to write a linear function. The same function can also be written in point-slope or standard form.

Linear Functionvs.Nonlinear function

A nonlinear function has a graph that curves, because its rate of change is not constant. f(x) = x2 gives 0, 1, 4, 9, with changes 1, 3, 5.

Quick check: 3 questions

Question 1 of 3

Which function is linear?

Show answer and explanation

Answer: B. f(x) = 5 − 2x is mx + b with m = −2 and b = 5. The others have x squared, x as an exponent, or x in a denominator, so their graphs curve.

Question 2 of 3

A table shows x = 0, 1, 2, 3 and outputs 7, 4, 1, −2. Which function matches?

Show answer and explanation

Answer: D. The outputs drop by 3 each step, so m = −3, and the output at x = 0 is 7, so b = 7. The other choices flip the sign, swap m and b, or use the last output as b.

Question 3 of 3

A linear function has f(0) = 4 and f(2) = 10. What is f(5)?

Show answer and explanation

Answer: A. The slope is 10 − 42 − 0 = 3 and b = 4, so f(5) = 3(5) + 4 = 19. 25 treats 10 for 2 as proportional, 15 forgets the starting value 4, and 14 just adds 4 and 10.

Linear Function: frequently asked questions

How can you tell if a function is linear?

Look for a constant rate of change. In an equation, the function is linear if it can be written as f(x) = mx + b, with no x2, no x in an exponent and no x in a denominator. In a table, the outputs change by the same amount for equal input steps. On a graph, the points lie on one straight, non-vertical line.

Is a linear function the same as a linear equation?

Not quite. Every linear function f(x) = mx + b gives a linear equation y = mx + b. But some linear equations are not functions: the vertical line x = 4 gives the input 4 infinitely many outputs. So linear functions are the linear equations whose graphs are not vertical lines.

Is a horizontal line a linear function?

Yes. A horizontal line such as f(x) = 6 is mx + b with slope m = 0 and b = 6. It is called a constant function because every input gives the same output, 6. A vertical line is different: it is not a function at all, because one input has many outputs.

Practice and tools

Sources

  1. Common Core State Standards, Grade 8 Functions (8.F.A.3, 8.F.B.4)
  2. Common Core State Standards, High School Functions, Linear, Quadratic and Exponential Models (HSF-LE.A.1.b)
  3. OpenStax, College Algebra 2e, 4.1 Linear Functions

Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS 8.F.A.3, CCSS 8.F.B.4, CCSS HSF-LE.A.1.b

Cite this entry

Effortless Math Team. “Linear Function.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/linear-function/

Flashcard

TermLinear Functionf(x) = mx + b
DefinitionA function whose graph is a straight line; the output changes by the same amount m for each 1-unit step in x. Example: f(x) = 2x + 1.
Study the full deck

Browse all terms in the Math Dictionary · More functions terms · Random term