2.1 Lines (Linear Functions)

1. Basic Notions on Coordinate Geometry

Given two points $A(x_1, y_1)$ and $B(x_2, y_2)$ on a Cartesian plane:

The Gradient or Slope ($m$) of the line segment AB is given by:

$m = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}$

This indicates the inclination of the line segment AB. Moving along the positive direction of the x-axis:

  • If the line segment is increasing, then $m > 0$.
  • If the line segment is decreasing, then $m < 0$.
  • If the line segment is horizontal, then $m = 0$.
  • If the line segment is vertical, then $m$ is undefined.

Note: The slope is also equal to $\tan\theta$, where $\theta$ is the angle between the line and the x-axis.

The Distance between A and B is given by:
$d_{AB} = \sqrt{(\Delta x)^2 + (\Delta y)^2} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$
The Midpoint $M(x,y)$ of the line segment AB has coordinates:
$x = \frac{x_1 + x_2}{2}, \quad y = \frac{y_1 + y_2}{2}$

EXAMPLE 1

(a) Given two points $A(1,4)$ and $B(7,12)$:
Slope: $m = \frac{12 - 4}{7 - 1} = \frac{4}{3}$
Distance: $d = \sqrt{(7 - 1)^2 + (12 - 4)^2} = 10$
Midpoint: $M\left(\frac{1+7}{2}, \frac{4+12}{2}\right) \Rightarrow M(4,8)$
(b) Given two points $A(1,8)$ and $B(5,8)$:
Since y-coordinates are equal, the formula is unnecessary.
Slope: $m = 0$ (horizontal). Distance: $d = 5 - 1 = 4$. Midpoint: $M(3,8)$.
(c) Given two points $A(1,5)$ and $B(1,7)$:
Since x-coordinates are equal.
Slope: undefined (vertical). Distance: $d = 7 - 5 = 2$. Midpoint: $M(1,6)$.

2. The Equation of a Line

The standard equation of a straight line is represented as $y = mx + c$, where $m$ is the gradient (slope) and $c$ is the y-intercept.

  • A horizontal line has the equation $y = c$ (slope $m = 0$).
  • A vertical line has the equation $x = c$ (slope is undefined). A vertical line is not a function.

EXAMPLE 2 & 3 (Linear Graphs)

Lines passing through the origin ($c=0$):
$L_1: y = 2x$ (increases 2 units in $y$ for every 1 unit in $x$, slope is 2)
$L_2: y = -2x$ (decreases 2 units in $y$ for every 1 unit in $x$, slope is -2)
Lines with a y-intercept ($c=3$):
$L_1: y = 2x + 3$ (slope is 2, intercepts y-axis at 3)
$L_2: y = -2x + 3$ (slope is -2, intercepts y-axis at 3)

3. Parallel and Perpendicular Lines

Consider two lines: $L_1: y = m_1x + c_1$ and $L_2: y = m_2x + c_2$.

Parallel lines: $L_1 \parallel L_2$ if and only if $m_1 = m_2$.
Example: $y = 3x + 5$ and $y = 3x + 8$ are parallel.
Perpendicular lines: $L_1 \perp L_2$ if and only if $m_2 = -\frac{1}{m_1}$.
Example: $y = 3x + 5$ and $y = -\frac{1}{3}x + 8$ are perpendicular.

4. Alternative Formula: $Ax + By = C$

If $B \ne 0$, solving for $y$ yields the $y = mx + c$ form. If $B = 0$, it yields a vertical line $x = c$. If $A = 0$, it yields a horizontal line $y = c$. Coefficients A, B, and C are conventionally expressed as integers.

EXAMPLE 5

From general to standard: $2x + 3y = 5 \Rightarrow 3y = -2x + 5 \Rightarrow y = -\frac{2}{3}x + \frac{5}{3}$.
From standard to general:
(a) $y = -3x + 7 \Rightarrow 3x + y = 7$.
(b) $y = \frac{1}{2}x + \frac{2}{3} \Rightarrow -\frac{1}{2}x + y = \frac{2}{3} \Rightarrow -3x + 6y = 4$.

5. Given: A Point and a Slope

The equation of a line passing through point $P(x_0, y_0)$ with slope $m$ is given by:

$y - y_0 = m(x - x_0)$

EXAMPLE 6 & 7

Example 6: The line passing through $P(1,2)$ with slope $m=3$ is:
$y - 2 = 3(x - 1) \Rightarrow y = 3x - 1$.
In general form: $3x - y = 1$.
Example 7 (Given Two Points): Find the line passing through $P(1,2)$ and $Q(4,7)$.
Slope: $m = \frac{7 - 2}{4 - 1} = \frac{5}{3}$.
Equation: $y - 2 = \frac{5}{3}(x - 1) \Rightarrow 3y - 6 = 5(x - 1) \Rightarrow -5x + 3y = 1$.