Equations of a Line
The same straight line can be written in five different shapes, and the exam question is usually decided by which shape the data arrives in. Slope-intercept wants a slope and an intercept, point-slope wants one point and a slope, two-point wants two points, intercept form wants both intercepts, and the general form is the universal container. This lesson derives each shape from the slope definition, shows that they are interchangeable, and works through the conversions that make up most of the marks.
What You'll Learn
- 1Derive each standard form of a line from the slope definition
- 2Choose the form that matches the given data with the least algebra
- 3Convert between slope-intercept, intercept and general forms
- 4Extract slope and intercepts directly from a general equation
Where the Forms Come From
Start with the definition of slope applied to a variable point on the line through a fixed point :
Cross-multiplying gives the point-slope form directly, with no further work:
If the chosen point happens to be the -intercept , the same substitution gives , which rearranges into the slope-intercept form:
Taking two points and substituting one of them for while computing gives the two-point form:
Setting the intercepts to on the -axis and on the -axis and clearing denominators gives the intercept form, and multiplying through gives the general form , in which and are never both zero.
Because all five come from one definition, every form converts into every other. The general form holds the slope implicitly: writing and dividing by when gives
A vertical line has and therefore no slope, while a horizontal line has and slope zero â both readings come straight from the same fraction.
Choosing Between the Five Forms
Because each form records a different pair of facts, the quickest route to an answer is to pick the form whose inputs you already possess and rearrange only once. The table below is the decision aid worth memorising before an exam, since selecting the wrong starting point is what usually makes these questions feel unnecessarily long.
| Form | Equation | What you must know | Best used when |
|---|---|---|---|
| Slope-intercept | slope and -intercept | graphing quickly | |
| Point-slope | one point and a slope | a tangent or a perpendicular | |
| Two-point | two points | coordinates only | |
| Intercept | both intercepts | intercepts are quoted | |
| General | integers only | final standard answer |
Four Worked Problems
Converting and Checking in Python
A few helper functions make the conversions mechanical, and substituting a point is the cheapest verification available.
def slope_intercept(A, B, C):
"""Rewrite Ax + By + C = 0 as (m, c) or None for a vertical line."""
if B == 0:
return None
return (-A / B, -C / B)
def two_point_form(p, q):
(x1, y1), (x2, y2) = p, q
m = (y2 - y1) / (x2 - x1)
return (m, y1 - m * x1) # returns slope and intercept
print(slope_intercept(3, 4, -12)) # (-0.75, 3.0)
print(two_point_form((1, 2), (3, 6))) # (2.0, 0.0)
print(slope_intercept(1, 0, -5)) # None -> vertical line x = 5
The second snippet verifies a candidate equation against the data it was built from.
def on_line(A, B, C, point):
x, y = point
return abs(A * x + B * y + C) < 1e-9
A, B, C = 3, 4, -12 # 3x + 4y = 12
for p in [(4, 0), (0, 3), (2, 1.5), (5, -0.75)]:
print(p, "on line:", on_line(A, B, C, p))
assert on_line(A, B, C, (4, 0)) # x-intercept
assert on_line(A, B, C, (0, 3)) # y-intercept
assert not on_line(A, B, C, (1, 1))
m, c = -A / B, -C / B
assert abs(m * 4 + c - 0) < 1e-9 # substituting x = 4 gives y = 0
print("slope =", m, "y-intercept =", c)
What CBSE Asks on This Topic
The commonest three-mark item gives a point and a slope, or two points, and asks for the equation with a specified form named in the question â so answer in the form requested, not the one you find easiest. Another frequent pattern supplies a line in general form and asks for the slope, the intercepts, or the equation of a parallel line. Objective questions often ask which of five printed equations represents a given line, which is fastest to answer by substituting the quoted point. Marks are lost when the point-slope bracket is expanded without distributing the slope to both terms, and when the sign of is dropped in converting to general form. Always leave the answer in general form with integer coefficients when the question does not specify, since that is how the options are usually printed.
Common Mistakes
Distributing the slope over only one term of the bracket
Fix: In y minus y1 equals m times x minus x1, multiply m by both x and minus x1 before moving the constant across.
Reading the y-intercept as c from the equation Ax plus By plus C equals zero
Fix: In general form the intercept is minus C over B; only slope-intercept form puts the intercept on its own.
Ignoring that intercept form excludes lines through the origin
Fix: A line with a or b equal to zero cannot be written with denominators, so fall back on point-slope form there.
Key Takeaways
- All five forms are rearrangements of the slope definition, so each converts into every other
- Slope-intercept is fastest for graphing while general form is the usual final answer
- From Ax plus By plus C equals zero the slope is minus A over B and the y-intercept is minus C over B
- Intercept form is undefined for lines passing through the origin
Practice Problems
- Write the equation of a line with slope and -intercept .
- Find the equation of a line through and .
- Write a line with -intercept and -intercept in intercept form, then convert it to general form.
- Convert to slope-intercept form and state the slope and both intercepts.
- Find the equation of the line through perpendicular to .