What Is the Equation of a Line?
The equation of a line is an algebraic relationship between $x$ and $y$ that is true for every point on the line and false for every point off it. Plot all the $(x, y)$ pairs that satisfy $y = 2x + 1$, and they fall exactly along one straight line.
Two ingredients fix a line: its slope (steepness) and its position. Every form below packages those two facts differently. The slope, written $m$, is the rise over the run, and you can read the full derivation on the slope page. The general idea sits inside the wider topic of coordinate geometry.
What Are the Different Forms of the Equation of a Line?
There are six forms worth knowing. Each is exact; they differ only in which information they make obvious.
Form | Equation | Use it when you know |
|---|---|---|
Slope-intercept | $y = mx + b$ | the slope and y-intercept |
Point-slope | $y - y_1 = m(x - x_1)$ | the slope and one point |
Two-point | $y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$ | two points |
Intercept | $\frac{x}{a} + \frac{y}{b} = 1$ | both intercepts |
Normal | $x \cos\theta + y \sin\theta = p$ | the perpendicular distance from the origin and its angle |
General | $Ax + By + C = 0$ | you need a standard, tidy form |
Slope-Intercept Form
$$y = mx + b$$
Here $m$ is the slope and $b$ is the y-intercept (where the line crosses the y-axis). It is the fastest form for graphing, and the reasoning behind it lives on the slope-intercept form of a line page.
Point-Slope Form
$$y - y_1 = m(x - x_1)$$
Use this when you know the slope $m$ and a single point $(x_1, y_1)$. It is the natural first step whenever a problem hands you one point and a direction. Full worked derivation: point-slope form.
Two-Point Form
$$y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$$
When only two points $(x_1, y_1)$ and $(x_2, y_2)$ are given, this form computes the slope and writes the line in one move. See the two-point form page for the step-by-step.
Intercept Form
$$\frac{x}{a} + \frac{y}{b} = 1$$
Here $a$ is the x-intercept and $b$ is the y-intercept. It is the quickest way to sketch a line from where it cuts the two axes, detailed on the intercept form page.
General (Standard) Form
$$Ax + By + C = 0$$
Every straight line can be written this way, with $A$, $B$, $C$ integers and $A$, $B$ not both zero. It is the tidy form for solving systems and comparing lines. It is the same object as the equation of a straight line written in standard notation.
Normal Form
$$x \cos\theta + y \sin\theta = p$$
Here $p$ is the perpendicular distance from the origin to the line (always taken positive) and $\theta$ is the angle that this perpendicular makes with the positive x-axis. The normal form describes a line by how far it sits from the origin and in which direction, which makes it the natural form for distance problems. Any general form $Ax + By + C = 0$ can be converted to normal form by dividing through by $\pm\sqrt{A^2 + B^2}$.
What About Horizontal and Vertical Lines?
Two special cases don't fit the slope-intercept mould:
A horizontal line has slope $0$ and equation $y = b$. See horizontal line.
A vertical line has an undefined slope and equation $x = a$. See vertical line.
A vertical line cannot be written as $y = mx + b$ at all, which is exactly why the general form $Ax + By + C = 0$ exists.
How Is the Equation of a Line Derived?
The forms are not arbitrary; each comes straight from the definition of slope. The slope between any two points is the rise divided by the run:
$$m = \frac{y_2 - y_1}{x_2 - x_1}$$
Point-slope form falls out immediately. Take one fixed point $(x_1, y_1)$ and a general point $(x, y)$ on the same line. Their slope must equal $m$:
$$m = \frac{y - y_1}{x - x_1}$$
Multiply both sides by $(x - x_1)$:
$$y - y_1 = m(x - x_1)$$
Slope-intercept form is the special case where the fixed point is the y-intercept $(0, b)$. Substituting $x_1 = 0$ and $y_1 = b$:
$$y - b = m(x - 0) ;\Rightarrow; y = mx + b$$
Two-point form comes from replacing $m$ with $\frac{y_2 - y_1}{x_2 - x_1}$ in the point-slope equation:
$$y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$$
Every other form is then a rearrangement: clearing fractions and collecting terms gives the general form $Ax + By + C = 0$, and dividing the general form by $\pm\sqrt{A^2 + B^2}$ gives the normal form. One definition of slope generates them all.
Examples of the Equation of a Line
Example 1
Write the line with slope $3$ and y-intercept $-2$ in slope-intercept form.
Substitute directly into $y = mx + b$:
$$y = 3x - 2$$
Example 2
Find the equation of the line through $(-3, 5)$ and $(2, 8)$.
Wrong attempt first. A student writes point-slope but flips a sign, using $y - y_1 = m(x + x_1)$:
Slope $m = \frac{8 - 5}{2 - (-3)} = \frac{3}{5}$, then (wrongly) $y - 5 = \frac{3}{5}(x + 3)$.
Testing the point $(2, 8)$: $\frac{3}{5}(2 + 3) = \frac{3}{5}(5) = 3$, giving $y = 8$, which looks fine here but fails at the other point $(-3, 5)$, where it returns $y = 5 + \frac{3}{5}(0) = 5$ only by luck of the $+3$. The sign error hides until a different point exposes it.
Correct method. Point-slope keeps the minus sign:
$$y - 5 = \frac{3}{5}(x - (-3)) = \frac{3}{5}(x + 3)$$
Here $x - (-3)$ genuinely equals $x + 3$, so the sign is honest. Expanding:
$$y = \frac{3}{5}x + \frac{9}{5} + 5 = \frac{3}{5}x + \frac{34}{5}$$
Check $(2, 8)$: $\frac{3}{5}(2) + \frac{34}{5} = \frac{6 + 34}{5} = \frac{40}{5} = 8$. Correct.
Example 3
Convert $y = \frac{3}{5}x + \frac{34}{5}$ to general form.
Multiply through by $5$:
$$5y = 3x + 34$$
$$3x - 5y + 34 = 0$$
Check $(-3, 5)$: $3(-3) - 5(5) + 34 = -9 - 25 + 34 = 0$. Correct.
Example 4
Write the line $3x + 4y = 12$ in intercept form and read off its intercepts.
Divide every term by $12$:
$$\frac{3x}{12} + \frac{4y}{12} = 1 ;\Rightarrow; \frac{x}{4} + \frac{y}{3} = 1$$
The x-intercept is $a = 4$ and the y-intercept is $b = 3$.
Example 5
Find the equation of the horizontal line through $(7, -2)$.
A horizontal line holds $y$ constant, so its equation is:
$$y = -2$$
Its slope is $0$, and $x$ never appears.
Example 6
A taxi charges a $$3$ base fare plus $$2$ per kilometre. Write the fare $y$ as a line in the distance $x$.
The base fare is the y-intercept, the per-kilometre rate is the slope:
$$y = 2x + 3$$
At $x = 5$ km, $y = 2(5) + 3 = $13$. Slope-intercept form matches "rate plus starting value" perfectly, which is why it appears in so many real problems.
Why Do We Need So Many Forms of a Line?
The reason several forms exist is efficiency: each one answers a different starting question in the fewest steps, so choosing well saves algebra.
Slope-intercept is built for graphing and for "rate plus starting value" stories (fares, wages, depreciation).
Point-slope is the natural output when calculus hands you a derivative (a slope) at one point, the equation of a tangent line.
Two-point is what surveyors and map routines use, turning two known locations into a path.
Intercept sketches a line from its axis crossings in seconds.
Normal form is the go-to when a problem is framed by distance from the origin, since $p$ is that distance directly.
General form is the neutral standard for solving systems of equations, the algebra behind René Descartes' coordinate method that fused algebra and geometry in the 1600s.
Knowing them all means you never force one form to do another's job.
What Are the Most Common Mistakes With the Equation of a Line?
Mistake 1: Sign error in point-slope form
Where it slips in: substituting a negative coordinate into $y - y_1 = m(x - x_1)$.
Don't do this: write $x + x_1$ when the point is negative, turning $x - (-3)$ into $x - 3$.
The correct way: substitute the point exactly, then simplify. The first instinct is to "drop the double negative" too early, which flips the constant and shifts the whole line.
Mistake 2: Mixing up the slope's subtraction order
Where it slips in: the two-point form, computing $\frac{y_2 - y_1}{x_2 - x_1}$.
Don't do this: subtract the $y$-values in one order and the $x$-values in the other, such as $\frac{y_2 - y_1}{x_1 - x_2}$.
The correct way: keep both subtractions in the same order. Reversing only one flips the sign of the slope, which is the habit that pairing the two points on paper first fixes.
Mistake 3: Forcing a vertical line into slope-intercept form
Where it slips in: a line like $x = 4$.
Don't do this: try to write $x = 4$ as $y = mx + b$; its slope is undefined and no $b$ exists.
The correct way: recognise it as a vertical line, equation $x = a$.
Conclusion
The equation of a line relates $x$ and $y$ so that every point on the line satisfies it.
The six forms are slope-intercept $y = mx + b$, point-slope, two-point, intercept $\frac{x}{a} + \frac{y}{b} = 1$, normal $x \cos\theta + y \sin\theta = p$, and general $Ax + By + C = 0$.
Each form is chosen to match what you already know: a slope, a point, two points, or two intercepts.
Vertical lines ($x = a$) need the general form because their slope is undefined.
The most common error is a sign slip in point-slope form or a mismatched subtraction order in the slope.
Practice These to Solidify Your Understanding
Try three: write the line through $(1, 2)$ and $(4, 11)$ in slope-intercept form; convert $2x - 3y = 6$ to intercept form; and give the equation of the vertical line through $(-5, 9)$. If a sign flips on you, return to Example 2 above. To master lines with a teacher, explore Bhanzu's geometry tutor, a high school math tutor, or math classes online. Want a live trainer to walk through more line problems? Book a free demo class.
Read More
Was this article helpful?
Your feedback helps us write better content
