← Back to Middle School Math

Linear Equations & Functions

Middle School Math · Pre-High School PrepPreview

1. Introduction

Straight lines are everywhere: the steady climb of a hiking trail, the constant drip of a leaky faucet filling a bucket, the bill from a phone plan that charges a flat fee plus a fixed amount per gigabyte. Whenever something changes at a constant rate, its graph is a straight line, and the math that describes it is called a linear equation.

In this article you will learn to read and write the equation of a line, measure how steep it is (its slope), and find where it crosses the axes. You will also meet the idea of a function — a rule that turns each input into exactly one output — and see why lines are the friendliest functions of all. These tools are the gateway to all of high school algebra, so building strong intuition now pays off for years.

We will lean heavily on pictures and concrete numbers. A line is just a visual record of a rule like "start at 11 and go up 22 every step." Once you can translate freely between the graph, the equation, and the story, linear functions become second nature. You will learn to spot slope from a graph, build an equation from two points, and use function notation to describe real-world rates.

Linear relationships are the simplest kind of change: equal steps in one direction produce equal steps in another. That predictability is what makes them so useful in science, business, and everyday life. Whether you are tracking miles driven, water flowing into a tank, or savings growing at a fixed weekly rate, the same slope-intercept pattern appears again and again.

By the end of this chapter you should be able to look at any equation in the form y=mx+by = mx + b and immediately describe its graph: where it starts, how steep it is, and whether it rises or falls. You should also be able to go in reverse — start from two points or a real-world story and build the equation yourself. Function notation will feel natural, not like a new language, because you will see it as just another name for the output of a linear rule.

2. Core Concepts

The coordinate plane

We graph lines on the coordinate plane: two number lines crossing at the origin (0,0)(0, 0). The horizontal line is the xx-axis, the vertical line is the yy-axis. Any point is named by an ordered pair (x,y)(x, y), where xx tells you how far right (or left) and yy tells you how far up (or down). The point (3,5)(3, 5) means "go 33 right and 55 up." The first coordinate is always xx; the second is always yy — mixing them up is one of the most common graphing errors.

What makes an equation "linear"

A linear equation is one whose graph is a perfectly straight line. The signature feature is that yy changes by the same amount every time xx increases by 11 — a constant rate of change. There are no exponents on the variables (no x2x^2), no variables multiplied together, and no variables in a denominator. Plain y=2x+1y = 2x + 1 is linear; y=x2y = x^2 is not.

Slope: the steepness of a line

The slope, written mm, measures how steep a line is and which way it tilts. It is the rise over run — the vertical change divided by the horizontal change as you move along the line:

m=riserun=change in ychange in x.m = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x}.

If yy goes up 22 each time xx goes right 11, the slope is 21=2\dfrac{2}{1} = 2. Slope carries meaning:

  • A positive slope rises from left to right (uphill).
  • A negative slope falls from left to right (downhill).
  • A slope of 00 is a flat, horizontal line (yy never changes).
  • A vertical line has an undefined slope (the run is 00, and we cannot divide by 00).

The bigger the absolute value of the slope, the steeper the line: a slope of 55 is much steeper than a slope of 12\tfrac{1}{2}.

The slope between two points

Given any two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a line, the slope is

m=y2y1x2x1.m = \frac{y_2 - y_1}{x_2 - x_1}.

The subscripts just label the points — "point 11" and "point 22." The key rule is consistency: whichever point you call point 22, its coordinates must go first in both the top and the bottom. The top is the change in yy; the bottom is the change in xx, in the same order.

The yy-intercept and slope-intercept form

The yy-intercept is the point where the line crosses the yy-axis — the value of yy when x=0x = 0. We call it bb. Combining the slope and the yy-intercept gives the most useful equation of a line, slope-intercept form:

y=mx+b,y = mx + b,

where mm is the slope and bb is the yy-intercept. You can read a line's whole story straight from this form: start at height bb on the yy-axis, then climb by mm for every step right. For y=2x+1y = 2x + 1, you start at (0,1)(0, 1) and rise 22 each time xx increases by 11.

The xx-intercept

The xx-intercept is where the line crosses the xx-axis — the value of xx when y=0y = 0. To find it, set y=0y = 0 in the equation and solve for xx. For y=2x6y = 2x - 6, setting y=0y = 0 gives 0=2x60 = 2x - 6, so x=3x = 3. The xx-intercept is (3,0)(3, 0). Intercepts are useful anchors when graphing and when interpreting real-world models (like "how many miles until the cost hits zero?" — often not meaningful, but the technique is the same).

Functions and function notation

A function is a rule that assigns to each input exactly one output. Think of a function as a machine: you drop in an input, the machine does its job, and out comes a single, predictable output. We write functions with function notation, like f(x)f(x), read "f of xx." Here xx is the input and f(x)f(x) is the output. So f(5)f(5) means "the output when the input is 55."

Every linear equation y=mx+by = mx + b is a function, because each xx produces exactly one yy. We can rename yy as f(x)f(x) and write f(x)=mx+bf(x) = mx + b — same line, just emphasizing the input-output relationship.

The vertical line test

How can you tell from a graph whether it is a function? Use the vertical line test: imagine sweeping a vertical line across the graph. If that vertical line ever touches the graph in more than one place at once, the graph is not a function (one input would have two outputs). A straight, non-vertical line always passes the test. A perfectly vertical line fails it.

Rate of change in real life

In word problems, the slope is almost always the "per" rate: dollars per mile, liters per hour, pages per minute. The yy-intercept is usually a starting amount: a flat fee, an initial volume, a beginning balance. Recognizing this pattern lets you write y=mx+by = mx + b directly from a story without plotting points first.

Parallel lines

Two non-vertical lines are parallel if they never cross — they have the same slope but different yy-intercepts. If m1=m2m_1 = m_2 but b1b2b_1 \ne b_2, the lines are parallel. For example, y=2x+1y = 2x + 1 and y=2x5y = 2x - 5 are parallel (both have slope 22).

Reading a graph to find slope and intercept

From a graph you can read the yy-intercept directly: it is where the line crosses the yy-axis. To find slope, pick two clear points on the line, count the rise (vertical change) and run (horizontal change), and write m=riserunm = \dfrac{\text{rise}}{\text{run}}. If the line goes up 33 for every 22 steps right, the slope is 32\dfrac{3}{2}. Always move from left to right when counting run so your sign is consistent.

Tables and linear patterns

A table of inputs and outputs that grows by a constant amount each step represents a linear function. If xx increases by 11 and yy always increases by 44, the slope is 44. The yy-value when x=0x = 0 in the table is the yy-intercept. Tables, graphs, and equations are three views of the same line — learning to move between them deepens your understanding.

Continue reading with Premium

Upgrade to read the full article and unlock all Premium features.

Free

  • Unlimited practice — all difficulties
  • 3 hints / day
  • Community solutions
  • 2 timed mocks / month

Premium

  • Full article + all 57+ theory guides
  • Unlimited hints on practice problems
  • Unlimited timed mock exams & PDF worksheets
Log in