Gradient, length and midpoint

IGCSE Mathematics · Coordinate geometry

The three formulae

For two points $A(x_{1},y_{1})$ and $B(x_{2},y_{2})$:

$$m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}},\qquad AB=\sqrt{(x_{2}-x_{1})^{2}+(y_{2}-y_{1})^{2}},\qquad M=\left(\frac{x_{1}+x_{2}}{2},\;\frac{y_{1}+y_{2}}{2}\right)$$

Gradient is change in $y$ over change in $x$ — the $y$ values on top. Length comes straight from Pythagoras: the two differences are the legs of a right-angled triangle and $AB$ is its hypotenuse. Midpoint is the average of each coordinate separately.

Reading a gradient

Order does not matter — as long as it is consistent

Taking $A$ first or $B$ first changes the sign of both the numerator and the denominator, so the gradient is unchanged. Taking $A$ first on top and $B$ first underneath, however, flips the sign — and that is the single most common slip in this topic.

A(1, −3) B(7, 5) Δx = 6 Δy = 8 AB = √(6² + 8²) = 10 m = 8 ÷ 6 = 4/3 One diagram, three formulas
The same right-angled triangle gives both the gradient and the length: the gradient is the ratio of the two legs, the length is the hypotenuse. Draw this triangle on scrap paper and you will never swap the numerator and denominator.

Worked example: gradient and length from two points

Given $A(-3,7)$ and $B(5,-1)$. Calculate the gradient of $AB$, the length $AB$ and the coordinates of the midpoint of $AB$.

Solution

Gradient. Take $B$ as the second point and keep that same order in both numerator and denominator:

$$m=\frac{-1-7}{5-(-3)}=\frac{-8}{8}=-1$$

The negative sign makes sense: $y$ decreases from $7$ to $-1$ while $x$ increases.

Length.

$$AB=\sqrt{8^{2}+(-8)^{2}}=\sqrt{64+64}=\sqrt{128}=8\sqrt{2}\approx 11.3$$

In the length formula, the signs of the two differences do not matter because they are squared — this is why the order of the two points never causes an error in the length part, only in the gradient part.

Midpoint.

$$M=\left(\frac{-3+5}{2},\;\frac{7+(-1)}{2}\right)=(1,\;3)$$

Quick check: $M$ must lie between the two points in both coordinates — $1$ lies between $-3$ and $5$, $3$ lies between $-1$ and $7$ ✓.

Worked example: dividing a line segment in a ratio

$A(2,1)$ and $B(6,9)$. The point $P$ lies on $AB$ such that $AP:PB=1:3$. Find the coordinates of $P$.

Solution

Step 1 — understand what the ratio says. $AP:PB=1:3$ means the segment $AB$ is divided into $1+3=4$ equal parts, and $P$ is one quarter of the way from $A$.

Step 2 — start from $A$, add one quarter of each change.

$$\Delta x=6-2=4,\qquad \Delta y=9-1=8$$$$P=\left(2+\tfrac{1}{4}(4),\;1+\tfrac{1}{4}(8)\right)=(3,\;3)$$

Step 3 — check. $AP=\sqrt{1^{2}+2^{2}}=\sqrt{5}$ and $PB=\sqrt{3^{2}+6^{2}}=\sqrt{45}=3\sqrt{5}$, exactly the ratio $1:3$ ✓.

A common place to go wrong: using $\dfrac{1}{3}$ instead of $\dfrac{1}{4}$, because the number $3$ in the ratio jumps out at the eye. Remember that the denominator is always the sum of the two parts, not the second part.

Common mistake

Swapping numerator and denominator when finding the gradient, or mixing up the order of the two points between numerator and denominator. With $A(-3,7)$ and $B(5,-1)$, writing $\dfrac{5-(-3)}{-1-7}=\dfrac{8}{-8}=-1$ happens to give the right answer anyway because the two values are equal — and that is the most dangerous thing: the candidate goes on with a wrong formula that has been "confirmed". In the next question, with $A(1,2)$ and $B(5,4)$, that way of writing gives $\dfrac{4}{2}=2$ instead of $\dfrac{2}{4}=0.5$ — four times too big, with nothing to warn you. Block it with a diagram: draw the right-angled triangle on scrap paper, vertical side divided by horizontal side. Once it is drawn, the hand can no longer swap them.

Key takeaway

The three formulas in this lesson can all be read from one right-angled triangle: the ratio of the two legs is the gradient, the hypotenuse is the length, and the midpoint is the mean of each coordinate. Learn one diagram instead of three formulas and you will never mix them up — even under stress in the exam room.

← Sequences, inequalities and functions · All IGCSE Mathematics lessons · Practice IGCSE Mathematics questions (free, instant scoring) · The equation of a straight line →