Skip to main content

Section 2.2 Graphs of Relations and Functions

Example 2.2.1.

Graph the following two equations. For each, state the domain and range and determine if it is a function.
\begin{equation*} \quad \quad \quad \text{ (a) } y=|x| \quad \quad \quad \quad \quad \quad \text{ (b) } x=y^2 \quad \quad \quad \quad \quad \quad \end{equation*}
Solution
(a) Construct a table of ordered pairs and use them to sketch the graph.
Figure 2.2.2. V-shaped graph of \(y = |x|\text{.}\)
\(x\) \(y=|x|\)
\(-2\) \(2\)
\(-1\) \(1\)
\(0\) \(0\)
\(1\) \(1\)
\(2\) \(2\)
The graph passes the vertical line test, so it is a function. Also,
(b) Construct a table of ordered pairs and use them to sketch the graph.
Figure 2.2.3. Graph of \(x=y^2\text{,}\) a U_shaped curve opening to the right.
\(x=y^2\) \(y\)
\(4\) \(-2\)
\(1\) \(-1\)
\(0\) \(0\)
\(1\) \(1\)
\(4\) \(2\)
The graph fails the vertical line test, so it is not a function.

Subsection 2.2.1 Semicircles

  • The graph of \(x^2+y^2=r^2\) is a circle centered at the origin \((0,0)\) with radius \(r\text{.}\) It is not a function since \(y=\pm\sqrt{r^2-x^2}\text{.}\)
  • Taken separately, \(y=\sqrt{r^2-x^2}\) and \(y=-\sqrt{r^2-x^2}\) are functions.
Figure 2.2.4. Two semicircles of the circle with radius \(r\) and center at the origin.

Example 2.2.5.

Sketch the graph of \(y=-\sqrt{4-x^2}\text{.}\) State the domain and range.
Solution:   The graph of the given equation is the semicircle of the bottom of the circle centered at \((0,0)\) with radius \(2\text{.}\)
Figure 2.2.6. Graph of the semicircle \(y=-\sqrt{4-x^2}\text{.}\)

Subsection 2.2.2 Increasing, Decreasing or Constant

  • Looking at the graph of a function \(f(x)\text{,}\) from left to right, if part of the graph is:
    1. rising, then \(f\) is increasing there.
    2. falling, then \(f\) is decreasing there.
    3. flat (horizontal), then \(f\) is constant there.
  • We use intervals of \(x\)-coordinates to identify the parts.
Figure 2.2.7. Graph of a function with parts that are increasing, decreasing or constant.

Example 2.2.8.

Find the intervals on which the pictured function is increasing, decreasing, or constant. Also, state the domain and range.
Figure 2.2.9. Graph of a function on \([-2,6]\text{:}\) decreasing, then increasing, then constant.
Solution:   Read the graph from left to right.

Example 2.2.10.

Find the intervals on which the pictured function is increasing, decreasing, or constant. Also, state the domain and range.
Figure 2.2.11. Graph of a semicircle resting upon the \(x\)-axis.
Solution:   Read the graph from left to right.

Example 2.2.12.

Find the intervals on which the pictured function is increasing, decreasing, or constant. Also, state the domain and range.
Figure 2.2.13. Graph of a function: decreasing, then constant, then increasing.
Solution:   Read the graph from left to right.

Subsection 2.2.3 Piecewise Functions

A function that is defined by different equations on different parts of its domain is called a piecewise function.
Recall (Chapter P) that
\begin{equation*} |x|= \begin{cases} x & \text{if } x \geq 0\\[4pt] -x & \text{if } x \lt 0 \end{cases} \end{equation*}
So, \(|x|\) is defined by \(2\) equations.

Example 2.2.14.

The function \(f\) is defined by
\begin{equation*} f(x)= \begin{cases} -2x + 1 & \text{ if } -3 \leq x < 1\\[4pt] 2 & \text{ if } x =1 \\[4pt] x^2 & \text{ if } x > 1. \end{cases} \end{equation*}
(a)   Find \(f(-2)\text{,}\) \(f(2)\text{,}\) and \(f(1)\text{.}\)
(b)   Determine the domain of \(f\text{.}\)
Solution:   (a) When \(x=-2\text{,}\) \(f(x)=-2x+1\) is the equation. Plug into this.
\begin{equation*} f(-2)= -2(-2)+1=4+1=5 \end{equation*}
When \(x=2\text{,}\) \(f(x)=x^2\) is the equation. Plug into this.
\begin{equation*} f(2)=2^2 = 4 \end{equation*}
When \(x=1\text{,}\) \(f(x)=2\) is the equation. So \(f(1)=2.\)
(b) The function \(f\) is defined for all \(x \geq -3\text{.}\) So, the domain is
\begin{equation*} [-3,\infty). \end{equation*}
Note:   To graph a piecewise function, graph each equation over the appropriate part of the domain.

Example 2.2.15.

Graph the following function.
\begin{equation*} f(x)= \begin{cases} x^2 & \text{ if } -2 \leq x <1 \\[4pt] 3x+2 & \text{ if } x \geq 1 \end{cases} \end{equation*}
Solution:   Start with a table for each equation.
\(x\) \(y=x^2\)
\(-2\) \(4\)
\(-1\) \(1\)
\(0\) \(0\)
\(1\) \(1\)
\(x\) \(y=3x+2\)
\(1\) \(5\)
\(2\) \(8\)
Since \(x=1\) is not in the domain for the \(x^2\) equation, there is an open circle at \((1,1)\text{.}\) See the graph below.
Figure 2.2.16. Graph of a piecewise function consisting of part of a parabola and a ray.
Looking at the graph, we can see that:
  • The Domain of \(f\) is \([-2,\infty)\text{.}\)
  • The Range of \(f\) is \([0,4] \cup[5,\infty)\text{.}\)

Example 2.2.17.

Graph the following function.
\begin{equation*} f(x)= \begin{cases} x+1 & \text{ if } x<3 \\[4pt] 4 & \text{ if } x \geq 3 \end{cases} \end{equation*}
Solution:   We’ll start with a table for the top equation.
\(x\) \(y=x+1\)
\(-1\) \(0\)
\(0\) \(1\)
\(3\) \(4\)
There is no open circle since the \(2\) pieces meet at \((3,4)\text{.}\) See the graph below.
Figure 2.2.18. Graph of a piecewise function consisting of two rays meeting at the non-arrow ends of both.
Looking at the graph, we can see that:
  • The Domain of \(f\) is \((-\infty,\infty)\text{.}\)
  • The Range of \(f\) is \((-\infty,4]\text{.}\)

Example 2.2.19.

The graph of a piecewise function is given. Write a definition for the graphed function.
Figure 2.2.20. Graph of a piecewise function consisting of two line segments meeting at the origin, with endpoints at \((-1,1)\) and \((2,1)\text{.}\)
Solution
The piece on the left (\(-1 \leq x \leq 0\)) is part of the line containing \((-1,1)\) and \((0,0)\text{.}\) Find the equation of the line.
First, find the slope:
\begin{equation*} m=\frac{0-1}{0--1} = \frac{-1}{1}=-1 \end{equation*}
Find the equation using point-slope form:
\begin{align*} y-y_1 \amp = m(x-x_1) \quad \quad \quad \quad \quad \quad \text{ Let $(x_1,y_1)=(0,0)$.}\\ y-0 \amp =-1(x-0) \\ y \amp =-x \end{align*}
The piece on the right (\(0 \lt x \leq 2\)) is part of the line containing \((0,0)\) and \((2,1)\text{.}\) Find the equation of the line.
\begin{equation*} m=\frac{1-0}{2-0}=\frac{1}{2} \end{equation*}
Use point-slope form again.
\begin{align*} y-y_1 \amp = m(x-x_1) \quad \quad \quad \quad \quad \quad \text{ Let $(x_1,y_1)=(0,0)$.}\\[0.25em]\\ y-0 \amp =\frac{1}{2} (x-0)\\[0.25em]\\ y \amp =\frac{1}{2}x \end{align*}
Putting everything together, we get
\begin{equation*} f(x)= \begin{cases} -x & \text{ if } -1 \leq x \leq 0\\[4pt] \frac{1}{2}x & \text{ if } \text{ } 0 < x \leq 2 \end{cases} \end{equation*}