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.
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.
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:
- Write down the gradient \(m\) and the point \((x_1,\,y_1)\).
- Substitute them into \(y - y_1 = m(x - x_1)\).
- 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
- Find the gradient using \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\).
- Pick either point and substitute it, with \(m\), into \(y - y_1 = m(x - x_1)\).
- 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.
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}\).
Worked examples
💡 Example 1: gradient and a point
Find the equation of the line with gradient \(4\) passing through \((2,\,5)\).
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)\).
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.
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.
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)\).
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.