Topic · Algebra

Linear Equations

Equations where each unknown appears to the first power — no squares, no roots, no products of variables. They describe straight lines, balanced situations, and any relationship where a constant change in one quantity produces a constant change in another.

What you'll leave with

  • A precise definition of what makes an equation linear — and what disqualifies one.
  • The recipe for solving any one-variable linear equation, including the multi-step cases (distribute, then collect).
  • Three equivalent forms (slope-intercept, point-slope, standard) and when to reach for each.
  • An intuition for slope and intercepts — what they mean, not just how to compute them.
  • The two slope relationships you'll use everywhere downstream: parallel (same slope) and perpendicular (negative-reciprocal slopes).
  • How to turn a real situation — a cab fare, a depreciating asset — into a linear model and read predictions out of it.

1. What makes an equation linear

Linear equation

An equation in which every variable appears only to the first power, with no products of variables and no functions of variables (no squares, no roots, no $\sin$, no $\log$, no $1/x$).

The defining trait is structural, not visual. An equation is linear if, when you collect terms, every variable shows up like $x$ — never like $x^2$, never like $xy$, never inside a function. Constants and constant coefficients are free to do whatever they want.

Examples and non-examples

Linear
  • $3x + 7 = 19$
  • $2x + 3y = 12$
  • $y = -\tfrac{1}{2}x + 4$
  • $x + y + z = 0$
Not linear
  • $x^2 + 3 = 7$ — squared variable
  • $xy = 6$ — product of variables
  • $\sqrt{x} = 4$ — root
  • $\tfrac{1}{x} + 2 = 5$ — variable in denominator
Why "linear"?

The name comes from the picture: every equation that fits the rule above traces out a line when you graph it. Two variables give a line in 2-D; three give a flat plane in 3-D; $n$ give what mathematicians call a hyperplane. The algebra and the geometry are the same thing seen from two angles.

2. Solving a one-variable linear equation

Every one-variable linear equation can be rearranged into the canonical form

$$ ax + b = 0 $$

where $a$ and $b$ are constants and $a \neq 0$. Solving it means finding the single value of $x$ that makes the equation true. The recipe is one rule applied twice:

Whatever operation you do, do it to both sides.

Subtract $b$ from both sides:

$$ ax = -b $$

Divide both sides by $a$:

$$ x = -\frac{b}{a} $$

That's it. Every one-variable linear equation collapses into two moves: isolate the term with $x$, then divide by the coefficient of $x$.

The shape of the recipe

Start ax + b = 0 Subtract b ax = −b Divide by a x = −b / a Done solved
Pitfall

The recipe quietly assumes $a \neq 0$. When $a = 0$, the equation reduces to $b = 0$ — which is either trivially true (for every $x$) if $b$ really is zero, or impossible if it isn't. Either way, there is no single $x$ to solve for. Always check the coefficient before dividing.

When the equation has more than two steps

Real equations don't always arrive in the tidy form $ax + b = 0$. Two patterns come up constantly, and both reduce to the same recipe once you set them up.

Distribute, then solve

When the variable is trapped inside parentheses, multiply through first:

$$ 3(x + 4) = 21 $$

Distribute the $3$:

$$ 3x + 12 = 21 $$

Now it's an ordinary two-step equation. Subtract $12$, divide by $3$:

$$ 3x = 9 \quad\Longrightarrow\quad x = 3 $$

Variables on both sides

When $x$ appears on the left and the right, collect the $x$ terms on one side and the constants on the other. Choose whichever side keeps the $x$ coefficient positive — life is easier that way:

$$ 2x + 3 = 5x - 9 $$

Subtract $2x$ from both sides (smaller coefficient leaves the equation cleaner):

$$ 3 = 3x - 9 $$

Add $9$ to both sides, then divide by $3$:

$$ 12 = 3x \quad\Longrightarrow\quad x = 4 $$

The principle hasn't changed — you're still doing the same operation to both sides to isolate $x$. There are just more setup moves before the final divide.

3. Two variables: a line in the plane

The moment you go from one variable to two, the answer changes shape. A single number isn't enough anymore — you need a pair $(x, y)$. And there isn't just one solution; there are infinitely many. Together they form a line.

Consider $2x + 3y = 12$. Try a few values:

$x$$y$Check $2x + 3y$
$0$$4$$0 + 12 = 12$ ✓
$3$$2$$6 + 6 = 12$ ✓
$6$$0$$12 + 0 = 12$ ✓
$-3$$6$$-6 + 18 = 12$ ✓

Every one of those pairs satisfies the equation, and if you plot them on a grid they fall in a perfectly straight row. The equation isn't a riddle with one answer — it's a constraint, and the line is the set of every $(x, y)$ that obeys it.

Mental model

A linear equation in two variables is a rule that throws away most pairs $(x, y)$ in the plane and keeps only the ones that lie on a particular line. The line is the equation.

4. Three forms of the same line

The same line can be written in several ways. Each form makes a different fact about the line immediately readable, and you pick the form that surfaces what you need.

FormEquationReads off easilyBest when
Slope-intercept $y = mx + b$ Slope $m$, y-intercept $b$ Graphing quickly; comparing two lines' steepness
Point-slope $y - y_1 = m(x - x_1)$ Slope $m$, a point $(x_1, y_1)$ You know a point and a slope and want the equation
Standard $Ax + By = C$ Integer coefficients; symmetry in $x,y$ Solving systems; clean algebra

They are interchangeable. Rearranging is just algebra, and you should be able to flip between them without thinking. For example, $2x + 3y = 12$ (standard) becomes $y = -\tfrac{2}{3}x + 4$ (slope-intercept) by solving for $y$.

5. Slope and intercepts

Slope is the line's steepness — how much $y$ changes for each one-unit step in $x$. Given any two points on the line:

$$ m = \frac{y_2 - y_1}{x_2 - x_1} \quad \text{(rise over run)} $$

A positive slope rises left-to-right; negative falls; zero is horizontal; undefined (division by zero) is vertical.

The y-intercept is where the line crosses the y-axis — set $x = 0$ and solve for $y$. In slope-intercept form $y = mx + b$, it's just $b$, sitting there for free.

The x-intercept is the mirror: where the line crosses the x-axis. Set $y = 0$ and solve for $x$. In slope-intercept form that gives $x = -b/m$ (when $m \neq 0$).

run = 4 rise = 2 y-int (0, 1) x-int (−2, 0) y = 0.5x + 1 slope ½, y-int 1 x y −10 −8 −6 −4 −2 2 4 6 8 10 6 4 2 −2 −4 −6

Reading intercepts from standard form

When the line is given in standard form $Ax + By = C$, you don't need to convert to slope-intercept just to find an intercept. Use the definitions directly:

  • y-intercept: set $x = 0$ and solve for $y$.
  • x-intercept: set $y = 0$ and solve for $x$.

Example: for $2x - 3y = 12$, setting $x = 0$ gives $-3y = 12$, so the y-intercept is $y = -4$. Setting $y = 0$ gives $2x = 12$, so the x-intercept is $x = 6$. Two points, one line — that's already enough to graph it.

Parallel and perpendicular slopes

Two slope relationships show up so often that you should know them cold.

Parallel lines

Two non-vertical lines are parallel if and only if they have the same slope. If $m_1 = m_2$ and the y-intercepts differ, the lines run alongside each other and never meet.

Perpendicular lines

Two non-vertical lines are perpendicular (meeting at a right angle) if and only if their slopes are negative reciprocals: $m_1 \cdot m_2 = -1$, equivalently $m_2 = -\dfrac{1}{m_1}$.

So a line parallel to $y = 3x - 1$ has slope $3$ (anything else fails). A line perpendicular to it has slope $-\tfrac{1}{3}$ (check: $3 \cdot -\tfrac{1}{3} = -1$).

y = 2x y = 2x + 4 (parallel) y = −½ x (perpendicular) x y
Watch out · vertical and horizontal

The perpendicular formula breaks down at the boundary. A horizontal line has slope $0$, and its perpendicular is a vertical line — which has undefined slope, not $-\tfrac{1}{0}$. When one slope is $0$ or undefined, don't use the negative-reciprocal rule; just remember that horizontals and verticals are perpendicular to each other.

6. Playground: $y = mx + b$

Drag the sliders. Watch the equation, the line, and the intercepts update together. The point of this isn't to memorize anything — it's to internalize what $m$ and $b$ do to a line.

y = 1.0x + 2.0
x-int: −2.00  ·  y-int: 2.00
1.0
2.0
x y
Try it

Set $m = 0$ and slide $b$ around — every line is horizontal, and $b$ is just the height. Now set $b = 0$ and slide $m$ — every line passes through the origin, and $m$ controls how tilted it is. The two parameters do entirely separate jobs.

7. Finding the equation of a line

The reverse direction: someone hands you a line — described some way — and you have to write down its equation. There are three common entry points.

Given $(x_1, y_1)$ and $(x_2, y_2)$:

  1. Compute the slope: $m = \dfrac{y_2 - y_1}{x_2 - x_1}$.
  2. Plug into point-slope form using either point: $y - y_1 = m(x - x_1)$.
  3. Rearrange to whatever form you want.

Example: the line through $(1, 2)$ and $(3, 8)$ has slope $m = \tfrac{8 - 2}{3 - 1} = 3$, so $y - 2 = 3(x - 1)$, which simplifies to $y = 3x - 1$.

Given slope $m$ and a point $(x_1, y_1)$, plug directly into point-slope form:

$$ y - y_1 = m(x - x_1) $$

Example: slope $-2$ through $(4, 5)$ gives $y - 5 = -2(x - 4)$, or $y = -2x + 13$.

Given slope $m$ and y-intercept $b$, you're already done — write it in slope-intercept form:

$$ y = mx + b $$

Example: slope $\tfrac{1}{2}$, y-intercept $-3$ is just $y = \tfrac{1}{2}x - 3$.

Lines through a known relationship

Two common variants build on point-slope but start with a constraint on the slope:

  • Parallel to a given line, through a given point. Read the slope off the reference line and use point-slope with the new point. Example: parallel to $y = 3x - 1$ through $(0, 0)$ → slope $3$, intercept $0$ → $y = 3x$.
  • Perpendicular to a given line, through a given point. Take the negative reciprocal of the reference slope, then use point-slope. Example: perpendicular to $y = 2x + 1$ through $(4, 3)$ → slope $-\tfrac{1}{2}$, then $y - 3 = -\tfrac{1}{2}(x - 4)$ → $y = -\tfrac{1}{2}x + 5$.

8. Linear models in the world

A linear equation isn't just an exercise in algebra — it's the simplest useful model of how two quantities relate when one changes at a constant rate with respect to the other. The slope is the rate, the y-intercept is the starting value, and the equation predicts every other value.

Cab fare: a fixed cost plus a rate

A cab charges $\$3$ as a base fare plus $\$2$ per mile. Let $m$ be miles driven and $C$ the total cost in dollars. Two ingredients:

  • Slope: $\$2$ per mile — the cost rises by $\$2$ for every extra mile, regardless of how far you've already gone.
  • y-intercept: $\$3$ — the cost before driving anywhere.
$$ C = 2m + 3 $$

Now you can answer any question by plugging in. A 7-mile ride costs $C = 2(7) + 3 = \$17$. A $\$25$ fare means $25 = 2m + 3$, so $m = 11$ miles.

Depreciation: a starting value, eroding over time

A car worth $\$20{,}000$ today depreciates linearly to $\$5{,}000$ over five years. Let $t$ be years from today and $V(t)$ the value in dollars. Two known points: $(0, 20000)$ and $(5, 5000)$.

Slope first — annual loss in value:

$$ m = \frac{5000 - 20000}{5 - 0} = \frac{-15000}{5} = -3000 $$

The car loses $\$3{,}000$ per year. The y-intercept is the starting value, $\$20{,}000$:

$$ V(t) = -3000\,t + 20000 $$

Predicting at year 3: $V(3) = -3000(3) + 20000 = \$11{,}000$. Asking when the car is worth $\$8{,}000$: $8000 = -3000t + 20000$, so $t = 4$ years.

Recipe

To turn a real situation into a linear model: identify the rate of change (the slope) and the starting value (the y-intercept). If you only have two data points, compute the slope first and use point-slope to find the intercept. The same two-step process handles every linear modeling problem you'll see.

9. Common pitfalls

Sign errors when moving terms

When you "move" a term across the equals sign, its sign flips. $3x + 7 = 19$ becomes $3x = 19 - 7$, not $3x = 19 + 7$. This is the single biggest source of wrong answers in early algebra.

Forgetting to apply to both sides

Dividing only the left side by $a$ silently changes the equation. If you divide one side, you must divide the other — and every term on it.

Confusing slope with y-intercept

In $y = mx + b$, $m$ is the coefficient of $x$ and $b$ is the constant. A surprising number of mistakes come from reading them in the wrong order — especially when the equation is rearranged like $y = b + mx$.

Vertical lines aren't functions of $x$

A vertical line has undefined slope and cannot be written as $y = mx + b$. It's expressed as $x = c$. If you find yourself dividing by zero to get the slope, you've hit a vertical line — switch representations.

10. Worked examples

Try each one yourself before opening the solution. The point is to see whether your steps match the canonical recipe, not to check the final number.

Example 1 · Solve $5x - 3 = 12$

Step 1. Add $3$ to both sides:

$$ 5x = 15 $$

Step 2. Divide both sides by $5$:

$$ x = 3 $$

Check. $5(3) - 3 = 15 - 3 = 12$ ✓

Example 2 · Line through $(1, 2)$ and $(3, 8)$

Step 1. Compute the slope:

$$ m = \frac{8 - 2}{3 - 1} = \frac{6}{2} = 3 $$

Step 2. Point-slope form using $(1, 2)$:

$$ y - 2 = 3(x - 1) $$

Step 3. Simplify to slope-intercept:

$$ y = 3x - 3 + 2 = 3x - 1 $$

Check. At $x = 3$: $y = 3(3) - 1 = 8$ ✓

Example 3 · Convert $2x + 3y = 12$ to slope-intercept form

Step 1. Isolate the $y$-term:

$$ 3y = -2x + 12 $$

Step 2. Divide every term by $3$:

$$ y = -\tfrac{2}{3}x + 4 $$

So the line has slope $-\tfrac{2}{3}$ and y-intercept $4$.

Example 4 · Find the x-intercept of $y = -\tfrac{1}{2}x + 6$

Step 1. The x-intercept is where $y = 0$. Substitute:

$$ 0 = -\tfrac{1}{2}x + 6 $$

Step 2. Solve for $x$:

$$ \tfrac{1}{2}x = 6 \quad\Longrightarrow\quad x = 12 $$

The line crosses the x-axis at $(12, 0)$.

Sources & further reading

The content above is synthesized from established mathematics references. If anything reads ambiguously here, the primary sources are the ground truth — and the "going deeper" links are where to turn when this page has served its purpose.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 28
0 correct