Resources For Teachers For Tutors For Students & Parents Pricing
Year 11 Methods (Unit 1 & 2) Coordinate Geometry And Linear Relations

The Equation Of A Straight Line

20 practice questions 3 video lessons Theory + worked examples

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.

Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 3 video(s)
  • The Equation Of A Straight Line - Video - How to Find the Equation of a Straight Line (y = mx + c) Watch
  • The Equation Of A Straight Line - Video - Finding the Equation of a Straight Line From 2 Sets of Coordinates Watch
  • The Equation Of A Straight Line - Video - Two-Point Form Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

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 first, then a point. Every straight-line equation needs a gradient and one point on the line. From two points, find the gradient first, then use either point.
Gradient-intercept formThe line y equals 2x minus 3 crosses the y axis at negative 3, its y intercept, and climbs with gradient 2. x y c y=2x-3
In \(y=mx+c\), the gradient is \(m\) and the \(y\)-intercept is \(c\).
A line from its interceptsThe line 3x plus 4y equals 12 crosses the axes at 4, 0 and 0, 3. x y x-int y-int 3x+4y=12
The general form \(ax+by+c=0\) is easy to read from a line's intercepts.

Gradient-intercept and point-gradient forms:

\[y=mx+c\]
y=mx+c
\[y-y_1=m(x-x_1)\]
y-y1=m(x-x1)

with the gradient from two points

\[m=\dfrac{y_2-y_1}{x_2-x_1}\]
m=y2-y1x2-x1
General form: \(ax+by+c=0\) with integer \(a,b,c\). Clear any fractions by multiplying through, and it is standard to write \(a > 0\).

How to find the equation of a line

  1. Gradient: if you are given it, use it; from two points compute \(m=\dfrac{y_2-y_1}{x_2-x_1}\).
  2. Substitute the gradient and one point into \(y-y_1=m(x-x_1)\).
  3. Rearrange to the required form — \(y=mx+c\), or the general form \(ax+by+c=0\) after clearing fractions.
Example 1 — From a gradient and the y-intercept
Write the equation of the line with gradient \(2\) and \(y\)-intercept \(-3\).
Solution

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

y=2x-3Line with gradient 2 and y intercept negative 3. x y (0,-3) y=2x-3
y=2x-3
Example 2 — From a point and a gradient
Find the equation of the line with gradient \(3\) passing through \((2,\,-1)\).
Solution

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

Point and gradientLine of gradient 3 through the point 2, negative 1 giving y equals 3x minus 7. x y (2,-1) y=3x-7
y=3x-7
Example 3 — From two points
Find the equation of the line through \((1,\,2)\) and \((3,\,8)\).
Solution

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

Two pointsLine through 1, 2 and 3, 8 giving y equals 3x minus 1. x y (1,2) (3,8)
y=3x-1
Example 4 — Two points to general form
Find the equation of the line through \((-2,\,5)\) and \((4,\,-1)\), giving your answer in the general form \(ax+by+c=0\).
Solution

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

General formLine through negative 2, 5 and 4, negative 1 giving x plus y minus 3 equals 0. x y (-2,5) (4,-1)
x+y-3=0

Common pitfalls

Reading \(m\) and \(c\) before rearranging. In \(2x+3y=12\) the gradient is not \(2\). Make \(y\) the subject first: \(y=-\tfrac{2}{3}x+4\), so \(m=-\tfrac{2}{3}\) and \(c=4\).
Using the derivative or a slope guess. For two points you must compute \(m=\dfrac{y_2-y_1}{x_2-x_1}\) — not read a number off the page.
Leaving fractions in general form. The general form \(ax+by+c=0\) uses integer coefficients; multiply through to clear any fractions before writing the final answer.

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.