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

The Gradient Of A Straight Line

20 practice questions 1 video lesson Theory + worked examples

The gradient of a straight line is a foundational skill assumed for Queensland Year 11 Mathematical Methods (QCAA). The gradient measures a line's steepness and direction, found from two points as the rise over the run.

You will calculate a gradient from two points, read its sign and size, handle horizontal and vertical lines, and find an unknown coordinate from a given gradient — groundwork for the equation of a line.

Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 1 video(s)
  • The Gradient Of A Straight Line - Video - Gradient of a straight line through two points Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

In Year 11 Mathematical Methods (QCAA), the gradient of a straight line measures its steepness and direction. From two points it is the rise over the run, \(m=\dfrac{y_2-y_1}{x_2-x_1}\). This page shows how to compute a gradient from two points, read the sign and size, handle horizontal and vertical lines, and find an unknown coordinate from a given gradient.

The gradient \(m\) of a straight line is the amount \(y\) changes for each unit that \(x\) increases. Between two points it is the rise (the vertical change) divided by the run (the horizontal change).

The sign tells you the direction: a positive gradient rises to the right (increasing), a negative gradient falls to the right (decreasing). The size tells you the steepness — a larger absolute value is steeper. A horizontal line has gradient \(0\); a vertical line has an undefined gradient.

Same order, top and bottom. Subtract the \(y\)-values and the \(x\)-values in the same order: \(m=\dfrac{y_2-y_1}{x_2-x_1}\).
Gradient as rise over runA line climbing to the right; the run is horizontal and the rise is vertical, and gradient is rise divided by run. x y run rise
Gradient \(=\dfrac{\text{rise}}{\text{run}}\): here the line climbs, so \(m > 0\).
Horizontal and vertical linesA horizontal line has gradient zero; a vertical line has an undefined gradient. x y y=2 x=1
A horizontal line has \(m=0\); a vertical line has an undefined gradient.

The gradient through \(A(x_1,y_1)\) and \(B(x_2,y_2)\) is

\[m=\dfrac{y_2-y_1}{x_2-x_1}=\dfrac{\text{rise}}{\text{run}}\]
m=y2-y1x2-x1
Special cases: a horizontal line \(y=c\) has \(m=0\) (zero rise). A vertical line \(x=a\) has an undefined gradient (the run is \(0\), and you cannot divide by \(0\)).

How to find a gradient from two points

  1. Label the points \((x_1,y_1)\) and \((x_2,y_2)\).
  2. Rise: subtract the \(y\)-values, \(y_2-y_1\). Run: subtract the \(x\)-values in the same order, \(x_2-x_1\).
  3. Divide rise by run and simplify; then read off the sign (increasing or decreasing) and the size (steepness).
Example 1 — Gradient from two points
Find the gradient of the line through \(P(1,\,2)\) and \(Q(4,\,11)\).
Solution

Rise — subtract the \(y\)-values:

\(y_2-y_1\)\(=\)\(11-2\)
\(=\)\(9\)

Run — subtract the \(x\)-values in the same order:

\(x_2-x_1\)\(=\)\(4-1\)
\(=\)\(3\)

Divide rise by run:

\(m\)\(=\)\(\dfrac{9}{3}\)
\(=\)\(3\)

Gradient: \(m=3\) (the line increases).

Gradient from two pointsLine through P at 1, 2 and Q at 4, 11 with run 3 and rise 9 giving gradient 3. x y P Q
m=3
Example 2 — A negative gradient
Find the gradient of the line through \(P(-2,\,5)\) and \(Q(4,\,-7)\).
Solution

Rise — subtract the \(y\)-values:

\(y_2-y_1\)\(=\)\(-7-5\)
\(=\)\(-12\)

Run — subtract the \(x\)-values in the same order:

\(x_2-x_1\)\(=\)\(4-(-2)\)
\(=\)\(6\)

Divide rise by run:

\(m\)\(=\)\(\dfrac{-12}{6}\)
\(=\)\(-2\)

Gradient: \(m=-2\) (the line decreases).

Negative gradient (line falls)Line through P at negative 2, 5 and Q at 4, negative 7 falling to the right, gradient negative 2. x y P Q
m=-2
Example 3 — Horizontal and vertical lines
Find the gradient of (a) the line through \(A(2,\,3)\) and \(B(7,\,3)\), and (b) the line through \(C(4,\,1)\) and \(D(4,\,6)\).
Solution

Line (a) — the \(y\)-values are equal, so the rise is \(0\):

\(m\)\(=\)\(\dfrac{3-3}{7-2}\)
\(=\)\(\dfrac{0}{5}\)
\(=\)\(0\)

Line (a) is horizontal, so its gradient is \(0\).

Line (b) — the \(x\)-values are equal, so the run is \(0\):

\(m\)\(=\)\(\dfrac{6-1}{4-4}\)
\(=\)\(\dfrac{5}{0}\)

Dividing by \(0\) is not defined, so line (b) is vertical with an undefined gradient.

(a) \(m=0\); (b) gradient undefined (vertical line).

Horizontal and vertical special casesA horizontal line through 2, 3 and 7, 3 with gradient zero, and a vertical line at x equals 4 with undefined gradient. x y A B
m=0
Example 4 — Finding an unknown coordinate
The line through \(P(2,\,k)\) and \(Q(6,\,1)\) has gradient \(3\). Find \(k\).
Solution

Write the gradient formula and substitute:

\(m\)\(=\)\(\dfrac{1-k}{6-2}\)
\(3\)\(=\)\(\dfrac{1-k}{4}\)

Multiply both sides by \(4\), then solve:

\(3\times 4\)\(=\)\(1-k\)
\(12\)\(=\)\(1-k\)
\(k\)\(=\)\(1-12\)
\(k\)\(=\)\(-11\)

Unknown coordinate: \(k=-11\).

Finding an unknown coordinate from the gradientA line of gradient 3 through Q at 6, 1 meets the point P at 2, negative 11. x y P Q
k=-11

Common pitfalls

Mixing up the order. The \(y\)-values and \(x\)-values must be subtracted in the same order. Doing \(y_2-y_1\) over \(x_1-x_2\) flips the sign of the gradient.
Rise over run, not run over rise. The gradient is the vertical change divided by the horizontal change, \(\dfrac{\text{rise}}{\text{run}}\) — not the other way around.
Calling a vertical gradient zero. A horizontal line has gradient \(0\); a vertical line has an undefined gradient (the run is \(0\)). These are not the same thing.

Frequently asked questions

How do you find the gradient between two points?

Subtract the \(y\)-values for the rise and the \(x\)-values for the run in the same order, then divide: \(m=\dfrac{y_2-y_1}{x_2-x_1}\).

What does a negative gradient mean?

The line falls from left to right — as \(x\) increases, \(y\) decreases. A positive gradient rises to the right.

What is the gradient of a horizontal line?

Zero. The \(y\)-values are equal, so the rise is \(0\) and \(m=\dfrac{0}{\text{run}}=0\).

Why is a vertical line's gradient undefined?

Both points have the same \(x\)-value, so the run is \(0\). Dividing by \(0\) is not defined, so the gradient does not exist.

Which gradient is steeper, 2 or minus 3?

The one with the larger size (absolute value). \(|-3|=3 > 2\), so a gradient of \(-3\) is steeper than \(2\).