y-b=m(x-a) (SQA National 5 Maths): Revision Note

Exam code: X847 75

Roger B

Written by: Roger B

Reviewed by: Dan Finlay

Updated on

Determining the equation of a straight line

What is the equation of a straight line?

  • The general equation of a straight line is y = mx + c  where

    • m  is the gradient

    • c  is the y-intercept

      • The value where the line cuts the y-axis

  • y  = 5x  + 2  is a straight line with

    • gradient 5

    • y-intercept 2

  • y  = 3 - 4x  is a straight line with

    • gradient -4

    • y-intercept 3

How do I find the equation of a straight line using y-b=m(x-a)?

  • To find the equation of a line you need to know

    • The coordinates of a point on the line

    • The gradient of the line

      • If you know two points on the line, (x1, y1) and (x2, y2)

      • You can find the gradient using the formula gradient=y2y1x2x1

  • If the line has gradient m and goes through the point (a, b)

    • then an equation of the line is y - b = m(x - a)

    • E.g. the line with gradient 3 through point (2, 5)

      • m=3, a=2, b=5

      • An equation of the line is  y5=3(x2)

  • An equation in this form can be rearranged into y = mx + c form if required:

 y5=3(x2)y5=3x6y=3x6+5y=3x1

How do I find the equation of a straight line using y=mx+c?

  • You can also use y = mx + c to find the equation of a line, if you know the gradient m and a point on the line (a, b)

  • Substitute the values of m and (x, y) = (a, b) into the equation

    • Then solve to find the value of c

  • E.g. the line with gradient 3 through point (2, 5)

    • m=3, (x, y)=(2, 5)

      • Substituting into  y=mx+cgives  5=3(2)+c

      • So  5=6+c  c=1

    • The equation of the line is  y=3x1

How do I find the equation of a straight line from a graph?

  • Find the gradient m by drawing a triangle and using

    • gradient=riserun

      • Positive for uphill lines, negative for downhill

  • Read off the y-intercept c from the graph

    • Where it cuts the y-axis

  • Substitute these values into y  = mx  + c 

What if no y-intercept is shown on the graph?

  • If you can't read off the y-intercept

    • Find any point on the line

    • Use one of the methods above to find the equation

What are the equations of horizontal and vertical lines?

  • A horizontal line has the equation y  = c

    • c  is the y-intercept

  • A vertical line has the equation = k

    •  k  is the x-intercept

  • For example

    • y = 4

    • x = -2

Worked Example

The diagram shows the straight line passing through points A and B.

Graph with x and y axes. A line passes through points A (2, 18) and B (8, 6), sloping downwards from left to right.

Find the equation of the line AB.

Give the equation in its simplest form.

Answer:

Find m, the gradient of the line, using  gradient=y2y1x2x1

  • (x1, y1)=(2, 18)

  • (x2, y2)=(8, 6)

 gradient=61882=126=2

The slope of the line is downward from left to right

  • So the negative gradient is as expected
     

Method 1

Use  yb=m(xa) with

  • m=2

  • (a, b)=(2, 18)

    • (a, b)=(8, 6) would also work, and would lead to the same answer

 y18=2(x2)

Simplify the equation into  y=mx+c form

 y18=2x+4y=2x+4+18y=2x+22

That is the equation in simplest form

y=2x+22
 

Method 2

Use  y=mx+c with

  • m=2

  • (x, y)=(2, 18)

    • (x, y)=(8, 6) would also work, and would lead to the same answer

 y=mx+c18=2(2)+c

Solve to find the value of c

18=4+c18+4=c22=c

Substitute that back into  y=mx+c with m=2

 y=2x+22

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Roger B

Author: Roger B

Expertise: Development Editor

Roger's teaching experience stretches all the way back to 1992, and in that time he has taught students at all levels between Year 7 and university undergraduate. Having conducted and published postgraduate research into the mathematical theory behind quantum computing, he is more than confident in dealing with mathematics at any level the exam boards might throw at you.

Dan Finlay

Reviewer: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.