Practice Maths

Gradient and Equation of a Line

Key Ideas

Key Terms

gradient formula
M = (y2 − y1) ÷ (x2 − x1), using any two points on the line.
Positive gradient
Line rises from left to right (m > 0).
Negative gradient
Line falls from left to right (m < 0).
Zero gradient
Horizontal line (m = 0), equation y = c.
Undefined gradient
Vertical line; run = 0 — equation x = c.
y = mx + c
Where m is the gradient and c is the y-intercept.
FormulaUse
m = (y2 − y1) ÷ (x2 − x1)Find gradient from two points
y = mx + cGradient-intercept form; m = gradient, c = y-intercept
y − y1 = m(x − x1)Find equation from a point and gradient

Types of gradient

xy run rise Positive (m > 0) line rises left to right xy run fall Negative (m < 0) line falls left to right xy y = c Zero (m = 0) horizontal line xy x = c Undefined gradient vertical line
Hot Tip Always subtract in the same order: (y2−y1) over (x2−x1). Switching the order for one coordinate gives the wrong sign.

Worked Example

Question: Find the equation of the line passing through (2, 5) with gradient 3.

Step 1: y − y1 = m(x − x1)  ⇒  y − 5 = 3(x − 2)

Step 2: y − 5 = 3x − 6  ⇒  y = 3x − 1

Check: Sub (2, 5): y = 3(2) − 1 = 5. ✓

Calculating Gradient from Two Points

The gradient of a line measures how steep it is. Given two points (x1, y1) and (x2, y2), the gradient is calculated using the formula: m = (y2 − y1) / (x2 − x1). This is "rise over run" — the vertical change divided by the horizontal change. For example, for the points (1, 3) and (5, 11): m = (11 − 3) / (5 − 1) = 8 / 4 = 2. It does not matter which point you label as 1 or 2, as long as you are consistent in both the numerator and denominator.

A positive gradient means the line goes up from left to right. A negative gradient means it goes down. A gradient of zero means horizontal. Undefined gradient means vertical.

Writing the Equation y = mx + b

Once you know the gradient m, you can find the full equation of the line by substituting a known point into y = mx + b and solving for b. For example, if m = 2 and the line passes through (1, 5): substitute to get 5 = 2(1) + b, so b = 3. The equation is y = 2x + 3. You can verify this by checking the other known point satisfies the equation.

Parallel Lines

Two lines are parallel if they never intersect — they run in exactly the same direction. Parallel lines always have equal gradients. For example, y = 3x + 1 and y = 3x − 4 are parallel because both have m = 3. Note that parallel lines have different y-intercepts (otherwise they would be the same line). In problems, if you are told a line is parallel to another, you can immediately use the same gradient value.

Perpendicular Lines

Two lines are perpendicular if they meet at a right angle (90°). The gradients of perpendicular lines satisfy the rule: m1 × m2 = −1. This means the gradients are negative reciprocals of each other. For example, if one line has m = 2, a perpendicular line has m = −1/2 (flip and negate). Check: 2 × −1/2 = −1. ✓

Key tip: For perpendicular gradients, remember "flip and change sign." If m = 3/4, the perpendicular gradient is −4/3. A common mistake is to only flip without changing the sign (or only change the sign without flipping) — always do both steps.

Putting It All Together

Coordinate geometry questions often combine these ideas: for example, "Find the equation of a line passing through (2, 1) that is parallel to y = 4x − 3." Step 1: parallel means same gradient, so m = 4. Step 2: substitute into y = 4x + b using (2, 1): 1 = 4(2) + b, so b = 1 − 8 = −7. Answer: y = 4x − 7. Similarly for perpendicular: take the negative reciprocal of the given gradient, then substitute the point.

Mastery Practice

  1. Calculate the gradient of the line passing through each pair of points. Fluency

     Point 1Point 2Gradient m
    (a)(1, 3)(3, 7) 
    (b)(0, 5)(4, 13) 
    (c)(2, 8)(6, 4) 
    (d)(−1, 2)(3, 10) 
    (e)(−3, 4)(1, −4) 
    (f)(2, −1)(2, 6) 
    (g)(−4, 3)(2, 3) 
    (h)(−2, −5)(4, 7) 
  2. Identify the gradient and y-intercept for each equation in y = mx + c form. Fluency

     EquationGradient my-intercept c
    (a)y = 4x + 3  
    (b)y = −2x + 7  
    (c)y = x − 5  
    (d)y = ½x  
    (e)y = −3x − 4  
    (f)y = 6  
    (g)2y = 6x − 4  
    (h)y + 3x = 8  
  3. Write the equation of the line in y = mx + c form given each gradient and y-intercept. Fluency

     Gradient my-intercept cEquation
    (a)35 
    (b)−20 
    (c)½−3 
    (d)07 
    (e)−42 
    (f)¾1 
    (g)5−6 
    (h)−14 
  4. State whether each statement is True or False. If false, write the correct statement. Fluency

    1. A horizontal line has a gradient of zero.
    2. A vertical line has a gradient of zero.
    3. The gradient of the line through (0, 0) and (4, 8) is 2.
    4. In y = −3x + 5, the gradient is 5 and the y-intercept is −3.
    5. Two lines with the same gradient are always the same line.
    6. A steeper line always has a larger gradient value.
  5. Interpret the gradient in each context. Understanding

    Rate of Change. The gradient of a linear graph equals the rate of change of the quantity on the y-axis with respect to the x-axis quantity.
    tC 12345 0255075 (0, 25) 1 hr +$12 C = 12t + 25
    Graph for Q5(a)
    td 12345 0−10−20 1 s −4 m depth = −4t
    Graph for Q5(c)
    1. A line has equation C = 12t + 25, where C is cost in dollars and t is time in hours. What does the gradient 12 represent?
    2. The gradient of a ramp is 0.08. Does the ramp slope upward or downward left-to-right? Express the gradient as a percentage grade.
    3. A line through (0, 0) and (5, −20) represents the depth of a diver (metres) versus time (seconds). Calculate and interpret the gradient.
    4. A horizontal line passes through (0, 4). Write its equation and state its gradient. Give a real-world example of a zero-gradient relationship.
  6. Steepness and real-world gradients. Understanding

    Comparing Slopes. The absolute value of a gradient tells you how steep the line is, regardless of direction. A larger absolute value means a steeper line.
    1. Line A passes through (0, 0) and (4, 12). Line B passes through (1, 5) and (3, 9). Line C passes through (−2, 10) and (2, 2). Calculate the gradient of each line and arrange them flattest to steepest.
    2. Three ramps have gradients of 0.05, 0.2, and 0.5. Which ramp is steepest and which is most accessible (flattest)?
  7. Find the equation of the line with the given gradient passing through the given point. Write your answer in y = mx + c form. Understanding

    Point-Gradient Method. Use y − y1 = m(x − x1), then rearrange to y = mx + c.
    1. m = 2, through (1, 5)
    2. m = −3, through (2, 4)
    3. m = 4, through (0, −7)
    4. m = ½, through (4, 3)
    5. m = −1, through (−2, 6)
    6. m = 5, through (3, 0)
  8. Arrange these lines from flattest to steepest (use absolute value of gradient). Justify your order. Understanding

    Steepness. Steepness depends on |m|, not the sign. A line with m = −5 is steeper than one with m = 2.
    1. y = 6x − 1,   y = ⅓x + 4,   y = −4x + 2
    2. Line through (0,0) and (3, 9);   line with m = −2;   line through (1,1) and (5, 3)
  9. Problem solving with gradient. Problem Solving

    Road and Geometry Problems. Apply gradient concepts to solve multi-step problems.
    1. A straight road rises 120 m vertically over a horizontal distance of 1500 m. Calculate the gradient of the road. Express it as a decimal and as a percentage grade.
    2. Two points on a line are (k, 3) and (4, 11). If the gradient is 2, find the value of k.
    3. A line has gradient 3 and passes through the midpoint of (0, 2) and (4, 8). Find the equation of the line.
  10. Equations in context. Problem Solving

    Real-World Linear Models. Use gradient and intercept to model and interpret practical situations.
    1. A vertical line and a horizontal line intersect at (5, −3). Write the equations of both lines. Explain why the gradient of the vertical line is undefined.
    2. A ski slope drops 80 m vertically over a horizontal run of 400 m. Write the equation of the slope in the form y = mx + c if it starts at (0, 80). What does the gradient mean in this context?
    3. A line passes through (1, 7) and has the same gradient as the line y = −2x + 3. Find its equation. Then find where this line crosses the x-axis.