Straight lines live in the coordinate plane. This part sets up that plane and gives the first tool for working in it: the distance between two points.
1.1The Cartesian coordinate system
Definition: Cartesian coordinate system
A Cartesian coordinate system fixes every point of a plane by numbers. The coordinates are the signed distances from the point to two perpendicular reference lines, measured in the same unit. Each reference line is an axis, and the point where they meet is the origin, (0,0).
The horizontal axis is the X-axis; the first coordinate of a point is its abscissa.
The vertical axis is the Y-axis; the second coordinate is its ordinate.
The axes split the plane into four quadrants, numbered anticlockwise from the top right.
Figure 1. The plane, its four quadrants and one example point in each
1.2Which quadrant?
Look only at the signs of the two coordinates.
Point
Signs of (x, y)
Quadrant
(3,2)
+, +
I
(−4,2)
−, +
II
(−4,−2)
−, −
III
(3,−2)
+, −
IV
(0,3)
x is 0
on the Y-axis, in no quadrant
Extra. A point with a zero coordinate lies on an axis, and axes belong to no quadrant.
1.3The distance between two points
Distance formula
The distance between (x1,y1) and (x2,y2) is
d=(x2−x1)2+(y2−y1)2
It is the hypotenuse of a right triangle whose legs are the horizontal gap x2−x1 and the vertical gap y2−y1.
Figure 2. The distance between (2, 4) and (−4, 12) is the hypotenuse of a 6, 8, 10 triangle
Why the formula works
Draw the horizontal leg from the first point and the vertical leg from the second; they meet at a right angle.
The legs have lengths ∣x2−x1∣ and ∣y2−y1∣.
Pythagoras: d2=(x2−x1)2+(y2−y1)2. Take the square root.
Remember
The gaps are squared, so it does not matter which point is called 1 and which 2, and negative gaps are harmless.
1.4Going deeper
Distance is symmetric and non-negative. It is 0 only when the two points are the same point.
All points at distance r from a point form a circle of radius r (as in Example 2).
Classifying triangles (extra). Find the three side lengths. For (0,0),(6,0),(0,8) they are 6, 8 and 10, and 62+82=102, so it is a right triangle with perimeter 24.
Unknown coordinate means two answers. Squaring a distance equation gives ±, so always check both roots.
1.5Exam tips and common mistakes
Exam tips
Write the formula first, then substitute with brackets around negative numbers.
For an unknown coordinate set up the squared equation and solve for both signs.
For quadrants look at the signs only.
Common mistakes
Forgetting the square root, and giving 100 instead of 10.
Losing the second answer when solving (4−y)2=9.
Writing (x2−x1)+(y2−y1) inside the root instead of the sum of squares.
Practice questions (graded-assignment style)
Q1Distance
Multiple Choice Question (MCQ): choose the one correct option.
What is the distance between (−1,3) and (5,−5)?
1
6
2
8
3
10
4
14
Solution
Idea
Find the two gaps, square and add.
Gaps: 5−(−1)=6 and −5−3=−8.
d=36+64=100=10.
Answer: option 3.
Q2Unknown coordinate
Numerical Answer Type (NAT).
The distance between (k,2) and (−1,6) is 5. Find the sum of all possible values of k.
Solution
Idea
Square the distance equation and keep both roots.
(k+1)2+(2−6)2=25, so (k+1)2=9 and k+1=±3.
k=2 or k=−4. Sum: 2+(−4)=−2.
Answer: -2
Q3Quadrants
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
1
(−3,4) lies in quadrant II.
2
(5,−2) lies in quadrant IV.
3
(−1,−1) lies in quadrant II.
4
(0,3) lies in quadrant I.
Solution
Idea
Read the signs: I (+,+), II (−,+), III (−,−), IV (+,−).
Option 1: signs (−, +), quadrant II. ✓
Option 2: signs (+, −), quadrant IV. ✓
Option 3: signs (−, −) is quadrant III, not II.
Option 4: x=0, so the point is on the Y-axis, in no quadrant.
Answer: options 1 and 2.
Q4Perimeter of a triangle
Numerical Answer Type (NAT).
Find the perimeter of the triangle with vertices (0,0), (6,0) and (0,8).
Solution
Idea
Find all three side lengths.
(6−0)2+02=6 and 02+(8−0)2=8.
(0−6)2+(8−0)2=36+64=10.
Perimeter: 6+8+10=24.
Answer: 24
Revision overview
CoordinatesTwo perpendicular axes Origin is (0, 0) Signed distances
Two more tools for points: the section formula finds a point that divides a segment in a given ratio, and the area formula measures the triangle formed by three points.
2.1The section formula
Let A(x1,y1) and B(x2,y2) be the ends of a segment and let P(x,y) divide it in the ratio m:n, meaning PA:PB=m:n.
Internal section
P lies betweenA and B.
x=m+nmx2+nx1,y=m+nmy2+ny1
External section
P lies outside the segment, on its extension (needs m=n).
x=m−nmx2−nx1,y=m−nmy2−ny1
Figure 3. Internal and external division of the segment AB in the ratio m : n
Midpoint
The midpoint divides the segment in the ratio 1:1. Putting m=n=1 in the internal formula:
(2x1+x2,2y1+y2)
2.2Reading the formulas
Weights. In m:n the number m goes with the far end B and n with A: x=m+nmx2+nx1. A larger m pulls P towards B.
External needs m=n, because m−n is in the denominator. Check: A(0,0), B(2,0), ratio 3:1 gives x=3−13(2)−1(0)=3, and indeed PA=3, PB=1.
Centroid (extra). The average of the three vertices, (3x1+x2+x3,3y1+y2+y3), is the centre of mass of a triangle; the midpoint is the two-point version of the same averaging.
2.3Area of a triangle
Area formula
The area Δ of the triangle with vertices (x1,y1), (x2,y2), (x3,y3) is
Δ=21∣x1(y2−y3)+x2(y3−y1)+x3(y1−y2)∣
The modulus is used because an area is never negative.
Collinear points
If the area of the triangle formed by three points is zero, the three points are collinear (lie on one line).
2.4Worked examples: area and collinearity
Figure 4. The midpoint triangle of PQR has area 1.5
2.5Exam tips and common mistakes
Exam tips
Say which point is A and which is B before using the ratio m:n; the ratio is read from A.
Test a section answer by computing PA and PB with the distance formula.
For collinear questions set the area to 0 and solve for the unknown.
Common mistakes
Swapping m and n: the answer then divides in n:m.
Using the internal formula with m−n (or the external with m+n).
Forgetting the 21 or the modulus in the area formula.
Practice questions (graded-assignment style)
Q1A dividing point
Numerical Answer Type (NAT).
The point P(x,y) divides the segment from (1,2) to (7,11) internally in the ratio 1:2. Find x+y.
Solution
Idea
Use the internal formula with m=1, n=2.
x=31(7)+2(1)=3.
y=31(11)+2(2)=5.
x+y=3+5=8.
Answer: 8
Q2Midpoint
Numerical Answer Type (NAT).
Find the sum of the coordinates of the midpoint of (−4,6) and (10,−2).
Solution
Idea
Average each coordinate.
Midpoint: (2−4+10,26−2)=(3,2).
3+2=5.
Answer: 5
Q3Area of a triangle
Numerical Answer Type (NAT).
Find the area of the triangle with vertices (1,1), (5,1) and (3,5).
Solution
Idea
Use the area formula; check with base × height.
Δ=21∣1(1−5)+5(5−1)+3(1−1)∣=21∣−4+20+0∣=8.
Check: the base from (1,1) to (5,1) is 4 and the height is 4, so 21⋅4⋅4=8.
Answer: 8
Q4Collinear points
Numerical Answer Type (NAT).
The points (1,2), (2,4) and (3,k) lie on one line. Find k.
Solution
Idea
Collinear means the area is zero.
21∣1(4−k)+2(k−2)+3(2−4)∣=21∣k−6∣.
Set it to 0: k=6. (The points have slope 2 each step, so the next point is (3,6).)
Answer: 6
Q5An external point
Numerical Answer Type (NAT).
The point P divides the segment from A(1,1) to B(3,5)externally in the ratio 3:2. Find the sum of the coordinates of P.
Solution
Idea
Use the external formula with m=3, n=2.
x=3−23(3)−2(1)=7 and y=3−23(5)−2(1)=13.
Check: PA=180, PB=80, and 180/80=1.5=3:2.
x+y=7+13=20.
Answer: 20
Revision overview
Internal section(mx₂ + nx₁) / (m + n) (my₂ + ny₁) / (m + n) P between A and B
External section(mx₂ − nx₁) / (m − n) (my₂ − ny₁) / (m − n) P outside, m ≠ n
MidpointRatio 1 : 1 Average of the coordinates
PointsWeek 2 · Sections 2.3, 2.4
Area of a triangle½ |x₁(y₂−y₃) + x₂(y₃−y₁) + x₃(y₁−y₂)|
ModulusArea is always positive
CollinearArea 0 means the three points lie on one line
Revision: the section formula, midpoint and triangle area on one page
The slope of a line is the single number that tells you how it leans. Parallel and perpendicular lines are recognised from their slopes alone.
3.1Slope of a straight line
Definition: slope
The slopem of a line describes both its direction and its steepness:
m=ΔxΔy=x2−x1y2−y1=tanθ
where (x1,y1) and (x2,y2) are two points on the line and θ is its inclination: the angle from the positive X-axis to the line.
Figure 5. Slope is the vertical change divided by the horizontal change between two points
3.2What the slope tells you
Slope
What the formula shows
The line
m>0
Δy and Δx have the same sign
rises from left to right
m<0
they have opposite signs
falls from left to right
m=0
Δy=0, so tanθ=0
horizontal
no slope
Δx=0: the fraction is undefined
vertical
The slope rules (parallel, perpendicular) are for non-vertical lines. A vertical line has no slope.
Example 7Slope through the origin
What is the slope of the line through the origin and the point (−3,5)?
Solution
Take (x1,y1)=(0,0) and (x2,y2)=(−3,5): m=−3−05−0=−35 The slope is negative, so the line falls from left to right.
Figure 6. The line through the origin and (−3, 5)
3.3Parallel and perpendicular lines
Let l1 and l2 be non-vertical lines with slopes m1, m2.
Parallel
l1∥l2 if and only if the slopes are equal: m1=m2.
Perpendicular
l1⊥l2 if and only if m1m2=−1.
Figure 7. Parallel lines lean the same way; perpendicular lines have slopes that multiply to −1
Remember
If m1m2=−1 then m2=−m11: the perpendicular slope is the negative reciprocal. A line of slope 2 is perpendicular to a line of slope −21.
3.4Going deeper
Slope is a rate of change. A slope of 3 means y goes up by 3 for every 1 step in x. This is exactly the idea behind a fitted line in Part 7.
Use the same point first. In x2−x1y2−y1 both the top and the bottom must start from the same point. Swapping both gives the same answer, swapping only one flips the sign.
Equal slopes: parallel or the same line. To separate the two cases check whether one point of the first line lies on the second.
Collinearity by slope. Three points are collinear exactly when the slope from the first to the second equals the slope from the second to the third.
3.5Exam tips and common mistakes
Exam tips
For perpendicular, flip the fraction and change the sign: slope 43 becomes −34.
Check any slope answer by plugging both points back into ΔxΔy.
Common mistakes
Mixing up the order: x1−x2y2−y1.
Using the slope rules for a vertical line, which has no slope.
Thinking perpendicular means m1=−m2. It means m1m2=−1.
Practice questions (graded-assignment style)
Q1A slope
Numerical Answer Type (NAT).
Find the slope of the line through (2,−3) and (6,5).
Solution
Idea
Rise over run.
m=6−25−(−3)=48=2.
Answer: 2
Q2Parallel condition
Numerical Answer Type (NAT).
The line through (1,1) and (3,k) is parallel to the line through (0,0) and (2,6). Find k.
Solution
Idea
Parallel lines have equal slopes.
Slope of the second line: 2−06−0=3.
3−1k−1=3 gives k−1=6, so k=7.
Answer: 7
Q3Perpendicular condition
Numerical Answer Type (NAT).
The line through (0,0) and (a,6) is perpendicular to a line of slope 23. Find a.
Solution
Idea
The product of slopes is −1.
Required slope: −32.
a6=−32 gives a=−9.
Check: −96=−32 and −32×23=−1.
Answer: -9
Q4Slope facts
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
1
The line through (1,2) and (3,6) rises from left to right.
2
Lines of slope 2 and −21 are perpendicular.
3
Lines of slope 2 and 3 are parallel.
4
A vertical line has slope 0.
Solution
Idea
Use the sign of the slope and the two rules.
Option 1: slope 2>0. ✓
Option 2: 2×(−21)=−1. ✓
Option 3: parallel needs equal slopes, and 2=3.
Option 4: a vertical line has no slope (the fraction is undefined); a horizontal line has slope 0.
A line is described by an equation: a relation between x and y that is true for exactly the points on the line. There are several standard forms, and each suits different given information.
4.1The three basic forms
A line is described by an equation: a relation between x and y that is true for exactly the points on the line. Each standard form suits different given information.
Slope-intercept
y=mx+c
m is the slope and c is the y-intercept.
Point-slope
y−y1=m(x−x1)
A line of slope m through (x1,y1).
Two-point
y−y1=x2−x1y2−y1(x−x1)
The line joining two points. It is the point-slope form with the slope m=x2−x1y2−y1 worked out from the two points.
4.2All the forms of a straight line
Form
Representation
Use it when you know
General
ax+by+c=0
a standard shape for any line
Slope-point
(y−y0)=m(x−x0)
slope and one point
Slope-intercept (y)
y=mx+c
slope and the y-intercept
Slope-intercept (x)
y=m(x−d)
slope and the x-intercept d
Intercept
ax+by=1
both intercepts a and b
Two-point
(y−y1)=x2−x1y2−y1(x−x1)
two points on the line
In the x-intercept form y=m(x−d), putting y=0 gives x=d, so d is the x-intercept. In the intercept form a and b are the x- and y-intercepts.
Figure 8. One line, 2x + 3y − 6 = 0, written in every form
4.3Choosing the form
What you know
Form to use
Slope and the y-intercept
y=mx+c
Slope and one point
(y−y1)=m(x−x1)
Two points
(y−y1)=x2−x1y2−y1(x−x1)
Slope and the x-intercept
y=m(x−d)
Both intercepts
ax+by=1
Any line, in a standard shape
ax+by+c=0
4.4Going deeper
Read the general form directly (extra). For ax+by+c=0 with b=0: slope =−ba, y-intercept =−bc, and (if a=0) x-intercept =−ac. For 2x+3y−6=0: −32, 2 and 3.
Horizontal and vertical lines (extra). A horizontal line is y=k (slope 0). A vertical line is x=h and has no slope, so it cannot be written as y=mx+c.
A point lies on a line exactly when its coordinates satisfy the equation. Substitute and see whether both sides agree.
The six forms describe the same line. Conversion is only algebra: expand, move terms, divide.
4.5Exam tips and common mistakes
Exam tips
Pick the form from what is given (Section 4.3), then convert only if the question asks for another form.
Always verify by substituting a given point into your final equation.
Common mistakes
Mixing x1 and y1 in point-slope form: it is y−y1 with m(x−x1).
Sign errors when moving terms to the other side.
Using the intercept form when an intercept is 0 (the line passes through the origin).
Practice questions (graded-assignment style)
Q1Slope and a point
Multiple Choice Question (MCQ): choose the one correct option.
Which is the line of slope −2 through the point (3,1)?
1
y=−2x+7
2
y=−2x+5
3
y=2x−5
4
y=−2x−7
Solution
Idea
Use the point-slope form and expand.
y−1=−2(x−3)=−2x+6, so y=−2x+7.
Check: at x=3, −2(3)+7=1. ✓
Answer: option 1.
Q2The y-intercept
Numerical Answer Type (NAT).
Find the y-intercept of the line through (2,3) and (4,7).
Solution
Idea
Slope first, then the equation.
m=4−27−3=2.
y−3=2(x−2), so y=2x−1.
The y-intercept is c=−1.
Answer: -1
Q3The x-intercept
Numerical Answer Type (NAT).
Find the x-intercept of the line 3x−2y+12=0.
Solution
Idea
Put y=0.
y=0 gives 3x+12=0, so x=−4.
Answer: -4
Q4Intercept form
Multiple Choice Question (MCQ): choose the one correct option.
A line has x-intercept 4 and y-intercept −2. Which is its intercept form?
1
4x+−2y=1
2
4x+2y=1
3
2x+4y=1
4
−4x+2y=1
Solution
Idea
The form is ax+by=1 with a=4, b=−2.
Option 1 puts a=4 and b=−2 in the right places.
Check: (4,0) gives 1+0=1 ✓ and (0,−2) gives 0+1=1 ✓.
Answer: option 1.
Q5Points on a line
Multiple Select Question (MSQ): select all that apply.
Which points lie on the line y=2x−1?
1
(1,1)
2
(2,3)
3
(0,1)
4
(−1,−3)
Solution
Idea
Substitute the coordinates.
(1,1): 2(1)−1=1. ✓
(2,3): 2(2)−1=3. ✓
(0,1): 2(0)−1=−1=1. ✗
(−1,−3): 2(−1)−1=−3. ✓
Answer: options 1, 2 and 4.
Revision overview
Slope-intercepty = mx + c m slope, c y-intercept y = m(x − d), d x-intercept
Point-slope(y − y₁) = m(x − x₁) Slope plus one point
Two-pointSlope from the two points Then use point-slope
Equations of a lineWeek 2 · Sections 2.5.2, 2.6
Intercept formx/a + y/b = 1 a and b are the intercepts
General formax + by + c = 0 Every form converts to it
CheckingSubstitute a known point into the final equation
Two lines that meet form angles at the point of intersection. Their slopes alone are enough to find those angles.
5.1The angle between two lines
Let l1 and l2 be lines with slopes m1, m2 and inclinations α1, α2, and assume α2>α1. If they intersect and form adjacent angles θ and φ, then:
Angle formulas
tanθ=1+m2m1m2−m1,tanφ=1+m1m2m1−m2
Figure 9. The lines l₁ and l₂, their inclinations and the angles θ and φ they form
5.2Reading the two formulas
The numerators are opposite, so tanφ=−tanθ. That fits two adjacent angles on a straight line, which add up to 180∘.
θ=α2−α1, so tanθ=tan(α2−α1): θ is the gap between the two inclinations.
The perpendicular case. If m1m2=−1, the denominator 1+m1m2 is zero, so the tangent is undefined: the angle is exactly 90∘. This agrees with the perpendicularity rule of Part 3.
5.3Going deeper
The acute angle (extra). Taking the modulus, tanθ=1+m1m2m2−m1 always gives the acute angle between the lines, so you do not have to worry which slope is larger.
Equal slopes.m1=m2 gives tanθ=0, angle 0∘: the lines are parallel.
Check with inclinations. For slopes 21 and 3: α1≈26.57∘, α2≈71.57∘, and 71.57−26.57=45.
5.4Exam tips and common mistakes
Exam tips
Compute 1+m1m2 first: if it is 0 the answer is 90∘ and you are done.
Give both θ and φ when the question asks for "the angles", and check that they add to 180∘.
Common mistakes
Writing 1−m1m2 in the denominator.
Putting m1−m2 in the numerator of tanθ (it is m2−m1 when α2>α1).
Forgetting the negative sign of tanφ and reporting 45∘ twice.
Practice questions (graded-assignment style)
Q1Slopes 0 and 1
Numerical Answer Type (NAT).
Find the angle θ (in degrees) between lines of slopes 0 and 1.
Solution
Idea
Use m1=0, m2=1.
tanθ=1+1⋅01−0=1, so θ=45∘.
Answer: 45
Q2Reciprocal of the tangent
Numerical Answer Type (NAT).
For lines of slopes 2 and 3 find tanθ1.
Solution
Idea
Compute tanθ first.
tanθ=1+3⋅23−2=71.
So tanθ1=7.
Answer: 7
Q3Which angle?
Multiple Choice Question (MCQ): choose the one correct option.
What is the angle between lines of slopes 3 and −31?
1
0∘
2
45∘
3
90∘
4
It cannot be found
Solution
Idea
Check 1+m1m2.
1+3⋅(−31)=1−1=0: the tangent is undefined.
So the lines are perpendicular and the angle is 90∘.
Answer: option 3.
Q4The adjacent angle
Numerical Answer Type (NAT).
For slopes 21 and 3 we found θ=45∘. Find φ in degrees.
Solution
Idea
Adjacent angles on a line add to 180∘.
φ=180∘−45∘=135∘.
Also tanφ=−tanθ=−1, which gives 135∘.
Answer: 135
Q5A non-standard angle
Numerical Answer Type (NAT).
Find the angle θ between lines of slopes 1 and 3, rounded to the nearest degree.
When a line is written in the general form ax + by + c = 0, its coefficients answer questions directly: are two lines parallel or perpendicular, how far is a point from the line, and how far apart are two parallel lines.
6.1Parallel and perpendicular lines in general form
Given two lines a1x+b1y+c1=0 and a2x+b2y+c2=0, with b1,b2=0:
Parallel
a1b2=a2b1
Same slope: −b1a1=−b2a2, cross-multiplied.
Perpendicular
a1a2=−b1b2
Slopes multiply to −1: b1b2a1a2=−1, cross-multiplied.
Where the conditions come from. Solving ax+by+c=0 for y gives y=−bax−bc, so the slope is −ba (this needs b=0). Equal slopes give a1b2=a2b1; slopes with product −1 give a1a2=−b1b2.
6.2Distance of a point from a line
Point-to-line distance
The distance d of the line ax+by+c=0 from the point (x1,y1) is
d=a2+b2∣ax1+by1+c∣
Put the point into the left side of the equation, take the modulus, and divide by a2+b2.
The result is the shortest (perpendicular) distance, so it is never negative.
If the numerator is 0, the point lies on the line.
6.3Distance between two parallel lines
Parallel-line distance
The distance D between the parallel lines ax+by+c1=0 and ax+by+c2=0 is
D=a2+b2∣c1−c2∣
Remember
Both equations must have the same a and b. If not, multiply or divide one equation so that they match (as in Example 21).
Figure 10. The point-to-line distance and the distance between two parallel lines
6.4Going deeper
The vector (a,b) is perpendicular to the line (extra). That is why the perpendicular distance has a2+b2 underneath: it is the length of (a,b). It also explains the perpendicularity test: two lines are perpendicular when their (a,b) vectors are, a1a2+b1b2=0.
Special cases. The distance of (x1,y1) from the X-axis (y=0) is ∣y1∣, and from the Y-axis (x=0) it is ∣x1∣.
Parallel distance is a point distance. Pick any point on one line and use the point formula on the other (Example 21 does this as a check).
Equal c after matching a,b means the two lines are the same line, with distance 0.
6.5Perpendicular bisector, foot and reflection, and lines through an intersection point
A. Perpendicular bisector of a segment
The perpendicular bisector of AB passes through the midpoint of AB and is perpendicular to AB. Two ways to get it:
Midpoint and slope. For A(1,2), B(5,4): midpoint (3,3); slope of AB is 5−14−2=21; the perpendicular slope is −2. So y−3=−2(x−3), i.e. 2x+y=9.
Equal distances. Every point P(x,y) on it satisfies PA=PB. Squaring: (x−1)2+(y−2)2=(x−5)2+(y−4)2, which simplifies to 8x+4y−36=0, the same line 2x+y=9 ✓. This also works when the segment is vertical or horizontal, where slopes cause trouble.
B. Foot of the perpendicular and reflection
Let P(x1,y1) and the line ax+by+c=0. Put t=a2+b2ax1+by1+c. Then
Why. The direction (a,b) is perpendicular to the line, so the foot is P moved along (a,b) by some multiple −t. Putting (x1−at,y1−bt) into the line equation and solving gives that t. The reflection goes twice as far. The distance formula a2+b2∣ax1+by1+c∣ is the same as ∣t∣a2+b2.
Example.P(1,2) and x+y−6=0. Here t=21+2−6=−23. The foot is (1+23,2+23)=(25,27); check: 25+27=6 ✓. The reflection is (1+3,2+3)=(4,5), and the midpoint of P and (4,5) is (25,27), the foot ✓. The distance is 232=23≈2.12.
C. Intersection of lines, concurrency and the family of lines
Two lines that are not parallel meet at one point: solve the two equations together.
Three lines are concurrent (pass through one point) when the 3×3 determinant of their coefficients a1a2a3b1b2b3c1c2c3 is 0, provided the first two are not parallel. Example: x+y−3=0 and 2x−y=0 meet at (1,2). The line x−2y+3=0 passes through (1,2) since 1−4+3=0, and the determinant 1211−1−2−303=0 ✓.
Family of lines. Every line through the intersection of L1=0 and L2=0 can be written L1+λL2=0 (for some number λ, or L2=0 itself). Use one more condition to find λ. Example: the line through the intersection of 2x+3y−5=0 and x−y+1=0and the origin: (2x+3y−5)+λ(x−y+1)=0 at (0,0) gives −5+λ=0, so λ=5, and the line is 7x−2y=0. Check: the lines meet at (52,57) and 7⋅52−2⋅57=0 ✓.
6.6Exam tips and common mistakes
Exam tips
Write each line as ax+by+c=0 first (everything on one side) and list a,b,c.
For the parallel distance make a,b equal before reading the c values.
Common mistakes
Forgetting the modulus, which can give a negative distance.
Using ∣c1−c2∣ when a,b differ between the two equations.
Forgetting to move the constant to the left so that the equation has =0.
Practice questions (graded-assignment style)
Q1Parallel or perpendicular?
Multiple Select Question (MSQ): select all that apply.
Pair A: 2x+y−3=0 and 4x+2y+5=0. Pair B: 3x−2y+1=0 and 2x+3y−4=0. Choose the correct statements.
1
Pair A is parallel.
2
Pair B is perpendicular.
3
Pair A is perpendicular.
4
Pair B is parallel.
Solution
Idea
Use a1b2=a2b1 for parallel and a1a2=−b1b2 for perpendicular.
Pair A: a1b2=2⋅2=4 and a2b1=4⋅1=4. Equal, so parallel.
Pair B: a1a2=3⋅2=6 and −b1b2=−(−2)(3)=6. Equal, so perpendicular.
So options 3 and 4 are false.
Answer: options 1 and 2.
Q2A parallel condition
Numerical Answer Type (NAT).
For which k is kx+2y−1=0 parallel to 3x+4y+2=0?
Solution
Idea
Use a1b2=a2b1.
k⋅4=3⋅2, so k=46=1.5.
Check: slopes −21.5=−0.75 and −43=−0.75.
Answer: 1.5
Q3Point to line
Numerical Answer Type (NAT).
Find the distance of the point (1,2) from the line 3x+4y−5=0.
Solution
Idea
Substitute the point and divide by a2+b2.
∣3(1)+4(2)−5∣=∣3+8−5∣=6.
32+42=5, so d=56=1.2.
Answer: 1.2
Q4Between parallel lines
Numerical Answer Type (NAT).
Find the distance between x+y−2=0 and x+y+4=0, correct to two decimals.
Solution
Idea
Both lines already have the same a=b=1.
D=12+12∣−2−4∣=26=32≈4.24.
Answer: 4.24
Q5Another parallel condition
Numerical Answer Type (NAT).
For which k is 2x+ky−3=0 parallel to 6x+9y+1=0?
Solution
Idea
a1b2=a2b1.
2⋅9=6⋅k, so k=3.
Check: slopes −32 and −96=−32.
Answer: 3
P1A perpendicular bisector
Numerical Answer Type (NAT).
The perpendicular bisector of the segment joining A(1,2) and B(5,4) is 2x+y=k. Find k.
Solution
Idea
The bisector passes through the midpoint, and every point on it is equidistant from A and B.
Midpoint (3,3) lies on 2x+y=k, so k=2(3)+3=9.
Check with a second point on the line, (4,1): PA2=9+1=10 and PB2=1+9=10 ✓ (and 2(4)+1=9).
Answer: 9
P2Foot of a perpendicular
Numerical Answer Type (NAT).
Find the x-coordinate of the foot of the perpendicular from P(1,2) to the line x+y−6=0.
Solution
Idea
The foot is (x1−at,y1−bt) with t=a2+b2ax1+by1+c.
t=1+11+2−6=−23.
Foot =(1+23,2+23)=(2.5,3.5). It lies on the line (2.5+3.5=6) and P to the foot has direction (1.5,1.5), perpendicular to the line (slope −1) ✓.
Answer: 2.5
P3Reflection of a point
Multiple Choice Question (MCQ): choose the one correct option.
The reflection of P(1,2) in the line x+y=6 is
1
(5,4)
2
(4,5)
3
(2.5,3.5)
4
(3,3)
Solution
Idea
The foot of the perpendicular is the midpoint of P and its reflection.
The foot is (2.5,3.5) (see P2). If the image is (u,v): 21+u=2.5 and 22+v=3.5, so (u,v)=(4,5).
Check: 4+5=9 is as far above 6 as 1+2=3 is below it. Option 3 is the foot itself, not the image.
Answer: option 2.
P4Concurrent lines
Numerical Answer Type (NAT).
The lines x+y−3=0, 2x−y=0 and x−2y+k=0 are concurrent. Find k.
Solution
Idea
Find where the first two meet; the third must pass through that point.
Adding the first two equations: 3x−3=0, so x=1 and y=2. The lines meet at (1,2).
1−2(2)+k=0⇒k=3.
Determinant check: 1211−1−2−30k=1(−k)−1(2k)+(−3)(−4+1)=−3k+9, which is 0 exactly when k=3 ✓.
Answer: 3
P5A line through an intersection point and the origin
Numerical Answer Type (NAT).
Find the slope of the line through the origin and the point where 2x+3y−5=0 meets x−y+1=0.
Solution
Idea
Either solve for the intersection and use two points, or use the family L1+λL2=0.
From x=y−1: 2y−2+3y−5=0, so y=57 and x=52. The slope from the origin is 2/57/5=27=3.5.
Family method: (2x+3y−5)+λ(x−y+1)=0 through (0,0) gives λ=5, line 7x−2y=0, slope 27 ✓.
Answer: 3.5
Revision overview
General formax + by + c = 0 Slope is −a / b b ≠ 0 for the tests
Parallela₁ b₂ = a₂ b₁ Same slope
Perpendiculara₁ a₂ = −b₁ b₂ Slopes multiply to −1
General equationWeek 2 · Sections 2.7 to 2.9
Point to line|ax₁ + by₁ + c| / √(a² + b²) Insert the point, take modulus
Between parallels|c₁ − c₂| / √(a² + b²) Same a and b first
AlwaysDistances are never negative Numerator 0: point is on the line
Revision: conditions and distances from the general equation
Real data rarely lies exactly on a line. A line of fit is a straight line chosen to follow the data, and the Sum Squared Error measures how far the data is from it.
7.1Sum squared error
Real data rarely lies exactly on a line. A line of fit is a straight line chosen to follow the data, and the Sum Squared Error measures how far the data is from it.
Definition: SSE
SSE is the sum of the squares of the deviations of the predicted linear model from the actual data. For n points (xi,yi) and a line of fit y=mx+c:
SSE=i=1∑n(yi−mxi−c)2
For each point, mxi+c is the value the line predicts and yi is the actual value. Their difference is the deviation; each deviation is squared, and the squares are added.
Why square?
Deviations above the line are positive and below are negative, so adding them directly lets them cancel. In the example below the plain deviations add up to 1+0−1−2=−2, but the SSE is 6. Squares are never negative, so every miss counts.
7.2Computing the SSE
Example 22Computing the SSE
A line of fit y=2x+2 is given for the data (1,5),(2,6),(4,9),(9,18). Compute the sum squared error.
Solution
There are 4 points and m=2, c=2, so SSE=∑(yi−2xi−2)2.
Write the four terms: (5−2−2)2+(6−4−2)2+(9−8−2)2+(18−18−2)2=(1)2+(0)2+(−1)2+(−2)2.
=1+0+1+4=6. The sum squared error is 6.
x
y
2x + 2
y − (2x + 2)
square
1
5
4
1
1
2
6
6
0
0
4
9
10
−1
1
9
18
20
−2
4
Figure 11. The deviations of four data points from the line y = 2x + 2
7.3Comparing lines of fit
The SSE turns "how well does this line follow the data?" into a number. For the same data, a line with a smaller SSE lies closer to the points.
Example 23Which line fits better?
For the same data find the SSE of the lines y=2x+3, y=2x+2 and y=2x+1.5, and say which fits best.
The line y=2x+1.5 has the smallest SSE, so of the three it follows the data best.
Figure 12. Three candidate lines for the same data, compared by SSE
Beyond the source. The source defines the SSE and computes it for a given line. How to find the line with the smallest SSE, the least-squares line, is added in 7.4 below as an extra.
7.4The least-squares line: the best line of fit
The SSE tells you how good a given line is. The least-squares line is the line y=mx+c whose SSE is the smallest possible. This is the line a computer would fit to the data, so it is worth knowing how it is found.
A. The formulas
For n data points (xi,yi), write xˉ=n1∑xi and yˉ=n1∑yi. Then
m=n∑xi2−(∑xi)2n∑xiyi−(∑xi)(∑yi),c=yˉ−mxˉ
(The slope can also be written m=∑(xi−xˉ)2∑(xi−xˉ)(yi−yˉ).) These come from asking that the SSE, a quadratic in m and c, stops decreasing in both directions. That gives two equations, the normal equations:
∑yi=m∑xi+nc,∑xiyi=m∑xi2+c∑xi
B. Worked example
Data (1,2),(2,3),(3,5). Here n=3, ∑x=6, ∑y=10, ∑xy=2+6+15=23, ∑x2=1+4+9=14.
m=3⋅14−363⋅23−6⋅10=69=23.
xˉ=2, yˉ=310, so c=310−23⋅2=31. The line is y=1.5x+31.
Compare y=x+1 (the simple line from the first practice question): SSE =1. The least-squares value 61 is smaller, as it must be.
C. Facts to remember
The least-squares line always passes through (xˉ,yˉ) (that is what c=yˉ−mxˉ says).
Its residuals add up to zero: ∑(yi−mxi−c)=∑yi−m∑xi−nc=0 by the first normal equation. (For other lines the sum need not be 0, and this is why the SSE squares the deviations.)
No other line has a smaller SSE. The SSE is 0 only if all points lie exactly on one line (for example (0,1),(1,3),(2,5) gives y=2x+1 with SSE 0).
Mean squared errorMSE=nSSE, and the root mean squared error is MSE. Dividing by n makes errors comparable across data sets of different sizes. The line minimising SSE also minimises MSE.
The formula needs n∑x2−(∑x)2=0: that fails only when all xi are equal (a vertical line of points), where there is no sensible slope.
7.5Exam tips and common mistakes
Exam tips
Make a table: x, y, prediction, deviation, square. Add the last column.
Compare lines only on the same data; a smaller SSE then means a closer fit.
Common mistakes
Adding the plain deviations (they cancel).
Computing mxi+c−yi for some points and yi−mxi−c for others. Squaring hides the sign, but be consistent.
Skipping a data point in the sum.
Practice questions (graded-assignment style)
Q1SSE of a line
Numerical Answer Type (NAT).
For the data (1,2),(2,3),(3,5) and the line y=x+1, find the SSE.
Solution
Idea
Deviation = actual − predicted, then square.
Predictions: 2,3,4. Deviations: 0,0,1.
SSE =0+0+1=1.
Answer: 1
Q2Deviations that cancel
Numerical Answer Type (NAT).
For the data (1,3),(2,3),(3,7) and the line y=2x, find the SSE.
Solution
Idea
Squares do not cancel.
Predictions: 2,4,6. Deviations: 1,−1,1.
SSE =1+1+1=3. (The plain deviations add to 1, which hides the misses.)
Answer: 3
Q3Which fits best?
Multiple Choice Question (MCQ): choose the one correct option.
For the data (0,1),(1,3),(2,5), which line has the smallest SSE?
1
A: y=2x+1
2
B: y=2x
3
C: y=x+1
4
All are equal
Solution
Idea
Compute the SSE of each line.
A: predictions 1,3,5, deviations 0,0,0, SSE =0.
B: predictions 0,2,4, deviations 1,1,1, SSE =3.
C: predictions 1,2,3, deviations 0,1,2, SSE =5.
Line A passes through every point, so its SSE is 0.
Answer: option 1.
Q4SSE facts
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about the SSE.
1
The SSE is never negative.
2
Squaring stops positive and negative deviations from cancelling.
3
For the same data, a smaller SSE means a closer fit.
4
An SSE of 0 means the line passes through no data point.
Solution
Idea
Think about what a sum of squares can and cannot be.
Options 1, 2 and 3 are true.
Option 4 is false: an SSE of 0 means every deviation is 0, so the line passes through every data point.
Answer: options 1, 2 and 3.
L1The slope of the least-squares line
Numerical Answer Type (NAT).
Find the slope of the least-squares line for the data (1,2),(2,3),(3,5).
Solution
Idea
Use m=n∑x2−(∑x)2n∑xy−∑x∑y.
n=3, ∑x=6, ∑y=10, ∑xy=23, ∑x2=14.
m=42−3669−60=69=1.5.
Cross-check with deviations from the means: xˉ=2, yˉ=310; ∑(x−xˉ)(y−yˉ)=(−1)(−34)+0+(1)(35)=3 and ∑(x−xˉ)2=2, giving 23 ✓.
Answer: 1.5
L2The minimum SSE
Numerical Answer Type (NAT).
For the data (1,2),(2,3),(3,5), what is the SSE of the least-squares line? (Give a decimal rounded to 3 places.)
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about the least-squares line y=mx+c for a data set.
1
It passes through the point (xˉ,yˉ).
2
The residuals yi−mxi−c add up to 0.
3
Its SSE is always 0.
4
No other line has a smaller SSE on the same data.
5
MSE=n×SSE.
Solution
Idea
Use c=yˉ−mxˉ and the normal equations.
1 ✓ mxˉ+c=yˉ.
2 ✓ ∑(yi−mxi−c)=nyˉ−mnxˉ−nc=n(yˉ−mxˉ−c)=0.
3 ✗ The SSE is 0 only when the points are exactly collinear (the example (1,2),(2,3),(3,5) has SSE 61).
4 ✓ That is what "least squares" means.
5 ✗ MSE=SSE/n.
Answer: options 1, 2 and 4.
L4The intercept from the sums
Numerical Answer Type (NAT).
For the data (1,5),(2,6),(4,9),(9,18) the sums are ∑x=16, ∑y=38, ∑xy=215, ∑x2=102. Find the intercept c of the least-squares line, rounded to 2 decimals.