7.2 Equations of Straight Lines

SL 2.1

In this section you will learn
  • the three forms of the equation of a straight line: point-gradient, gradient-intercept and general form
  • how to find the gradient and the intercepts from an equation
  • why perpendicular lines have gradients with \(m_1 m_2 = -1\)
  • how to use parallel and perpendicular lines to solve problems with triangles, trapezia and rectangles

The equation of a straight line

The equation of a line is a rule that connects \(x\) and \(y\) for every point on the line, and for no other point.

Suppose a line has gradient \(m\) and passes through the fixed point \((x_1, y_1)\). Let \((x, y)\) be any other point on the line. Using the gradient formula,

\[ \frac{y - y_1}{x - x_1} = m \qquad\Longrightarrow\qquad y - y_1 = m(x - x_1) . \]

This is the point-gradient form. It lets you write down the equation as soon as you know the gradient and one point. You can then rearrange it into the other forms.

Equations of a straight line In the formula booklet

\[ y = mx + c ; \quad ax + by + d = 0 ; \quad y - y_1 = m(x - x_1) \]

\[ \begin{aligned} &y = mx + c && \text{gradient-intercept form}\\ &ax + by + d = 0 && \text{general form}\\ &y - y_1 = m(x - x_1) && \text{point-gradient form} \end{aligned} \]

  • \(m\): the gradient
  • \(c\): the \(y\)-intercept
  • \(a\): a constant (\(a\) and \(b\) are not both \(0\))
  • \(b\): a constant
  • \(d\): a constant
  • \((x_1, y_1)\): a point on the line

In general form, we usually choose \(a\), \(b\), \(d\) to be integers with no common factor (and often \(a > 0\)). Some books write the general form as \(ax + by = d\); this is the same idea.

Intercepts. The \(y\)-intercept is where \(x = 0\). The \(x\)-intercept is where \(y = 0\). For example, for \(3x - 4y + 12 = 0\):

  • rearrange: \(4y = 3x + 12\), so \(y = \dfrac{3}{4}x + 3\). The gradient is \(\dfrac{3}{4}\) and the \(y\)-intercept is \(3\).
  • put \(y = 0\): \(3x + 12 = 0\), so the \(x\)-intercept is \(-4\).

Special lines. A horizontal line has equation \(y = b\) (gradient \(0\)). A vertical line has equation \(x = a\) (gradient not defined). The \(x\)-axis is \(y = 0\) and the \(y\)-axis is \(x = 0\).

Example 1 \(A\) is the point \((-3, 7)\) and \(B\) is the point \((5, 1)\).

(a) Find the length of \(AB\).

(b) Find the equation of the line \(AB\), in the form \(ax + by + d = 0\).

(c) The line \(p\) has equation \(6x + 8y = 11\).

\(\quad\) (i) Explain how you can tell that \(p\) does not intersect the line \(AB\).

\(\quad\) (ii) The line \(q\) has equation \(4y = 2x - 17\). Find the coordinates of the point where \(p\) and \(q\) intersect.

(a) \(AB = \sqrt{(5 + 3)^2 + (1 - 7)^2} = \sqrt{64 + 36} = 10\).

(b) \(m = \dfrac{1 - 7}{5 - (-3)} = \dfrac{-6}{8} = -\dfrac{3}{4}\). Use point-gradient form with \(B(5, 1)\):

\[ y - 1 = -\frac{3}{4}(x - 5) \;\Longrightarrow\; 4y - 4 = -3x + 15 \;\Longrightarrow\; 3x + 4y - 19 = 0 . \]

(c)(i) For \(p\): \(8y = -6x + 11\), so \(y = -\dfrac{3}{4}x + \dfrac{11}{8}\). The gradient is \(-\dfrac{3}{4}\), the same as \(AB\). The \(y\)-intercepts are different (\(\dfrac{11}{8}\) and \(\dfrac{19}{4}\)), so the lines are parallel and different. They never meet.

(ii) From \(q\): \(4y = 2x - 17\). The equation of \(p\) contains \(8y = 2 \times 4y\), so substitute:

\[ 6x + 2(2x - 17) = 11 \;\Longrightarrow\; 10x - 34 = 11 \;\Longrightarrow\; x = \frac{9}{2} . \]

Then \(4y = 9 - 17 = -8\), so \(y = -2\). The point of intersection is \(\left(\dfrac{9}{2}, -2\right)\).

Calculator page: Menu → Algebra → Solve System of Equations → Solve System of Linear Equations, 2 equations. Type 6x+8y=11 and 4y=2x-17. The result is \(x = 4.5\), \(y = -2\).

Or, on a Graphs page, draw both lines (in the form \(y = \ldots\)) and use Menu → Geometry → Points & Lines → Intersection Point(s).

Perpendicular lines

In Figure 1, \(l_1\) and \(l_2\) are perpendicular lines through the origin, with gradients \(m_1\) and \(m_2\). (Any pair of perpendicular lines can be moved to pass through \(O\) without changing the gradients.)

Figure 1: Perpendicular lines \(l_1\) and \(l_2\)

Moving \(1\) unit to the right from \(O\), each line rises by its gradient. So \(P(1, m_1)\) is on \(l_1\) and \(Q(1, m_2)\) is on \(l_2\).

The angle \(POQ\) is \(90^\circ\), so by Pythagoras’ theorem \(OP^2 + OQ^2 = PQ^2\). Using the distance formula,

\[ OP^2 = 1 + m_1^2, \qquad OQ^2 = 1 + m_2^2, \qquad PQ^2 = (m_1 - m_2)^2 . \]

Hence

\[ (1 + m_1^2) + (1 + m_2^2) = m_1^2 - 2m_1 m_2 + m_2^2 \;\Longrightarrow\; 2 = -2m_1 m_2 \;\Longrightarrow\; m_1 m_2 = -1 . \]

Perpendicular lines Not in the formula booklet

The lines \(y = m_1 x + c_1\) and \(y = m_2 x + c_2\) are perpendicular if and only if

\[ m_1 m_2 = -1, \qquad\text{that is,}\qquad m_2 = -\frac{1}{m_1} . \]

  • \(m_1\): the gradient of the first line
  • \(c_1\): the \(y\)-intercept of the first line
  • \(m_2\): the gradient of the second line
  • \(c_2\): the \(y\)-intercept of the second line

In words: the gradient of a perpendicular line is the negative reciprocal. Turn the fraction upside down and change the sign.

Gradient \(m_1\) \(2\) \(-\dfrac{1}{3}\) \(\dfrac{3}{4}\) \(-5\)
Perpendicular gradient \(m_2\) \(-\dfrac{1}{2}\) \(3\) \(-\dfrac{4}{3}\) \(\dfrac{1}{5}\)

(The rule does not work for a horizontal and a vertical line, because a vertical line has no gradient. They are still perpendicular.)

Example 2 The line \(l\) has equation \(2x + y = 4\), and \(P\) is the point \((5, 4)\).

(a) Find the equation of the line through \(P\) that is perpendicular to \(l\).

(b) The two lines meet at the point \(F\). Find the coordinates of \(F\).

(c) Hence find the shortest distance from \(P\) to the line \(l\).

(a) \(l\): \(y = -2x + 4\), so \(m_l = -2\). The perpendicular gradient is \(\dfrac{1}{2}\).

\[ y - 4 = \frac{1}{2}(x - 5) \;\Longrightarrow\; y = \frac{1}{2}x + \frac{3}{2} \qquad(\text{or } x - 2y + 3 = 0). \]

(b) Solve \(2x + y = 4\) with \(y = \dfrac{1}{2}x + \dfrac{3}{2}\):

\[ 2x + \frac{1}{2}x + \frac{3}{2} = 4 \;\Longrightarrow\; \frac{5}{2}x = \frac{5}{2} \;\Longrightarrow\; x = 1, \quad y = 2 . \]

So \(F\) is \((1, 2)\).

(c) The shortest distance from a point to a line is along the perpendicular. So it is \(PF\):

\[ PF = \sqrt{(5 - 1)^2 + (4 - 2)^2} = \sqrt{16 + 4} = \sqrt{20} = 2\sqrt{5} . \]

Example 3 Figure 2 shows a trapezium \(ABCD\) in which \(AB\) is parallel to \(DC\). The point \(A\) lies on the \(y\)-axis. \(B\) is \((6, 10)\) and \(D\) is \((2, -2)\). The sides \(AB\) and \(DC\) are both perpendicular to \(BC\). The equation of \(DC\) is \(x - 2y - 6 = 0\). Find

(a) the equation of \(AB\), \(\qquad\) (b) the equation of \(BC\),

(c) the coordinates of \(A\) and of \(C\),

(d) the area of the trapezium.

Figure 2: Trapezium \(ABCD\) (not to scale)

(a) \(DC\): \(2y = x - 6\), so \(y = \dfrac{1}{2}x - 3\) and \(m_{DC} = \dfrac{1}{2}\). \(AB \parallel DC\), so \(m_{AB} = \dfrac{1}{2}\):

\[ y - 10 = \frac{1}{2}(x - 6) \;\Longrightarrow\; y = \frac{1}{2}x + 7 . \]

(b) \(BC \perp DC\), so \(m_{BC} = -2\):

\[ y - 10 = -2(x - 6) \;\Longrightarrow\; y = -2x + 22 . \]

(c) \(A\) is on the \(y\)-axis, so put \(x = 0\) in the equation of \(AB\): \(A\) is \((0, 7)\).

\(C\) is where \(BC\) meets \(DC\): \(\;\dfrac{1}{2}x - 3 = -2x + 22 \Rightarrow \dfrac{5}{2}x = 25 \Rightarrow x = 10\), \(y = 2\). So \(C\) is \((10, 2)\).

(d) The parallel sides are \(AB\) and \(DC\), and the height is \(BC\):

\[ AB = \sqrt{6^2 + 3^2} = 3\sqrt{5}, \qquad DC = \sqrt{8^2 + 4^2} = 4\sqrt{5}, \qquad BC = \sqrt{4^2 + 8^2} = 4\sqrt{5} . \]

\[ \text{Area} = \frac{1}{2}(AB + DC) \times BC = \frac{1}{2}\big(3\sqrt{5} + 4\sqrt{5}\big) \times 4\sqrt{5} = \frac{1}{2} \times 7 \times 4 \times 5 = 70 . \]

Example 4 \(PQRS\) is a rectangle. \(P\) is the point \((-2, 1)\) and the equation of the side \(QR\) is \(2x + y - 12 = 0\).

(a) Find the equation of \(PS\). \(\qquad\) (b) Find the equation of \(PQ\).

(c) Find the coordinates of \(Q\).

(d) The area of \(PQRS\) is \(60\) units². Given that \(R\) lies below the \(x\)-axis, find the coordinates of \(R\) and of \(S\).

\(QR\): \(y = -2x + 12\), so \(m_{QR} = -2\).

(a) \(PS \parallel QR\), so \(m_{PS} = -2\): \(\;y - 1 = -2(x + 2)\), that is \(2x + y + 3 = 0\).

(b) \(PQ \perp QR\), so \(m_{PQ} = \dfrac{1}{2}\): \(\;y - 1 = \dfrac{1}{2}(x + 2)\), that is \(x - 2y + 4 = 0\).

(c) Solve \(x = 2y - 4\) and \(2x + y = 12\): \(\;2(2y - 4) + y = 12 \Rightarrow 5y = 20 \Rightarrow y = 4\), \(x = 4\). So \(Q\) is \((4, 4)\).

(d) \(PQ = \sqrt{6^2 + 3^2} = 3\sqrt{5}\). Area \(= PQ \times QR = 60\), so \(QR = \dfrac{60}{3\sqrt{5}} = 4\sqrt{5}\).

Along \(QR\) (gradient \(-2\)), a step of \(1\) to the right and \(2\) down has length \(\sqrt{5}\). So \(R\) is \(4\) such steps from \(Q\): \(R = (4 + 4,\; 4 - 8) = (8, -4)\). (The other direction gives \((0, 12)\), which is above the \(x\)-axis.)

\(\overrightarrow{PS}\) is the same move as \(\overrightarrow{QR}\), so \(S = (-2 + 4,\; 1 - 8) = (2, -7)\).

Check: \(R(8, -4)\) is on \(QR\), since \(16 - 4 - 12 = 0\) ✓.

Common errors

✗ Wrong ✓ Right Why
\(y + 2 = 3(x + 1)\) for the point \((-1, 2)\) \(y - 2 = 3(x + 1)\) In \(y - y_1 = m(x - x_1)\), substitute with the signs: \(x - (-1) = x + 1\) but \(y - 2\).
\(3x - 4y + 12 = 0\) has gradient \(3\) gradient \(\dfrac{3}{4}\) Make \(y\) the subject first: \(y = \dfrac{3}{4}x + 3\).
Perpendicular to \(m = \dfrac{2}{3}\): \(m = \dfrac{3}{2}\) \(m = -\dfrac{3}{2}\) Negative reciprocal: flip and change the sign.
Perpendicular to \(m = \dfrac{2}{3}\): \(m = -\dfrac{2}{3}\) \(m = -\dfrac{3}{2}\) Changing only the sign is not enough; \(\dfrac{2}{3} \times \left(-\dfrac{2}{3}\right) \ne -1\).
Shortest distance from \(P\) to \(l\) = distance to the \(y\)-intercept Distance to the foot of the perpendicular The shortest route to a line meets it at \(90^\circ\).

Exercises

1 For the line \(3x - 4y + 12 = 0\), find the gradient, the \(y\)-intercept and the \(x\)-intercept.

\(4y = 3x + 12 \Rightarrow y = \dfrac{3}{4}x + 3\). Gradient \(\dfrac{3}{4}\), \(y\)-intercept \(3\).

\(y = 0\): \(3x = -12\), so the \(x\)-intercept is \(-4\).

2 Find the equation of the line through \((2, -5)\) with gradient \(3\). Give it in the form \(y = mx + c\).

\(y + 5 = 3(x - 2) \Rightarrow y = 3x - 11\).

3 Find the equation of the line through \((-1, 4)\) and \((3, -4)\), in the form \(ax + by + d = 0\) with \(a, b, d \in \mathbb{Z}\).

\(m = \dfrac{-4 - 4}{3 + 1} = -2\). \(\;y - 4 = -2(x + 1) \Rightarrow y = -2x + 2 \Rightarrow 2x + y - 2 = 0\).

4 Find the equation of the line through \((4, 1)\) that is parallel to \(2x - 5y + 7 = 0\). Give your answer in general form with integer coefficients.

\(5y = 2x + 7\), so \(m = \dfrac{2}{5}\). \(\;y - 1 = \dfrac{2}{5}(x - 4) \Rightarrow 5y - 5 = 2x - 8 \Rightarrow 2x - 5y - 3 = 0\).

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

Perpendicular gradient \(-\dfrac{1}{3}\). \(\;y - 2 = -\dfrac{1}{3}(x + 3) \Rightarrow 3y - 6 = -x - 3 \Rightarrow x + 3y - 3 = 0\).

6 The lines \(kx + 2y = 5\) and \(4x - 6y = 1\) are perpendicular. Find \(k\).

Gradients: \(-\dfrac{k}{2}\) and \(\dfrac{4}{6} = \dfrac{2}{3}\).

\(-\dfrac{k}{2} \times \dfrac{2}{3} = -1 \Rightarrow -\dfrac{k}{3} = -1 \Rightarrow k = 3\).

7 The lines \(2x + ky = 1\) and \((k - 1)x + 3y = 4\) are parallel. Find the possible values of \(k\).

Gradients: \(-\dfrac{2}{k}\) and \(-\dfrac{k - 1}{3}\). Set them equal:

\[ \frac{2}{k} = \frac{k - 1}{3} \;\Longrightarrow\; k^2 - k - 6 = 0 \;\Longrightarrow\; (k - 3)(k + 2) = 0 . \]

So \(k = 3\) or \(k = -2\). (Check: \(k = 3\) gives \(2x + 3y = 1\) and \(2x + 3y = 4\); \(k = -2\) gives \(x - y = \frac{1}{2}\) and \(x - y = -\frac{4}{3}\). Both pairs are parallel and different.)

8 Find the point of intersection of the lines \(3x + 2y = 7\) and \(x - 4y = 14\).

From the second line, \(x = 14 + 4y\). Substitute: \(3(14 + 4y) + 2y = 7 \Rightarrow 14y = -35 \Rightarrow y = -\dfrac{5}{2}\).

Then \(x = 14 - 10 = 4\). The point is \(\left(4, -\dfrac{5}{2}\right)\).

9 The vertices of a triangle are \(A(0, 2)\), \(B(4, 0)\) and \(C(6, 4)\). Show that the triangle has a right angle at \(B\), and find its area.

\(m_{AB} = \dfrac{0 - 2}{4 - 0} = -\dfrac{1}{2}\) and \(m_{BC} = \dfrac{4 - 0}{6 - 4} = 2\). Since \(-\dfrac{1}{2} \times 2 = -1\), \(AB \perp BC\): the right angle is at \(B\).

\(AB = \sqrt{16 + 4} = \sqrt{20}\), \(BC = \sqrt{4 + 16} = \sqrt{20}\). Area \(= \dfrac{1}{2} \times \sqrt{20} \times \sqrt{20} = 10\).

10 The line \(l\) has equation \(x + 2y - 4 = 0\) and \(P\) is the point \((5, 7)\). Find the foot of the perpendicular from \(P\) to \(l\), and hence the shortest distance from \(P\) to \(l\).

\(l\): \(y = -\dfrac{1}{2}x + 2\), so the perpendicular gradient is \(2\). Line through \(P\): \(y - 7 = 2(x - 5)\), so \(y = 2x - 3\).

Substitute into \(l\): \(x + 2(2x - 3) - 4 = 0 \Rightarrow 5x = 10 \Rightarrow x = 2\), \(y = 1\). The foot is \(F(2, 1)\).

Shortest distance \(PF = \sqrt{3^2 + 6^2} = \sqrt{45} = 3\sqrt{5}\).