Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics guide, Foundations, step 4 of 33Previous stepNext step

Step 4: Lines and Circles

Syllabus9709 P1 1.3 · IB SL 2.1
In 30 seconds
  • Two points give you three numbers: the distance between them (Pythagoras), the midpoint (average the coordinates) and the gradient (rise over run).
  • Find a line with \( y-y_1 = m(x-x_1) \), read it with \( y = mx + c \), and tidy it into \( ax + by + c = 0 \) when asked. Parallel lines share a gradient; perpendicular gradients multiply to \( -1 \).
  • A circle with centre \( (a, b) \) and radius \( r \) is \( (x-a)^2 + (y-b)^2 = r^2 \). Complete the square to recover the centre from the expanded form. A tangent is perpendicular to the radius at the point of contact.
  • Exam point: to see how a line meets a circle, substitute the line into the circle and look at the discriminant of the quadratic: positive means two points, zero means a tangent, negative means no meeting.
Video lesson coming soonA short animated lesson for this step will appear here.

Distance, midpoint and gradient

Coordinate geometry turns pictures into arithmetic. Questions like “are these lines at right angles?” or “does this line touch the circle?” become short calculations. Almost all of it grows from two ideas: Pythagoras’ theorem and gradient.

Take two points \( A(x_1, y_1) \) and \( B(x_2, y_2) \). Draw a horizontal line from \( A \) and a vertical line from \( B \). They meet at a corner, and you have a right-angled triangle with sides \( x_2-x_1 \) across and \( y_2-y_1 \) up. Pythagoras gives the length of \( AB \). Averaging the coordinates gives the point halfway along. Reading the triangle as a ratio, up divided by across, gives the gradient.

\[ AB = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \]
\[ M = \left( \frac{x_1 + x_2}{2},\ \frac{y_1 + y_2}{2} \right) \qquad m = \frac{y_2-y_1}{x_2-x_1} \]
Key termGradient: for a non-vertical line, the change in \( y \) divided by the change in \( x \) between any two of its points. A vertical line, \( x = k \), has no gradient, because the change in \( x \) is zero.

A positive gradient climbs from left to right and a negative one falls. A horizontal line, \( y = k \), has gradient 0.

Worked example

\( A \) is \( (-1, 4) \) and \( B \) is \( (11, -1) \). Find the length of \( AB \), its midpoint and its gradient.

Step 1The changes are \( 11-(-1) = 12 \) across and \( -1-4 = -5 \) up.
Step 2Length: \( AB = \sqrt{12^2 + (-5)^2} = \sqrt{144 + 25} = \sqrt{169} = 13 \).
Step 3Midpoint: \( M = \left( \frac{-1 + 11}{2}, \frac{4 + (-1)}{2} \right) = (5,\ 1.5) \).
Step 4Gradient: \( m = \dfrac{-5}{12} = -\dfrac{5}{12} \). The line falls 5 units for every 12 across.

Squaring removes the minus sign in the distance, so the order of subtraction does not matter there. In the gradient it matters a great deal, as the next box shows.

Common mistakeMixing the order of subtraction in the gradient. Through \( (2, 7) \) and \( (5, 1) \) the gradient is \( \frac{1-7}{5-2} = -2 \). Writing \( \frac{1-7}{2-5} = 2 \) takes the \( y \)s one way and the \( x \)s the other, and gets the sign wrong. Whichever point you start with on top, start with it on the bottom too.

The equation of a straight line

An equation of a line is a test. A point lies on the line exactly when its coordinates make the equation true. There are three standard ways to write it, and each suits a different job.

FormWhat it showsBest for
\( y = mx + c \)gradient \( m \), \( y \)-intercept \( (0, c) \)reading a line and sketching it
\( y-y_1 = m(x-x_1) \)gradient \( m \), passes through \( (x_1, y_1) \)finding a line from a point and a gradient
\( ax + by + c = 0 \)the general formthe form Cambridge often asks for, with whole numbers

Where does the middle form come from? Fix a point \( (x_1, y_1) \) on a line of gradient \( m \) and let \( (x, y) \) be any other point on it. The gradient between them must be \( m \), so \( \frac{y-y_1}{x-x_1} = m \). Multiply up and you have \( y-y_1 = m(x-x_1) \). Put \( (x_1, y_1) = (0, c) \) and it becomes \( y = mx + c \). All three forms say the same thing.

Worked example

Find the equation of the line through \( (-2, 7) \) and \( (4, -2) \). Give it in the form \( ax + by + c = 0 \), where \( a \), \( b \) and \( c \) are integers.

Step 1Gradient: \( m = \dfrac{-2-7}{4-(-2)} = \dfrac{-9}{6} = -\dfrac{3}{2} \).
Step 2Use the point \( (-2, 7) \): \( y-7 = -\frac{3}{2}(x + 2) \).
Step 3Multiply by 2 to clear the fraction: \( 2y-14 = -3x-6 \), so \( 3x + 2y-8 = 0 \).
Step 4Check with the other point: \( 3(4) + 2(-2)-8 = 12-4-8 = 0 \).

Checking with the point you did not use takes ten seconds and catches almost every sign slip.

Exam tipWhen Cambridge 9709 asks for “the form \( ax + by + c = 0 \)”, it wants integer coefficients, so multiply out any fractions. In AP Calculus the same form appears at the end of every tangent-line question: you find \( m \) from the derivative and write \( y-y_1 = m(x-x_1) \), which is accepted without simplifying.

An economics example: the budget line. Sam has \$60 a week to spend on coffees (\( x \), at \$3 each) and lunches (\( y \), at \$5 each). Spending all of it means \( 3x + 5y = 60 \). That is a straight line in general form. Its intercepts are 20 coffees and 12 lunches, and rearranging to \( y = 12-\frac{3}{5}x \) gives the gradient \( -\frac{3}{5} \). The gradient is minus the price ratio: each extra coffee costs \$3, which is three-fifths of a lunch. If coffee falls to \$2, the line becomes \( 2x + 5y = 60 \). The lunch intercept stays at 12, because 12 lunches still cost \$60, but the coffee intercept moves out to 30. The line pivots (Figure 1). If instead income rises to \$75 at the old prices, the gradient is unchanged and the line shifts out parallel.

A budget line pivots when a price changes and shifts when income changes
3x + 5y = 602x + 5y = 60 (coffee falls to $2)3x + 5y = 75 (income rises to $75)
510152025303536912150x (coffees)y (lunches)(0, 12)(20, 0)(30, 0)
Figure 1. The budget line 3x + 5y = 60 has gradient −3/5. A cheaper coffee swings it outwards about (0, 12); more income moves it out parallel to itself.

Parallel and perpendicular lines

Parallel lines climb at the same rate, so non-vertical parallel lines have equal gradients. The lines \( y = 4x-1 \) and \( y = 4x + 9 \) are parallel; only the intercepts differ. Perpendicular lines need a little more thought.

\[ \text{parallel: } m_1 = m_2 \qquad \text{perpendicular: } m_1 m_2 = -1 \]

Why the negative reciprocal? A line of gradient \( m \) goes “1 across, \( m \) up”. Turn that little triangle through a right angle anticlockwise. “1 across” becomes “1 up”, and “\( m \) up” becomes “\( m \) to the left”. The new line rises 1 for every \( -m \) across, so its gradient is \( \frac{1}{-m} = -\frac{1}{m} \). That is why \( m_1 m_2 = -1 \), or equivalently \( m_2 = -\frac{1}{m_1} \). The rule fails only when \( m = 0 \): a horizontal line turns into a vertical one, which has no gradient.

Key termPerpendicular bisector: the line through the midpoint of a segment \( AB \) at right angles to it. Every point on it is the same distance from \( A \) as from \( B \).
Worked example

Find the perpendicular bisector of \( P(-1, -2) \) and \( Q(5, 6) \), in the form \( ax + by + c = 0 \).

Step 1Midpoint: \( \left( \frac{-1 + 5}{2}, \frac{-2 + 6}{2} \right) = (2, 2) \).
Step 2Gradient of \( PQ \): \( \frac{6-(-2)}{5-(-1)} = \frac{8}{6} = \frac{4}{3} \), so the perpendicular gradient is \( -\frac{3}{4} \).
Step 3Line: \( y-2 = -\frac{3}{4}(x-2) \). Multiply by 4: \( 4y-8 = -3x + 6 \), so \( 3x + 4y-14 = 0 \).

Check that \( (2, 2) \) fits: \( 6 + 8-14 = 0 \). Perpendicular bisectors matter later, because the centre of a circle lies on the perpendicular bisector of every chord.

Two lines meet where both equations are true at once, so you solve them simultaneously, as in Step 2. A favourite exam question combines this with a perpendicular: drop a perpendicular from a point to a line, find where it lands, and measure the distance.

Worked example

The line \( l \) has equation \( y = 2x + 1 \), and \( R \) is the point \( (8, 2) \). Find the foot \( F \) of the perpendicular from \( R \) to \( l \), and the shortest distance from \( R \) to \( l \).

Step 1The perpendicular has gradient \( -\frac{1}{2} \) and passes through \( R \): \( y-2 = -\frac{1}{2}(x-8) \), so \( y = -\frac{1}{2}x + 6 \).
Step 2Where it meets \( l \): \( 2x + 1 = -\frac{1}{2}x + 6 \), so \( \frac{5}{2}x = 5 \) and \( x = 2 \). Then \( y = 5 \), so \( F = (2, 5) \).
Step 3Distance: \( RF = \sqrt{(8-2)^2 + (2-5)^2} = \sqrt{36 + 9} = \sqrt{45} = 3\sqrt{5} \).

Any other point \( X \) on \( l \) makes a right-angled triangle \( RFX \) with hypotenuse \( RX \), so \( RX \) is longer than \( RF \). The shortest distance to a line is always along the perpendicular (Figure 2).

The shortest distance from a point to a line
l: y = 2x + 1perpendicular: y = −½x + 6
−11234567891012345670xyF(2, 5)R(8, 2)RF = √45 = 3√5
Figure 2. The perpendicular from R(8, 2) meets l at F(2, 5). Its gradient, −½, is the negative reciprocal of 2, and RF = 3√5 is the shortest distance from R to the line.
Common mistakeDoing only half of “negative reciprocal”. The perpendicular to a line of gradient \( \frac{2}{5} \) has gradient \( -\frac{5}{2} \): not \( -\frac{2}{5} \) (sign changed only) and not \( \frac{5}{2} \) (flipped only). Check by multiplying: \( \frac{2}{5} \times \left(-\frac{5}{2}\right) = -1 \).

The equation of a circle

A circle is every point at the same distance \( r \) from a centre \( (a, b) \). Write that sentence with the distance formula, \( \sqrt{(x-a)^2 + (y-b)^2} = r \), and square both sides. That is the equation.

\[ (x-a)^2 + (y-b)^2 = r^2 \]

The minus signs are there because the formula measures distance from the centre. So a centre at \( (-4, 3) \) shows up as \( (x + 4)^2 + (y-3)^2 \). A circle centred at the origin is simply \( x^2 + y^2 = r^2 \).

Key termCircle: the set of all points at a fixed distance \( r > 0 \), the radius, from a fixed point, the centre.

If you expand the brackets, the centre and radius disappear from view. For example, \( (x + 4)^2 + (y-3)^2 = 36 \) expands to \( x^2 + y^2 + 8x-6y-11 = 0 \). To get them back, complete the square in \( x \) and in \( y \) separately, exactly as in Step 2.

Worked example

Find the centre and radius of the circle \( x^2 + y^2 + 8x-6y-11 = 0 \).

Step 1Group the terms: \( (x^2 + 8x) + (y^2-6y) = 11 \).
Step 2Complete each square: \( (x + 4)^2-16 + (y-3)^2-9 = 11 \).
Step 3Tidy: \( (x + 4)^2 + (y-3)^2 = 36 \).
Step 4Centre \( (-4, 3) \); radius \( \sqrt{36} = 6 \).

An equation like this is only a circle if the number on the right comes out positive. If completing the square gives \( (x-1)^2 + (y + 2)^2 = -3 \), there is no circle at all, because a sum of squares cannot be negative.

In general, \( x^2 + y^2 + 2gx + 2fy + c = 0 \) has centre \( (-g, -f) \) and radius \( \sqrt{g^2 + f^2-c} \), provided \( g^2 + f^2-c > 0 \). This is just completing the square done once and for all. To decide whether a point is inside, on or outside a circle, substitute it into \( (x-a)^2 + (y-b)^2 \) and compare the result with \( r^2 \).

Common mistakeTwo slips cost the most marks. The first is the sign of the centre: \( (x-5)^2 + (y + 1)^2 = 9 \) has centre \( (5, -1) \), not \( (-5, 1) \). The second is radius against radius squared: the right-hand side is \( r^2 \), so the radius here is 3, not 9.

Tangents, chords and the discriminant

A tangent to a circle touches it at exactly one point, and it is perpendicular to the radius drawn to that point. Here is why. Every other point of the tangent lies outside the circle, so it is further than \( r \) from the centre. That makes the point of contact the closest point of the tangent to the centre, and the closest point of a line is always at the foot of a perpendicular. So the method is: find the gradient of the radius, take the negative reciprocal, and use \( y-y_1 = m(x-x_1) \).

Worked example

Show that \( P(-1, 5) \) lies on the circle \( (x-2)^2 + (y-1)^2 = 25 \), and find the tangent at \( P \) in the form \( ax + by + c = 0 \).

Step 1On the circle: \( (-1-2)^2 + (5-1)^2 = 9 + 16 = 25 \).
Step 2The centre is \( C(2, 1) \). Radius gradient: \( \dfrac{5-1}{-1-2} = -\dfrac{4}{3} \), so the tangent gradient is \( \dfrac{3}{4} \).
Step 3Tangent: \( y-5 = \frac{3}{4}(x + 1) \). Multiply by 4: \( 4y-20 = 3x + 3 \), so \( 3x-4y + 23 = 0 \).

Figure 3 shows the radius and the tangent meeting at a right angle.

To find where any line meets a circle, substitute the line into the circle. You get a quadratic in one variable, and its discriminant \( b^2-4ac \) counts the meeting points, just as in Step 2.

DiscriminantMeeting pointsThe line is
\( b^2-4ac > 0 \)twoa chord line, cutting the circle
\( b^2-4ac = 0 \)onea tangent
\( b^2-4ac < 0 \)nonemissing the circle

For example, put \( y = 8-x \) into \( (x-2)^2 + (y-1)^2 = 25 \). Then \( (x-2)^2 + (7-x)^2 = 25 \), which simplifies to \( x^2-9x + 14 = 0 \), so \( (x-2)(x-7) = 0 \). The line cuts the circle at \( (2, 6) \) and \( (7, 1) \), and the chord has length \( \sqrt{5^2 + 5^2} = 5\sqrt{2} \).

Tangent at a point, and a chord
(x − 2)² + (y − 1)² = 25tangent 3x − 4y + 23 = 0line x + y = 8
−6−4−2246810−4−224680xyC(2, 1)P(−1, 5)(2, 6)(7, 1)r = 5
Figure 3. The radius CP has gradient −4/3, so the tangent at P has gradient 3/4. The line x + y = 8 cuts the circle twice, at (2, 6) and (7, 1), forming a chord.
Worked example

Find the values of \( k \) for which the line \( y = 2x + k \) is a tangent to the circle \( x^2 + y^2 = 20 \). For the positive value, find the point of contact.

Step 1Substitute: \( x^2 + (2x + k)^2 = 20 \), so \( 5x^2 + 4kx + k^2-20 = 0 \).
Step 2For a tangent, \( b^2-4ac = 0 \): \( 16k^2-20(k^2-20) = 0 \), which gives \( 400-4k^2 = 0 \).
Step 3So \( k^2 = 100 \) and \( k = \pm 10 \).
Step 4For \( k = 10 \): \( 5x^2 + 40x + 80 = 0 \), that is \( 5(x + 4)^2 = 0 \), so \( x = -4 \) and \( y = 2(-4) + 10 = 2 \). The point of contact is \( (-4, 2) \).

Check: \( (-4)^2 + 2^2 = 20 \). For \( -10 < k < 10 \) the line cuts the circle twice, and for \( |k| > 10 \) it misses.

Exam tip“Show that the line is a tangent” wants you to substitute, reach a quadratic and show that \( b^2-4ac = 0 \), or that the quadratic is a perfect square. Circles are Cambridge 9709 Paper 1 content. They are not on the AP Calculus course or IB SL, so AP and IB students can treat the circle sections as extension; the line work is needed by everyone.

Practise: 6 questions

Try each one on paper first, then check the worked answer.

EasyQ1. For \( A(-3, -2) \) and \( B(3, 6) \), find the length of \( AB \), its midpoint and its gradient. Show worked answer
Changes: 6 across and 8 up.
Length: \( \sqrt{6^2 + 8^2} = \sqrt{100} = 10 \).
Midpoint: \( \left( \frac{-3 + 3}{2}, \frac{-2 + 6}{2} \right) = (0, 2) \).
Gradient: \( \frac{8}{6} = \frac{4}{3} \).
EasyQ2. State the centre and radius of \( (x-5)^2 + (y + 3)^2 = 49 \). Does the point \( (5, 4) \) lie on the circle? Show worked answer
Centre \( (5, -3) \), radius \( \sqrt{49} = 7 \).
At \( (5, 4) \): \( (5-5)^2 + (4 + 3)^2 = 0 + 49 = 49 \), so yes, it lies on the circle. It is the top of the circle, 7 units directly above the centre.
MediumQ3. Find the equation of the line through \( (3, -1) \) perpendicular to \( 2x-5y = 4 \). Give your answer in the form \( ax + by + c = 0 \). Show worked answer
Rearrange: \( y = \frac{2}{5}x-\frac{4}{5} \), so the gradient is \( \frac{2}{5} \).
Perpendicular gradient: \( -\frac{5}{2} \).
\( y + 1 = -\frac{5}{2}(x-3) \). Multiply by 2: \( 2y + 2 = -5x + 15 \).
So \( 5x + 2y-13 = 0 \). Check: \( 15-2-13 = 0 \).
MediumQ4. Find the centre and radius of the circle \( x^2 + y^2 + 6x-8y = 0 \), and show that it passes through the origin. Show worked answer
Complete the squares: \( (x + 3)^2-9 + (y-4)^2-16 = 0 \).
So \( (x + 3)^2 + (y-4)^2 = 25 \): centre \( (-3, 4) \), radius 5.
Origin: \( 0 + 0 + 0-0 = 0 \), so \( (0, 0) \) satisfies the equation. (Equivalently, the distance from \( (-3, 4) \) to the origin is \( \sqrt{9 + 16} = 5 \), the radius.)
MediumQ5. Find the coordinates of the points where the line \( y = x-1 \) meets the circle \( x^2 + y^2 = 13 \). Show worked answer
Substitute: \( x^2 + (x-1)^2 = 13 \), so \( 2x^2-2x + 1 = 13 \).
\( 2x^2-2x-12 = 0 \), that is \( x^2-x-6 = 0 \), so \( (x-3)(x + 2) = 0 \).
\( x = 3 \) gives \( y = 2 \); \( x = -2 \) gives \( y = -3 \).
The points are \( (3, 2) \) and \( (-2, -3) \).
ExamQ6. The points \( A(-1, 3) \) and \( B(5, -5) \) are the ends of a diameter of a circle. (a) Find the equation of the circle. [3] (b) Show that \( P(5, 3) \) lies on the circle. [1] (c) Find the equation of the tangent at \( P \), in the form \( ax + by + c = 0 \). [3] (d) The tangent meets the \( x \)-axis at \( T \). Find \( T \) and the length \( PT \). [2] Show worked answer
(a) Centre = midpoint of \( AB \) = \( (2, -1) \) [B1]. \( AB = \sqrt{6^2 + 8^2} = 10 \), so \( r = 5 \) [M1]. Circle: \( (x-2)^2 + (y + 1)^2 = 25 \) [A1].
(b) \( (5-2)^2 + (3 + 1)^2 = 9 + 16 = 25 \) [B1].
(c) Radius gradient \( \frac{3-(-1)}{5-2} = \frac{4}{3} \), so tangent gradient \( -\frac{3}{4} \) [B1]. \( y-3 = -\frac{3}{4}(x-5) \) [M1], so \( 4y-12 = -3x + 15 \) and \( 3x + 4y-27 = 0 \) [A1].
(d) Put \( y = 0 \): \( 3x = 27 \), so \( T = (9, 0) \) [B1]. \( PT = \sqrt{(9-5)^2 + (0-3)^2} = \sqrt{25} = 5 \) [B1].
Total: 9 marks.

Check yourself

1. A line has gradient \( -\frac{2}{5} \). What is the gradient of a line perpendicular to it?

Flip and change the sign: the negative reciprocal of \( -\frac{2}{5} \) is \( \frac{5}{2} \). Check: \( -\frac{2}{5} \times \frac{5}{2} = -1 \).

2. What are the centre and radius of \( (x + 1)^2 + (y-6)^2 = 16 \)?

The brackets are \( (x-(-1)) \) and \( (y-6) \), so the centre is \( (-1, 6) \). The right-hand side is \( r^2 = 16 \), so \( r = 4 \).

3. Substituting a line into a circle gives a quadratic with discriminant \( -12 \). What does this tell you?

A negative discriminant means the quadratic has no real roots, so there are no meeting points.

Your score: 0 out of 3

The short version

  • Distance is Pythagoras, \( \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \); the midpoint averages the coordinates; the gradient is rise over run.
  • Find a line with \( y-y_1 = m(x-x_1) \), read it with \( y = mx + c \), and give \( ax + by + c = 0 \) with whole numbers when asked.
  • Parallel lines have equal gradients and perpendicular gradients multiply to \( -1 \). The shortest distance from a point to a line runs along the perpendicular.
  • A circle is \( (x-a)^2 + (y-b)^2 = r^2 \). Complete the square to find its centre and radius, and remember the tangent is perpendicular to the radius.
  • For a line and a circle, substitute and use the discriminant: two points, one point (a tangent) or none.
  • The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 5 of 33Exponentials and Logarithms