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:

A(x₁, y₁) B(x₂, y₂) Run = Δx Rise = Δy x y
$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.

θ (0, c) x y O y = mx + c m = gradient (slope) = tan(θ) c = 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.

LINEAR GRAPHS EXAMPLES

Example 2: Lines passing through the origin ($c=0$):
$L_1: y = 2x$ (increases 2 units in $y$ for every 1 unit in $x$, positive slope)
$L_2: y = -2x$ (decreases 2 units in $y$ for every 1 unit in $x$, negative slope)

y = 2x y = -2x O(0,0)

Example 3: Lines with a y-intercept ($c=3$):
$L_1: y = 2x + 3$ (positive slope, intercepts y-axis at +3)
$L_2: y = -2x + 3$ (negative slope, intercepts y-axis at +3)

y = 2x+3 y = -2x+3 (0, 3)

Example 4: Look at the graphs of two specific lines: $L_1: y = 5$ and $L_2: x = 5$

y = 5 O 5
x = 5 O 5

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 (General Form)

A straight line can also be expressed mathematically in the general coordinate form:

$Ax + By = C$

Coefficients $A$, $B$, and $C$ are conventionally expressed as integers. The geometric behavior of the line relies entirely on the values of these coefficients:

  • If $B \ne 0$: Solving the equation algebraically for $y$ yields the standard slope-intercept form $y = mx + c$. This represents a standard slanted line (or a horizontal line if $A = 0$).
  • If $B = 0$: The $y$ term disappears, causing the equation to collapse to $Ax = C$. Solving for $x$ yields $x = \frac{C}{A}$, which graphically perfectly dictates a vertical line.
  • If $A = 0$: The $x$ term disappears, causing the equation to collapse to $By = C$. Solving for $y$ yields $y = \frac{C}{B}$, which graphically perfectly dictates a horizontal line.

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 a specific point $P(x_0, y_0)$ with a known slope $m$ is given by the point-slope formula:

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

EXAMPLE 6

The line passing through $P(1,2)$ with slope $m=3$ is evaluated as:

  • Point-Slope insertion: $y - 2 = 3(x - 1)$.
  • Slope-Intercept form: $y = 3x - 1$.
  • General form: $3x - y = 1$.

6. Given: Two Points

To determine the algebraic equation of a line passing through two distinct coordinate points $A(x_1, y_1)$ and $B(x_2, y_2)$:

  1. Calculate the slope: Determine $m = \frac{y_2 - y_1}{x_2 - x_1}$.
  2. Apply the point-slope formula: Substitute the newly found slope $m$ and either point $A$ or $B$ into the equation $y - y_1 = m(x - x_1)$.
  3. Rearrange: Expand and isolate the variables to achieve either the slope-intercept form ($y = mx + c$) or the general form ($Ax + By = C$).

Special Cases (Horizontal and Vertical Lines):

  • If the x-coordinates are entirely identical ($x_1 = x_2$), the denominator evaluates to zero, making the slope mathematically undefined. The line acts perfectly vertical, yielding the immediate equation $x = x_1$.
  • If the y-coordinates are entirely identical ($y_1 = y_2$), the numerator evaluates to zero, making the slope exactly $0$. The line acts perfectly horizontal, yielding the immediate equation $y = y_1$.

EXAMPLE 7

Find the line passing through $P(1,2)$ and $Q(4,7)$.

  • Slope: $m = \frac{7 - 2}{4 - 1} = \frac{5}{3}$.
  • Point-Slope: $y - 2 = \frac{5}{3}(x - 1)$.
  • General form: Multiply the entire equation by 3 to safely eliminate fractions: $3(y - 2) = 5(x - 1) \Rightarrow 3y - 6 = 5x - 5 \Rightarrow -5x + 3y = 1$.

EXAMPLE 8 (Horizontal and Vertical Cases)

(a) Find the line passing through $A(3, 5)$ and $B(3, -2)$.
  • Notice that the x-coordinates are identical ($x_1 = x_2 = 3$).
  • The slope evaluates to $\frac{-2 - 5}{3 - 3} = \frac{-7}{0}$, which is undefined.
  • The equation relies strictly on the x-axis mapping. It is a vertical line: $x = 3$.
(b) Find the line passing through $C(-4, 6)$ and $D(8, 6)$.
  • Notice that the y-coordinates are identical ($y_1 = y_2 = 6$).
  • The slope evaluates to $\frac{6 - 6}{8 - (-4)} = \frac{0}{12} = 0$.
  • The equation relies strictly on the y-axis mapping. It is a horizontal line: $y = 6$.