What Is The Equation Of A Straight Line?
The equation of a straight line is an algebraic relationship between the coordinates $x$ and $y$ such that a point $(x, y)$ lies on the line if and only if its coordinates satisfy the equation. Every straight line has such an equation, and it is always first-degree — the variables $x$ and $y$ appear only to the power $1$, never squared or higher.
That first-degree feature is what makes the graph straight. The moment a term like $x^2$ appears, the graph curves. So "linear equation" and "equation of a straight line" describe the same thing: a relationship whose graph is a straight line. What changes from one form to the next is not the line — it is which feature of the line the equation puts front and centre.
What Are The Forms Of The Equation Of A Straight Line?
There are five forms you will meet most often. Each is best when you know a particular piece of information about the line.
Slope-intercept form
$$y = mx + c$$
Here $m$ is the slope and $c$ is the y-intercept (the y-value where the line crosses the y-axis). This is the most-used form because it reads the slope and intercept straight off. Use it when you know the slope and where the line meets the y-axis. It is covered in depth in slope-intercept form and the related y = mx + b page.
Point-slope form
$$y - y_1 = m(x - x_1)$$
Here $m$ is the slope and $(x_1, y_1)$ is a known point on the line. Use it when you know a point and the slope but not the intercept — see point slope form for the full treatment.
Two-point form
$$y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$$
This is point-slope form with the slope already written out from two points $(x_1, y_1)$ and $(x_2, y_2)$. Use it when all you are given is two points. It comes directly from finding the slope from two points.
Standard (general) form
$$Ax + By + C = 0$$
Here $A$, $B$, and $C$ are constants, with $A$ and $B$ not both zero. Use it as a tidy, sign-balanced form that handles every line — including vertical ones, which slope-intercept form cannot.
Intercept form
$$\frac{x}{a} + \frac{y}{b} = 1$$
Here $a$ is the x-intercept and $b$ is the y-intercept. Use it when you know where the line crosses both axes — see intercept form for the derivation.
How Do You Choose Which Form To Use?
The honest answer is: match the form to what you are given. Know the slope and the y-intercept? Slope-intercept. Know a point and a slope? Point-slope. Know two points? Two-point (or compute the slope and use point-slope). Know both intercepts? Intercept form. Need to handle a vertical line or want integer coefficients? Standard form.
I will be honest — when I first learned these, I assumed I had to pick "the right one" and that choosing wrong would give a wrong answer. It will not. Every form describes the same line, and any one converts into any other with algebra. The choice is about convenience, not correctness.
Examples of the Equation of a Straight Line
Example 1
Write the equation of the line with slope $2$ and y-intercept $-3$.
Use slope-intercept form $y = mx + c$ with $m = 2$ and $c = -3$:
$$y = 2x - 3$$
That is the equation.
Example 2
Find the equation of the line through $(1, 4)$ and $(3, 10)$.
Wrong path first. A student jumps to slope-intercept form and guesses $c = 4$ because the first point's y-value is $4$, writing $y = mx + 4$. But $4$ is the y-value at $x = 1$, not at $x = 0$, so it is not the y-intercept. Substituting the point $(1,4)$ would only give $c$ after the slope is known.
Correct. Find the slope first:
$$m = \frac{10 - 4}{3 - 1} = \frac{6}{2} = 3$$
Use point-slope form with $(1, 4)$:
$$y - 4 = 3(x - 1)$$
Distribute and simplify:
$$y - 4 = 3x - 3$$
$$y = 3x + 1$$
So the y-intercept is $1$, not $4$. The flaw was reading a point's y-coordinate as the intercept before computing anything.
Example 3
Convert $2x + 3y - 6 = 0$ to slope-intercept form and state its slope.
Isolate the $y$ term:
$$3y = -2x + 6$$
Divide every term by $3$:
$$y = -\frac{2}{3}x + 2$$
The slope is $-\dfrac{2}{3}$ and the y-intercept is $2$.
Example 4
A line has x-intercept $4$ and y-intercept $2$. Write it in intercept form, then in standard form.
Use intercept form with $a = 4$, $b = 2$:
$$\frac{x}{4} + \frac{y}{2} = 1$$
Multiply through by $4$ to clear denominators:
$$x + 2y = 4$$
Move everything to one side for standard form:
$$x + 2y - 4 = 0$$
Example 5
The cost of a notebook plus a pen is modelled by a line. Two pens and a notebook cost $$8$; four pens and a notebook cost $$12$. If a pen costs $x$ and a notebook costs $y$, write the equation relating one purchase pattern.
Take the two purchase conditions as points where $x$ = pen count and the line tracks cost. Using the cost points $(2, 8)$ and $(4, 12)$:
$$m = \frac{12 - 8}{4 - 2} = \frac{4}{2} = 2$$
So each extra pen adds $$2$. Using point-slope form with $(2, 8)$:
$$y - 8 = 2(x - 2)$$
$$y = 2x + 4$$
The constant $$4$ is the notebook's cost (the value when $x = 0$ pens). A linear equation turns a word problem into a slope and an intercept with real meaning.
Example 6
Write the equation of the vertical line through $(5, -2)$, and explain why slope-intercept form cannot express it.
A vertical line has the equation $x = a$, where $a$ is the shared x-coordinate:
$$x = 5$$
Slope-intercept form $y = mx + c$ requires a numerical slope $m$, but a vertical line's slope is undefined (its run is $0$). Standard form handles it, though: $x = 5$ is $1 \cdot x + 0 \cdot y - 5 = 0$, which fits $Ax + By + C = 0$ with $B = 0$. This is exactly why standard form exists — it covers the lines the slope-based forms cannot.
Why The Equation Of A Straight Line Matters
Reducing a line to an equation is one of the foundational moves of mathematics, and it pays off far beyond geometry class.
Coordinate geometry's central tool. Once a line is an equation, you can find intersections by solving equations together, test whether a point lies on a line by substituting, and measure distances — all with algebra instead of a ruler.
Linear models everywhere. Any quantity that changes at a constant rate from a starting value is a straight line: a fixed monthly fee plus a per-unit charge, a constant-speed journey, a steady fill rate. The slope is the rate; the intercept is the starting value.
The base case for everything curved. Straight lines are the simplest graphs, and harder mathematics constantly approximates curves by straight lines over small intervals — the idea at the heart of calculus. Master the line first, and the curve becomes a sequence of lines.
The historical reason this all works traces to the link between algebra and geometry — the insight that a geometric shape and an algebraic equation can be two views of the same object — which turned geometry into something you could compute rather than only draw.
Where Students Trip Up On The Equation Of A Straight Line
Mistake 1: Reading a point's y-coordinate as the y-intercept
Where it slips in: When given a point that is not on the y-axis and rushing to slope-intercept form.
Don't do this: Writing $c$ equal to the y-value of any point, as if every point sat on the y-axis.
The correct way: The y-intercept $c$ is the y-value only when $x = 0$. For any other point, find the slope first, then solve for $c$ by substituting the point.
The first instinct is to slot a point's coordinates straight into $y = mx + c$ as if the point were the intercept. That only works at $x = 0$. Computing the slope before touching $c$ is the habit that fixes it.
Mistake 2: Forcing every line into slope-intercept form
Where it slips in: On vertical lines, where students try to write $y = mx + c$ anyway.
Don't do this: Assigning a slope to a vertical line so it fits $y = mx + c$.
The correct way: A vertical line is $x = a$ — no slope-intercept form exists for it because its slope is undefined. Use standard form ($Ax + By + C = 0$) when you need a single form that covers every line. The memorizer who only learned $y = mx + c$ gets stranded on vertical lines.
Mistake 3: Sign and coefficient errors when converting to standard form
Where it slips in: When moving terms across the equals sign and clearing fractions.
Don't do this: Dropping a sign while rearranging, e.g. turning $y = 2x - 3$ into $2x + y - 3 = 0$ instead of $2x - y - 3 = 0$.
The correct way: Move terms one at a time, tracking each sign, and clear denominators by multiplying every term. Re-substitute one known point at the end to verify.
Key Takeaways
The equation of a straight line is a first-degree relationship between $x$ and $y$ that every point on the line satisfies.
The five common forms are slope-intercept, point-slope, two-point, standard, and intercept — all describing the same line.
Choose the form that matches what you know: slope and intercept, a point and slope, two points, or both intercepts.
Slope-intercept form cannot express a vertical line; standard form can.
Every form converts to every other with algebra, so the choice is about convenience, not correctness.
A Practical Next Step
Practice these problems to solidify your understanding. Write each in the most convenient form, then convert it to standard form:
The line with slope $-2$ and y-intercept $5$.
The line through $(2, 1)$ and $(6, 9)$.
The line with x-intercept $3$ and y-intercept $-6$.
If converting between forms keeps producing sign slips, redo the standard-form example and move one term at a time. Want a live Bhanzu trainer to walk through more line-equation problems? Book a free demo class.
Answer to Question 1: $y = -2x + 5$, i.e. $2x + y - 5 = 0$.
Answer to Question 2: slope $2$, $y = 2x - 3$, i.e. $2x - y - 3 = 0$.
Answer to Question 3: $\dfrac{x}{3} + \dfrac{y}{-6} = 1$, i.e. $2x - y - 6 = 0$.
Was this article helpful?
Your feedback helps us write better content