Equation of a Straight Line — Forms & Examples

Equation of a Straight Line — Forms & Examples

TL;DR
The equation of a straight line is a relationship between xxx and yyy that every point on the line satisfies, written most commonly as y = mx + c (slope-intercept) or Ax + By + C = 0 (standard form). This article covers all five major forms — slope-intercept, point-slope, standard, intercept, and two-point — when to use each, how to convert between them, and six worked examples.

What Is The Equation Of A Straight Line?

The equation of a straight line is an algebraic relationship between the coordinates xxx and yyy 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 xxx and yyy 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 center.

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 (x1,y1) 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= rac{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 (x1,y1) and (x2,y2). 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. 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.

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 −\frac{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).

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, but a vertical line's slope is undefined. Standard form handles it, though: $$x=5$$ 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.

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.
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.

Mistake 2: Forcing every line into slope-intercept form

Where it slips in: On vertical lines.
The correct way: A vertical line is $$x=a$$ — no slope-intercept form exists for it because its slope is undefined.

Mistake 3: Sign and coefficient errors when converting to standard form

Where it slips in: When moving terms across the equals sign.
The correct way: Move terms one at a time, tracking each sign, and clear denominators by multiplying every term.

Key Takeaways