TheIGCSEMathsTutor.com

Straight Line Graphs in IGCSE Maths

Understanding y = mx + c, finding the gradient and equation of a line, and working with parallel and perpendicular lines.

0580 · E2.10 / E2.11
01

Understanding y = mx + c

The equation of a straight line

Every straight line can be written in the form:

\[y = mx + c\]

where \(m\) is the gradient (how steep the line is) and \(c\) is the y-intercept (where the line crosses the y-axis).

x y 1 2 c = 1 m = 2 y = 2x + 1

In the graph above, the line \(y = 2x + 1\) has a gradient of 2 (it goes up 2 for every 1 across) and crosses the y-axis at 1.

Positive vs negative gradient

If \(m > 0\), the line slopes upward from left to right (uphill). If \(m < 0\), it slopes downward (downhill). A larger value of \(m\) means a steeper line.

02

Finding the gradient

The gradient formula

The gradient measures how steep a line is. Given two points \((x_1, y_1)\) and \((x_2, y_2)\) on the line:

\[m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{rise}}{\text{run}}\]

Rise is the vertical change, run is the horizontal change.

Example 1 · Finding the gradient from two points

Find the gradient of the line through \((2, 3)\) and \((6, 11)\).

Solution
\[m = \frac{11 - 3}{6 - 2} = \frac{8}{4} = 2\]
Example 2 · Negative gradient

Find the gradient of the line through \((1, 7)\) and \((4, 1)\).

Solution
\[m = \frac{1 - 7}{4 - 1} = \frac{-6}{3} = -2\]

The negative gradient tells us the line slopes downward from left to right.

Finding the gradient from a graph

Pick two points on the line where it crosses grid intersections. Draw a right-angled triangle between them. Count the squares across (run) and up or down (rise). Gradient = rise ÷ run.

run = 4 rise = 3 m = 3/4 (positive) run = 4 rise = −4 m = −4/4 = −1 (negative)

If the line goes uphill (left to right), the rise is positive and the gradient is positive. If it goes downhill, the rise is negative and the gradient is negative.

03

Reading the equation from a graph

The method
Step 1 — Read the y-intercept

Find where the line crosses the y-axis. This gives you \(c\).

Step 2 — Find the gradient

Pick two points on the line that sit on grid intersections. Use the gradient formula or count rise and run.

Step 3 — Write y = mx + c

Substitute your values of \(m\) and \(c\).

Example 3 · Reading the equation from a graph

Find the equation of the line shown below.

x y 1 2 3 4 5 6 1 2 3 4
Step 1 — Read the y-intercept

The line crosses the y-axis at \(4\), so \(c = 4\).

Step 2 — Find the gradient

Pick two points on grid intersections: \((0, 4)\) and \((2, 3)\).

\[m = \frac{3 - 4}{2 - 0} = \frac{-1}{2} = -\tfrac{1}{2}\]
Step 3 — Write the equation
\[y = -\tfrac{1}{2}x + 4\]
Example 4 · From y-intercept and a point

A straight line crosses the y-axis at \(-3\) and passes through the point \((4, 5)\). Find its equation.

Step 1 — y-intercept

\(c = -3\)

Step 2 — Gradient

Using the y-intercept \((0, -3)\) and the point \((4, 5)\):

\[m = \frac{5 - (-3)}{4 - 0} = \frac{8}{4} = 2\]
Step 3 — Write the equation
\[y = 2x - 3\]
04

Equation of a line through two points

The method

When you don't have the y-intercept, you need an extra step.

Step 1 — Find the gradient using the two points
\[m = \frac{y_2 - y_1}{x_2 - x_1}\]
Step 2 — Substitute m and one point into y = mx + c to find c

Pick either point and substitute its \(x\) and \(y\) values along with \(m\) to solve for \(c\).

Step 3 — Write the equation
Finding the midpoint of a line segment

The midpoint of a line segment between \((x_1, y_1)\) and \((x_2, y_2)\) is:

\[M = \left(\frac{x_1 + x_2}{2},\; \frac{y_1 + y_2}{2}\right)\]

Average the x-coordinates and average the y-coordinates. For example, the midpoint of \((3, 5)\) and \((7, 17)\) is \(\left(\frac{3+7}{2},\; \frac{5+17}{2}\right) = (5, 11)\).

You need this when finding perpendicular bisectors — see the exam questions below.

Example 5 · Equation from two points

Find the equation of the line through \((3, 5)\) and \((7, 17)\).

Step 1 — Gradient
\[m = \frac{17 - 5}{7 - 3} = \frac{12}{4} = 3\]
Step 2 — Find c using (3, 5)
\[\begin{aligned}5 &= 3(3) + c \\[4pt] 5 &= 9 + c \\[4pt] c &= -4\end{aligned}\]
Step 3 — Write the equation
\[y = 3x - 4\]
05

Rearranging to y = mx + c

Why you need this

Equations are not always given in the form \(y = mx + c\). You may see forms like \(2x + 3y = 12\) or \(3y = 6x - 9\). To find the gradient and y-intercept, rearrange to make \(y\) the subject.

Example 7 · Rearranging

Find the gradient and y-intercept of \(2x + 5y = 20\).

Solution
\[\begin{aligned}5y &= -2x + 20 \\[4pt] y &= -\tfrac{2}{5}x + 4\end{aligned}\]

Gradient: \(m = -\frac{2}{5}\). Y-intercept: \(c = 4\).

Example 8 · Rearranging

Find the gradient of \(3x - 4y + 8 = 0\).

Solution
\[\begin{aligned}-4y &= -3x - 8 \\[4pt] y &= \tfrac{3}{4}x + 2\end{aligned}\]

Gradient: \(m = \frac{3}{4}\).

06

Parallel lines

The rule

Parallel lines have the same gradient.

If line 1 has gradient \(m\), any line parallel to it also has gradient \(m\). The only difference is the y-intercept.

x y 3 −1 y = x + 3 y = x − 1
Example 9 · Finding a parallel line

Find the equation of the line parallel to \(y = 3x + 1\) that passes through \((2, 4)\).

Step 1 — Same gradient

Parallel means same gradient: \(m = 3\).

Step 2 — Find c using (2, 4)
\[\begin{aligned}4 &= 3(2) + c \\[4pt] 4 &= 6 + c \\[4pt] c &= -2\end{aligned}\]
Answer
\[y = 3x - 2\]
07

Perpendicular lines

The rule

Perpendicular lines meet at 90°. Their gradients are negative reciprocals of each other:

\[m_1 \times m_2 = -1\]

To find the perpendicular gradient, flip the fraction and change the sign (the same principle as negative indices). For example, if \(m_1 = 3\), then \(m_2 = -\frac{1}{3}\). If \(m_1 = -\frac{2}{5}\), then \(m_2 = \frac{5}{2}\).

x y −1 3 y = 2x − 1 y = −½x + 3
Example 10 · Finding a perpendicular line

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

Step 1 — Perpendicular gradient

The gradient of \(y = 2x - 1\) is 2. The perpendicular gradient is \(-\frac{1}{2}\).

Step 2 — Find c using (4, 5)
\[\begin{aligned}5 &= -\tfrac{1}{2}(4) + c \\[4pt] 5 &= -2 + c \\[4pt] c &= 7\end{aligned}\]
Answer
\[y = -\tfrac{1}{2}x + 7\]
Example 11 · Showing two lines are perpendicular

Show that \(y = 4x + 1\) and \(2y + \frac{1}{2}x = 3\) are perpendicular.

Solution

Rearrange the second equation:

\[\begin{aligned}2y &= -\tfrac{1}{2}x + 3 \\[4pt] y &= -\tfrac{1}{4}x + \tfrac{3}{2}\end{aligned}\]

Gradient of line 1: \(m_1 = 4\). Gradient of line 2: \(m_2 = -\frac{1}{4}\).

\[m_1 \times m_2 = 4 \times \left(-\tfrac{1}{4}\right) = -1\]

Since the product is \(-1\), the lines are perpendicular.

08

Horizontal and vertical lines

Special cases

Horizontal lines have the equation \(y = c\) (gradient = 0). Every point on the line has the same y-coordinate.

Vertical lines have the equation \(x = k\). Every point on the line has the same x-coordinate. Vertical lines do not have a gradient (it is undefined).

x y y = 3 x = 2
09

Exam-style questions

Exam question 1 · Equation from a graph · 2 marks
Question

A straight line has a gradient of \(-3\) and passes through the point \((0, 7)\). Write down the equation of the line.

Show solution

The point \((0, 7)\) is on the y-axis, so \(c = 7\).

\[y = -3x + 7\]
Exam question 2 · Equation from a graph · 3 marks
Question

Find the equation of the line shown on the grid below.

x y −1 1 2 3 4 5 −1 1 2 3 4 5
Show solution
Step 1 — Read the y-intercept

The line crosses the y-axis at \(-1\), so \(c = -1\).

Step 2 — Find the gradient

Using the points \((0, -1)\) and \((2, 2)\):

\[m = \frac{2 - (-1)}{2 - 0} = \frac{3}{2}\]

Equation: \(y = \frac{3}{2}x - 1\).

Exam question 3 · Parallel line · 3 marks
Question

Line \(L\) has equation \(y = 4x - 5\). Find the equation of the line parallel to \(L\) that passes through \((1, 2)\).

Show solution

Parallel means same gradient: \(m = 4\).

\[\begin{aligned}2 &= 4(1) + c \\[4pt] c &= -2\end{aligned}\]

Equation: \(y = 4x - 2\).

Exam question 4 · Perpendicular line · 4 marks
Question

Line \(L\) has equation \(3x + 6y = 12\). Find the equation of the line perpendicular to \(L\) that passes through \((4, 1)\).

Show solution
Step 1 — Rearrange to find the gradient of L
\[\begin{aligned}6y &= -3x + 12 \\[4pt] y &= -\tfrac{1}{2}x + 2\end{aligned}\]

Gradient of \(L\): \(m = -\frac{1}{2}\).

Step 2 — Perpendicular gradient

Negative reciprocal: \(m = 2\).

Step 3 — Find c using (4, 1)
\[\begin{aligned}1 &= 2(4) + c \\[4pt] c &= -7\end{aligned}\]

Equation: \(y = 2x - 7\).

Exam question 5 · Midpoint and line · 5 marks
Question

The points \(A = (2, 8)\) and \(B = (6, 4)\) are given. Find the equation of the perpendicular bisector of \(AB\).

Show solution
Step 1 — Midpoint of AB
\[M = \left(\frac{2+6}{2}, \frac{8+4}{2}\right) = (4, 6)\]
Step 2 — Gradient of AB
\[m_{AB} = \frac{4 - 8}{6 - 2} = \frac{-4}{4} = -1\]
Step 3 — Perpendicular gradient

Negative reciprocal of \(-1\) is \(1\).

Step 4 — Find c using the midpoint (4, 6)
\[\begin{aligned}6 &= 1(4) + c \\[4pt] c &= 2\end{aligned}\]

Equation: \(y = x + 2\)

10

Common mistakes

Swapping rise and run

The gradient is \(\frac{y_2 - y_1}{x_2 - x_1}\), not \(\frac{x_2 - x_1}{y_2 - y_1}\). The \(y\) change goes on top. Remember: rise (vertical) over run (horizontal).

Mixing up gradient and midpoint formulas

The gradient formula uses subtraction: \(\frac{y_2 - y_1}{x_2 - x_1}\). The midpoint formula uses addition and divides by 2: \(\left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right)\). Students often mix these up under exam pressure — subtracting when they should add, or dividing by 2 in the gradient formula.

Sign errors in the gradient

When subtracting negative coordinates, be careful. \(\frac{-3 - 5}{3 - (-1)} = \frac{-8}{4}\), not \(\frac{-8}{2}\). Show your working so you can spot where a sign goes wrong.

Perpendicular = just change the sign

The perpendicular gradient is the negative reciprocal, not just the negative. If the gradient is 3, the perpendicular gradient is \(-\frac{1}{3}\), not \(-3\). You must flip the fraction and change the sign.

Need help with straight line graphs?

I teach IGCSE Maths one-to-one online. Book a free chat and we can work on the areas you find most challenging.

Book a Free Chat