Skip to main content
SingaporeMathsSyllabus dot point

Given two points or a point and a gradient, how do we find the equation of the straight line through them?

Find the gradient of a line through two points and determine the equation of a straight line in the form y = mx + c

A focused answer to the N(A)-Level Mathematics outcome on the equation of a line. Finding gradient from two points, using a point to find the intercept, and writing the equation as y = mx + c.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

SEAB wants you to find the gradient of a line joining two points and to work out the full equation of a straight line, written as y=mx+cy = mx + c, from either two points or a point and a gradient. This builds directly on linear graphs and is the core skill of coordinate geometry.

The answer

The gradient between two points

The gradient measures steepness: how much yy changes for each unit of xx. For two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2):

m=y2βˆ’y1x2βˆ’x1m = \frac{y_2 - y_1}{x_2 - x_1}

Keep the same order top and bottom. For A(2,1)A(2, 1) and B(5,7)B(5, 7), the gradient is 7βˆ’15βˆ’2=63=2\dfrac{7 - 1}{5 - 2} = \dfrac{6}{3} = 2.

The equation of a straight line

Every non-vertical straight line has the form:

y=mx+cy = mx + c

where mm is the gradient and cc is the yy-intercept. To find the equation you need the value of both mm and cc.

Finding the equation from two points

  1. Find the gradient mm from the two points.
  2. Write y=mx+cy = mx + c with the known gradient.
  3. Substitute one of the points to find cc.
  4. Write the complete equation.

Finding the equation from a point and a gradient

If the gradient is already known, skip straight to writing y=mx+cy = mx + c, then substitute the given point to find cc. This is quicker because step 1 is done for you.

Horizontal and vertical lines

Two special cases are worth knowing. A horizontal line has gradient 00, so its equation is simply y=cy = c (for example y=4y = 4). A vertical line has an undefined gradient and is written as x=ax = a (for example x=3x = 3); it cannot be put in the form y=mx+cy = mx + c because xx never changes along it.

Checking the equation

Substitute the other point (or the given point) back into your equation. If both sides match, the line really does pass through that point and the equation is correct. This single check catches most arithmetic and sign slips, so it is always worth the few seconds it takes.

Examples in context

Example 1. A line of best fit. In statistics, a scatter graph's line of best fit is a straight line whose equation can be found by reading off two clear points on it and using y=mx+cy = mx + c. The gradient then describes the rate of change in the data, linking coordinate geometry to statistics.

Example 2. Parallel lines. Two lines are parallel when they share the same gradient. So the line through (0,1)(0, 1) parallel to y=3xβˆ’4y = 3x - 4 also has gradient 33, giving y=3x+1y = 3x + 1 once the new intercept is found from the point. Recognising equal gradients saves recalculating the slope.

Try this

  • Cue. Find the gradient through (1,1)(1, 1) and (4,7)(4, 7). Compute 7βˆ’14βˆ’1=2\dfrac{7 - 1}{4 - 1} = 2.
  • Cue. A line has gradient 44 through (2,5)(2, 5). Then 5=4(2)+c5 = 4(2) + c, so c=βˆ’3c = -3 and y=4xβˆ’3y = 4x - 3.
  • Cue. Find the equation through (0,6)(0, 6) and (2,2)(2, 2). Gradient 2βˆ’62βˆ’0=βˆ’2\dfrac{2 - 6}{2 - 0} = -2, intercept 66, so y=βˆ’2x+6y = -2x + 6.

Exam-style practice questions

Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Original4 marksA straight line passes through the points A(1,2)A(1, 2) and B(3,8)B(3, 8). Find the equation of the line in the form y=mx+cy = mx + c.
Show worked answer β†’

First find the gradient: m=8βˆ’23βˆ’1=62=3m = \dfrac{8 - 2}{3 - 1} = \dfrac{6}{2} = 3.

So y=3x+cy = 3x + c. Substitute one point, say A(1,2)A(1, 2): 2=3(1)+c2 = 3(1) + c, so c=βˆ’1c = -1.

The equation is y=3xβˆ’1y = 3x - 1.

What markers reward: the correct gradient, substituting a known point to find cc, and the final equation in the requested form. A quick check with the second point (8=3(3)βˆ’1=88 = 3(3) - 1 = 8) confirms the line passes through both.

Original3 marksA line has gradient βˆ’2-2 and passes through the point (4,3)(4, 3). Find its equation in the form y=mx+cy = mx + c.
Show worked answer β†’

The gradient is given, so y=βˆ’2x+cy = -2x + c.

Substitute the point (4,3)(4, 3): 3=βˆ’2(4)+c3 = -2(4) + c, so 3=βˆ’8+c3 = -8 + c, giving c=11c = 11.

The equation is y=βˆ’2x+11y = -2x + 11.

What markers reward: using the given gradient directly, substituting the point correctly (watching the sign of βˆ’2Γ—4-2 \times 4), and the final equation. The common slip is mishandling the negative gradient when substituting.

Related dot points