A linear function is an expression that when graphed, results in a straight line. The name is slightly revealing—when something is “linear”, it means it progresses in a straight line. Here, you will learn how to recognize, and draw graphs of, linear functions.
Theory
A linear function can be written in the form
$$f(x)=ax+b$$ |
where $a$ is the slope, and $b$ is the $y$-intercept, the place the graph intersects with the $y$-axis (and where $x=0$).
You can find the slope of a line if you have the coordinates of two points on that line. Call the points $({x}_{1},{y}_{1})$ and $({x}_{2},{y}_{2})$. You use the following formulas for the slope $a$ and the constant term $b$:
Rule
The straight line that goes through the points $({x}_{1},{y}_{1})$ and $({x}_{2},{y}_{2})$ has the slope
$$a=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}$$ |
and the constant term
$$b={y}_{1}-a{x}_{1}$$ |
Rule
The slope $a$ tells you how much $y$ increases or decreases by as $x$ increases by 1.
If $a>0$, the graph rises towards the right, meaning $y$ is increasing as $x$ increases. If $a<0$, the graph sinks towards the right, meaning $y$ is decreasing as $x$ increases.
The graph intersects the $y$-axis at the point $b$, which is why it is known as the $y$-intercept.
The graph is a straight line that with coordinates $(x,y)=(x,f(x))$.
Example 1
Find the slope of the straight line that passes through the points $(5,2)$ and $(3,6)$, and find the $y$-intercept.
You set $({x}_{1},{y}_{1})$ equal to $(3,6)$ and $({x}_{2},{y}_{2})$ equal to $(5,2)$. (The calculations would still work even if you switched the points.) You get:
$$a=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}=\frac{2-6}{5-3}=\frac{-4}{2}=-2$$ |
You now know that $y$ decreases by 2 when $x$ increases by 1. In other words, the graph slopes downward by 2 when it moves 1 to the right.
Let’s see what the $y$-intercept is: $$\begin{array}{llll}\hfill b& ={y}_{1}-a{x}_{1}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =6-(-2)\times 3\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =6+6\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =12\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$
Thus, the point $y$-intercept is $(0,12)$.