Skip to content
IGCSE·Tuition
Mathematics · Lessons

Write the equation of a line through a point

You know the gradient and one point, yet turning them into an equation feels like guessing where each number goes.

On this page
  1. How do you build the equation?
  2. How do you work it out, step by step?
  3. Worked example
  4. The mistake to watch for
  5. Check yourself
  6. Where this leads next

A straight line is fixed by its gradient and any one point on it. The equation y = mx + c connects them: m is the gradient and c is where the line crosses the y-axis. This lesson turns either a gradient and a point, or two points, into that equation.

How do you build the equation?

Start from the gradient m, from a question or from two points. Then use one known point (x₁, y₁) in the point-gradient form:

y − y₁ = m(x − x₁)

Expand the bracket and tidy up to reach y = mx + c. The point-gradient form works because any point (x, y) on the line has the same gradient to (x₁, y₁), and that gradient is m.

How do you work it out, step by step?

  1. Get the gradient. If the question gives two points, calculate m first.
  2. Choose one of the points and write it inside brackets: (x₁, y₁).
  3. Write y − y₁ = m(x − x₁), keeping the signs exactly as they are.
  4. Expand and rearrange into y = mx + c.
  5. Test the other point in your final equation.

Worked example

Find the equation of the line through (−1, 7) and (3, −1).

Step 1, gradient: m = (−1 − 7)/(3 − (−1)) = −8/4 = −2.

Step 2, choose a point: use (−1, 7), so x₁ = −1 and y₁ = 7.

Step 3, point-gradient form: y − 7 = −2(x − (−1)), which is y − 7 = −2(x + 1).

Step 4, expand: y − 7 = −2x − 2, so y = −2x + 5.

Step 5, test the other point: at x = 3, y = −2(3) + 5 = −6 + 5 = −1. This matches (3, −1).

Second check: at x = −1, y = 2 + 5 = 7, which matches the first point. The equation is y = −2x + 5, with gradient −2 and y-intercept 5.

The mistake to watch for

The common slip is a sign error when the x-coordinate of the point is negative.

Mistaken working: y − 7 = −2(x − 1), which gives y = −2x + 9.

The student wrote x − 1 instead of x − (−1) = x + 1, losing the negative sign of the point.

The wrong equation fails the test immediately: at x = −1 it gives y = 2 + 9 = 11, not 7. The correction is to write the substitution with brackets first, y − 7 = −2(x − (−1)), and only then simplify.

A second slip is forgetting to multiply the constant inside the bracket, so −2(x + 1) becomes −2x + 1 instead of −2x − 2.

Check yourself

Try these without a calculator, then open each answer.

1. Find the equation of the line with gradient 4 through (1, 3).

Show answer

y − 3 = 4(x − 1), so y − 3 = 4x − 4, giving y = 4x − 1. Check: at x = 1, y = 3. ✓

2. Find the equation of the line through (0, −2) and (4, 6).

Show answer

Gradient = (6 − (−2))/(4 − 0) = 8/4 = 2. The point (0, −2) is the y-intercept, so y = 2x − 2. Check: at x = 4, y = 8 − 2 = 6. ✓

3. Find the equation of the line with gradient 1/2 through (−2, 1).

Show answer

y − 1 = 1/2(x + 2), so y − 1 = x/2 + 1, giving y = x/2 + 2. Check: at x = −2, y = −1 + 2 = 1. ✓

Where this leads next

Next, see how gradients help you identify parallel and perpendicular lines, and later check whether three points are collinear. If the gradient step still feels uncertain, revisit calculating a gradient from two points. The coordinate geometry practice set has similar questions in mixed order.

Some students can follow every line of a worked example but stall on a blank question. A teacher in online one-to-one Mathematics tuition can watch where the first step goes wrong and adjust from there.

Questions people ask

Which is better, y − y₁ = m(x − x₁) or substituting into y = mx + c?

Both work, so use the one you will not mix up. The point-gradient form y − y₁ = m(x − x₁) needs no extra solving. Substituting into y = mx + c needs one small equation to find c. Whichever you choose, finish by testing the original point.

How do I check my equation is correct?

Substitute both given points into your final equation. If each side matches for each point, the equation is right. This takes ten seconds and catches almost every sign error in the working.

What if the question asks for the answer in the form ax + by = c?

First find y = mx + c, then rearrange. Multiply through to clear fractions, and move the x-term across. The two forms describe the same line, so your check with the given points still works on either form.

Updated:

Your next step

If you can find a gradient but the equation step still produces wrong intercepts, a one-to-one teacher can rebuild the method so every substitution has a reason.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service