Straight-Line Graphs

Every straight line is captured by one small equation, \(y = mx + c\). Learn to read \(m\) and \(c\) off a line, and to build the equation back from a gradient and a point.

MYP 4-5ExtendedAlgebraCriteria A · C~11 min read

The equation \(y = mx + c\)

Any non-vertical straight line can be written as:

\[ y = mx + c \]

where \(m\) is the gradient (how steep the line is) and \(c\) is the \(y\)-intercept (where it crosses the \(y\)-axis). Read them straight off: in \(y = 3x - 1\), the gradient is 3 and the line crosses the \(y\)-axis at \((0,-1)\).

What the gradient tells you
The gradient is the change in \(y\) for every \(+1\) in \(x\). A positive gradient slopes up to the right; a negative one slopes down. A bigger number means a steeper line.

Finding the gradient

Given two points on a line, the gradient is the change in \(y\) divided by the change in \(x\), often remembered as "rise over run":

\[ m = \frac{y_2 - y_1}{x_2 - x_1} \]
Worked example

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

1
Label the points: \((x_1,y_1) = (1,2)\) and \((x_2,y_2) = (4,11)\).
2
Apply the formula: \(m = \dfrac{11 - 2}{4 - 1} = \dfrac{9}{3}\).
\(m = 3\)

Keep the order consistent

Whichever point you call "2", use it on top and bottom. Subtracting \(y\)s in one order and \(x\)s in the other flips the sign of your gradient.

Building the equation from a gradient and a point

Once you know \(m\), substitute a known point to find \(c\).

Worked example

A line has gradient 2 and passes through \((1, 3)\). Find its equation.

1
Start from \(y = mx + c\) with \(m = 2\): \(y = 2x + c\).
2
Substitute the point \((1,3)\): \(3 = 2(1) + c\).
3
Solve for \(c\): \(3 = 2 + c \Rightarrow c = 1\).
\(y = 2x + 1\)

Parallel & perpendicular lines

Two facts about gradients are examiner favourites:

  • Parallel lines never meet, so they have the same gradient.
  • Perpendicular lines meet at a right angle, and their gradients multiply to \(-1\). In practice, take the negative reciprocal: flip the fraction and change the sign.
\[ \text{Perpendicular gradient} = -\frac{1}{m} \]
Worked example

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

1
The original gradient is 2, so the perpendicular gradient is \(-\dfrac{1}{2}\).
2
The line passes through \((0,4)\), which is the \(y\)-intercept, so \(c = 4\).
\(y = -\dfrac{1}{2}x + 4\)

Negative reciprocal, in two steps

Gradient 3 becomes \(-\tfrac{1}{3}\); gradient \(-\tfrac{2}{5}\) becomes \(+\tfrac{5}{2}\). Flip the fraction, then swap the sign. Do both, missing one is the classic mistake.

Check yourself

1. What is the gradient of \(y = 3 - 4x\)? +

Rewrite as \(y = -4x + 3\). The gradient is the coefficient of \(x\): \(\mathbf{-4}\).

2. Find the equation of the line with gradient 3 through \((2, 5)\). +

\(y = 3x + c\); substitute: \(5 = 3(2) + c \Rightarrow c = -1\). So \(\mathbf{y = 3x - 1}\).

3. What gradient is perpendicular to \(y = \tfrac{1}{3}x + 2\)? +

Negative reciprocal of \(\tfrac{1}{3}\): flip to 3, change sign to get \(\mathbf{-3}\).


Part of the Extended Maths library. Spotted an error or want a topic added? That feedback makes the notes better.