The equation of a line
The three forms
-
The same straight line can be written three ways, and you need all three.
-
Gradient-intercept form:
-
— the gradient
-
— the -intercept, where the line crosses the -axis
-
Best for reading off the gradient at a glance, and for sketching.
-
Point-gradient form:
-
— any point on the line
-
Best for building an equation from a point and a gradient.
-
General form:
- All terms on one side, usually with integer coefficients and positive.
- The only form that can describe a vertical line, which has no gradient.
Building a line from a point and a gradient
-
Substitute into the point-gradient form, then rearrange.
-
Worked through — the line through with gradient 2:
Building a line from two points
-
Find the gradient first, then use either point in the point-gradient form.
-
Worked through — the line through and :
- Gradient:
- Using : , so
- Using as a check: , so ✓ the same line
-
Either point gives the same answer. Using the second one as a check costs nothing.
Horizontal and vertical lines
- Horizontal line through : every point has the same -value, so the equation is
- Vertical line through : every point has the same -value, so
- A vertical line has no form, because its gradient is undefined. It can only be written as (or in general form).
- The commonest confusion: is horizontal, and is vertical. Remember that fixes the height.
Converting between forms
-
To general form: multiply out, clear fractions, and move everything to one side.
- → multiply by 3: →
-
To gradient-intercept form: make the subject.
- → → , so and
-
Always convert to before comparing gradients. Two equations in general form can look completely different and still be parallel.
Finding the intercepts
-
-intercept: set and solve for . In it is just .
-
-intercept: set and solve for .
-
For : the -intercept is , and setting gives .
Checking a point is on a line
- Substitute the point's coordinates into the equation.
- If both sides are equal, the point lies on the line; if not, it does not.
- For and the point : ✓ the point is on the line.
Worked ExampleBuilding a line and converting between forms
Find the equation of the line through and . Give your answer in gradient-intercept form and in the form with integer coefficients.
Step 1 — Find the gradient
Label and :
Note the bracket on the bottom: .
Step 2 — Write the point-gradient form
Using the point and :
Simplify the inner bracket — this is where the double negative must be handled:
Step 3 — Expand
Note that , so both terms inside the bracket become negative.
Step 4 — Rearrange into gradient-intercept form
Step 5 — Check with the other point
Substituting :
The line passes through both given points, so the equation is correct.
Step 6 — Convert to general form
Move every term to one side. There are no fractions to clear here:
Check the conventions: all coefficients are integers ✓ and the leading coefficient is positive ✓
Step 7 — Verify the general form
Substituting :
Substituting :