Graph of functions

Linear and constant functions

A function of the form $f(x)=ax+b$ is a linear function, because its graph is a line.

A function of the form $f(x)=b$, where $b$ is a constant, is a constant function.

The following examples show how to graph a linear function and a constant function.

Example 1: Graph the linear function. Give its domain and range.

$f(x)=-4x+3$

Solution: The function is in slope-intercept form $f(x)=mx+b$, so the slope is $m=-4=\dfrac{\text{rise}}{\text{run}}=\dfrac{-4}{1}$ and the $y$-intercept is $(0,3)$.

Plot the $y$-intercept $(0,3)$. From there, use the slope (down $4$, right $1$) to locate a second point, then draw the line through them.

xy(0, 3)

The graph is a line, so the function is defined for every real number and takes every real value. Therefore,

Domain $=(-\infty,\infty)$

Range $=(-\infty,\infty)$

Example 2: Graph the constant function. Give its domain and range.

$g(x)=-7$

Solution: The graph of the constant function $g(x)=-7$ is a horizontal line passing through every point with $y=-7$.

xyy = -7

Every real number $x$ has an output, but the only output is $-7$. Therefore,

Domain $=(-\infty,\infty)$

Range $=\{-7\}$