The Equation Of A Straight Line
The equation of a straight line is a foundational skill assumed for Queensland Year 11 Mathematical Methods (QCAA). The most useful form is gradient-intercept form, where one number gives the gradient and another where it crosses the vertical axis.
You will write a line's equation from a gradient and a point or from two points, read the gradient and intercept from an equation, and rearrange it into general form.
Theory
In Year 11 Mathematical Methods (QCAA), a straight line is described by an equation. The most useful form is gradient-intercept form \(y=mx+c\), where \(m\) is the gradient and \(c\) is the \(y\)-intercept. This page shows how to write a line's equation from a gradient and a point, from two points, how to read \(m\) and \(c\) from an equation, and how to give the general form \(ax+by+c=0\).
The gradient-intercept form of a line is \(y=mx+c\): the coefficient of \(x\) is the gradient \(m\), and the constant \(c\) is the \(y\)-intercept (where the line crosses the \(y\)-axis).
The point-gradient form \(y-y_1=m(x-x_1)\) builds a line directly from one point \((x_1,y_1)\) and the gradient \(m\). The general form \(ax+by+c=0\) has integer coefficients and no fractions, and is often the required final form.
Gradient-intercept and point-gradient forms:
with the gradient from two points
How to find the equation of a line
- Gradient: if you are given it, use it; from two points compute \(m=\dfrac{y_2-y_1}{x_2-x_1}\).
- Substitute the gradient and one point into \(y-y_1=m(x-x_1)\).
- Rearrange to the required form — \(y=mx+c\), or the general form \(ax+by+c=0\) after clearing fractions.
Use gradient-intercept form \(y=mx+c\) with \(m=2\) and \(c=-3\):
| \(y\) | \(=\) | \(mx+c\) |
| \(y\) | \(=\) | \((2)x+(-3)\) |
| \(y\) | \(=\) | \(2x-3\) |
Equation: \(y=2x-3\).
Substitute \(m=3\) and \((x_1,y_1)=(2,-1)\) into \(y-y_1=m(x-x_1)\):
| \(y-(-1)\) | \(=\) | \(3(x-2)\) |
| \(y+1\) | \(=\) | \(3x-6\) |
Make \(y\) the subject:
| \(y\) | \(=\) | \(3x-6-1\) |
| \(y\) | \(=\) | \(3x-7\) |
Equation: \(y=3x-7\).
Gradient — rise over run:
| \(m\) | \(=\) | \(\dfrac{8-2}{3-1}\) |
| \(=\) | \(\dfrac{6}{2}\) | |
| \(=\) | \(3\) |
Use \((1,2)\) in \(y-y_1=m(x-x_1)\):
| \(y-2\) | \(=\) | \(3(x-1)\) |
| \(y-2\) | \(=\) | \(3x-3\) |
| \(y\) | \(=\) | \(3x-3+2\) |
| \(y\) | \(=\) | \(3x-1\) |
Equation: \(y=3x-1\).
Gradient:
| \(m\) | \(=\) | \(\dfrac{-1-5}{4-(-2)}\) |
| \(=\) | \(\dfrac{-6}{6}\) | |
| \(=\) | \(-1\) |
Use \((4,-1)\) in point-gradient form:
| \(y-(-1)\) | \(=\) | \(-1(x-4)\) |
| \(y+1\) | \(=\) | \(-x+4\) |
| \(y\) | \(=\) | \(-x+3\) |
Move every term to one side (general form):
| \(x+y-3\) | \(=\) | \(0\) |
Equation: \(x+y-3=0\).
Common pitfalls
Frequently asked questions
What do m and c mean in y = mx + c?
\(m\) is the gradient (steepness and direction) and \(c\) is the \(y\)-intercept, the \(y\)-value where the line crosses the \(y\)-axis.
How do you find a line's equation from two points?
Find the gradient \(m=\dfrac{y_2-y_1}{x_2-x_1}\), substitute it and one point into \(y-y_1=m(x-x_1)\), then rearrange.
How do you read the gradient from an equation like 2x + 3y = 12?
Rearrange to \(y=mx+c\) first: \(3y=-2x+12\), so \(y=-\tfrac{2}{3}x+4\). The gradient is \(-\tfrac{2}{3}\).
What is the general form of a line?
\(ax+by+c=0\) with integer coefficients and no fractions. Clear fractions by multiplying through, and usually write \(a\) as positive.
What is the equation of a vertical line?
A vertical line has the form \(x=a\), where \(a\) is the common \(x\)-coordinate; it cannot be written as \(y=mx+c\) because its gradient is undefined.