Sub topic 4
Linear Functions: Slope and Intercepts
Prerequisites
You should be comfortable plotting points on the coordinate plane, solving linear equations, and working with fractions. A linear function has a graph that is a straight line.
The standard form is
\[ y = mx + c \]
where:
- \(m\) is the slope, or rate of change.
- \(c\) is the \(y\)-intercept, the point where the line crosses the \(y\)-axis.
- \(x\) is the input and \(y\) is the output.
Slope and Rate of Change
For two points \((x1,y1)\) and \((x2,y2)\), the slope is
\[ m=\frac{y2-y1}{x2-x1} \]
It measures the change in \(y\) for each unit change in \(x\).
- \(m>0\): the line rises from left to right.
- \(m<0\): the line falls from left to right.
- \(m=0\): the line is horizontal.
- An undefined slope describes a vertical line, whose equation has the form \(x=k\).
For example, the line through \((2,5)\) and \((6,13)\) has slope
\[ m=\frac{13-5}{6-2}=\frac{8}{4}=2. \]
The line rises by 2 units whenever \(x\) increases by 1 unit.
Intercepts and Equation of a Line
The \(y\)-intercept is found by setting \(x=0\). The \(x\)-intercept is found by setting \(y=0\).
For
\[ y=3x-6, \]
the \(y\)-intercept is \(-6\), so the line crosses the \(y\)-axis at \((0,-6)\). For the \(x\)-intercept,
\[ 0=3x-6 \implies x=2. \]
Therefore, the line crosses the \(x\)-axis at \((2,0)\).
If you know a point \((x1,y1)\) and the slope \(m\), use the point-slope form:
\[ y-y1=m(x-x1). \]
For a line with slope \(2\) through \((3,4)\),
\[ y-4=2(x-3), \]
so
\[ y=2x-2. \]
This line has \(y\)-intercept \(-2\).
def slope(point1, point2):
x1, y1 = point1
x2, y2 = point2
return (y2 - y1) / (x2 - x1)
p = (2, 5)
q = (6, 13)
m = slope(p, q)
c = p[1] - m * p[0]
print("slope =", m)
print("y-intercept =", c)Comparing Lines
Two non-vertical lines are parallel when their slopes are equal. They are perpendicular when the product of their slopes is \(-1\).
For example, a line with slope \(3\) is perpendicular to a line with slope \(-\frac13\).
When a question gives a cost, distance, or work rate, look for the constant rate of change. That rate is often the slope, while the starting amount is the intercept.
Exercise
Find the equation of the line through (1, 7) and (4, 1). Then find its x-intercept.
Show answer
The slope is (1 - 7)/(4 - 1) = -2. Using y - 7 = -2(x - 1), we get y = -2x + 9. Setting y = 0 gives x = 9/2, so the x-intercept is (9/2, 0).