Equation of a Straight Line: Parallel and Perpendicular Lines

Learn how to find the equation of a straight line for IGCSE Maths. This page shows you how to build the equation y = mx + c from a gradient and one point, or from two points, then extends to the rules for parallel lines (equal gradients) and perpendicular lines (gradients that multiply to make −1). Clear worked examples take you through every step, and the auto-marked practice rooms below let you build speed and confidence.

Prior Knowledge This page builds on the gradient of a straight line and on plotting straight-line graphs. Make sure you can find a gradient and read off a y-intercept before starting.

The equation \(y = mx + c\)

Every straight line can be written as \(y = mx + c\), where \(m\) is the gradient and \(c\) is the y-intercept. To find the equation of a line, you only need two pieces of information: its gradient and one point it passes through. From those, you can work out \(c\) and write down the full equation.

y x c (y-intercept) run rise m = rise ÷ run
m sets the steepness; c is where the line crosses the y-axis at the point (0, c).
Gradient and a point \(y - y_1 = m(x - x_1)\) Substitute the gradient and one point, then rearrange into \(y = mx + c\).
Parallel lines \(m_1 = m_2\) Parallel lines have equal gradients. Copy the gradient, then use the new point.
Perpendicular lines \(m_1 \times m_2 = -1\) The perpendicular gradient is the negative reciprocal: flip the fraction and change the sign.

Finding the equation of a straight line from a gradient and a point

When you know the gradient \(m\) and one point \((x_1,\,y_1)\) on the line, use:

Point-gradient form \[ y - y_1 = m(x - x_1) \]
  1. Write down the gradient \(m\) and the point \((x_1,\,y_1)\).
  2. Substitute them into \(y - y_1 = m(x - x_1)\).
  3. Expand the bracket and rearrange into \(y = mx + c\).

You can also substitute \(m\), \(x\) and \(y\) straight into \(y = mx + c\) and solve for \(c\). Both methods give the same answer; use whichever you find clearer.

Finding the equation from two points

  1. Find the gradient using \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\).
  2. Pick either point and substitute it, with \(m\), into \(y - y_1 = m(x - x_1)\).
  3. Rearrange into \(y = mx + c\).

Parallel and perpendicular gradients

Two lines are parallel when their gradients are equal. Two lines are perpendicular (meeting at a right angle) when their gradients multiply to give \(-1\). The perpendicular gradient is therefore the negative reciprocal: turn the fraction upside down and change the sign.

Perpendicular gradients \[ m_1 \times m_2 = -1 \qquad m_2 = -\dfrac{1}{m_1} \]

For example, if a line has gradient \(3\), a perpendicular line has gradient \(-\dfrac{1}{3}\). If a line has gradient \(-\dfrac{2}{5}\), a perpendicular line has gradient \(\dfrac{5}{2}\).

ParallelPerpendicularxyxyequal gradients2 × (-1/2) = -1
Parallel lines share a gradient. Perpendicular gradients multiply to make −1.

Worked examples

💡 Example 1: gradient and a point

Find the equation of the line with gradient \(4\) passing through \((2,\,5)\).

(2, 5)xy
\[ \begin{array}{rcl} y - y_1 &=& m(x - x_1) \\ y - 5 &=& 4(x - 2) \\ y - 5 &=& 4x - 8 \\ y &=& 4x - 3 \end{array} \]
What's happening?

Substitute \(m = 4\) and \((2,\,5)\) into point-gradient form.

Expand the bracket, then add \(5\) to both sides to reach \(y = mx + c\).

💡 Example 2: two points

Find the equation of the line through \(A(1,\,3)\) and \(B(4,\,12)\).

A(1,3)B(4,12)xy
\[ \begin{array}{rcl} m &=& \dfrac{12 - 3}{4 - 1} \\ &=& \dfrac{9}{3} \\ &=& 3 \\ y - 3 &=& 3(x - 1) \\ y - 3 &=& 3x - 3 \\ y &=& 3x \end{array} \]
What's happening?

First find the gradient with the rise over run formula.

Then substitute that gradient and point \(A\) into point-gradient form and rearrange.

💡 Example 3: parallel line

A line is parallel to \(y = 2x + 7\) and passes through \((3,\,1)\). Find its equation.

(3,1)xy

Parallel, so \(m = 2\).

\[ \begin{array}{rcl} y - 1 &=& 2(x - 3) \\ y - 1 &=& 2x - 6 \\ y &=& 2x - 5 \end{array} \]
What's happening?

Parallel lines share a gradient, so copy \(m = 2\) from the given line.

Use the new point \((3,\,1)\) to find the new intercept.

💡 Example 4: perpendicular line

A line is perpendicular to \(y = 2x + 7\) and passes through \((4,\,3)\). Find its equation.

(4,3)xy

Given gradient \(2\), so perpendicular gradient is

\[ \begin{array}{rcl} m_2 &=& -\dfrac{1}{2} \\ y - 3 &=& -\dfrac{1}{2}(x - 4) \\ y - 3 &=& -\dfrac{1}{2}x + 2 \\ y &=& -\dfrac{1}{2}x + 5 \end{array} \]
What's happening?

Take the negative reciprocal of \(2\) to get \(-\dfrac{1}{2}\).

Then use the point \((4,\,3)\) exactly as before to find the intercept.

💡 Example 5: gradient given as a fraction

Find the equation of the line perpendicular to \(y = -\dfrac{3}{5}x + 1\) that passes through \((-2,\,4)\).

(-2,4)xy

Given gradient \(-\dfrac{3}{5}\). The negative reciprocal flips the fraction and changes the sign:

\[ \begin{array}{rcl} m_2 &=& \dfrac{5}{3} \\ y - 4 &=& \dfrac{5}{3}\bigl(x - (-2)\bigr) \\ y - 4 &=& \dfrac{5}{3}(x + 2) \\ y - 4 &=& \dfrac{5}{3}x + \dfrac{10}{3} \\ y &=& \dfrac{5}{3}x + \dfrac{22}{3} \end{array} \]
What's happening?

Flip \(-\dfrac{3}{5}\) to \(-\dfrac{5}{3}\), then change the sign to \(\dfrac{5}{3}\).

Subtracting a negative \(x_1\) becomes adding: \(x - (-2) = x + 2\).

Add \(4\), written as \(\dfrac{12}{3}\), to \(\dfrac{10}{3}\) to get \(\dfrac{22}{3}\).

🔑 Key points

  • You need a gradient and one point to fix a line's equation.
  • Point-gradient form: \(y - y_1 = m(x - x_1)\), then rearrange to \(y = mx + c\).
  • From two points, find the gradient first.
  • Parallel lines: equal gradients, \(m_1 = m_2\).
  • Perpendicular lines: \(m_1 \times m_2 = -1\), so take the negative reciprocal.

⚠️ Common pitfalls

  • Forgetting to change the sign when finding a perpendicular gradient.
  • Only flipping the fraction, or only changing the sign, not both.
  • Sign slips with a negative point: \(x - (-2) = x + 2\).
  • Leaving the answer as \(y - y_1 = m(x - x_1)\) instead of rearranging fully.
  • Using the gradient of the given line for a perpendicular line by mistake.
⇩ Jump to Practice Questions ⇩

Ready to practise? The rooms below cover finding equations from a gradient and a point, from two points, and from parallel and perpendicular conditions.

Next: Quadratic Graphs →

Equation of a Straight Line: Practice Room

Practise finding the equation of a straight line, auto-marked as you type. Most answers go in the form y = mx + c (for example y=3x-2, y=-1/2x+5). In Room 3 the first column asks you to classify a pair of lines by tapping a button, and in Room 4 the first column asks for a perpendicular gradient on its own (for example -1/3). Questions are randomly generated each time, so refresh for a new set. Difficulty rises left to right: Starter, Builder, Challenger, Master.

Correct 0 Re-attempts 0 🔥 Streak 0 🏆 Best 0