Skip to content

Graphs of Functions

By the end of this section, you will be able to: use the vertical line test, identify graphs of basic functions, and read information from a graph of a function.

Use the vertical line test

In the last section we learned how to determine if a relation is a function. The relations we looked at were expressed as a set of ordered pairs, a mapping or an equation. We will now look at how to tell if a graph is that of a function.

An ordered pair (x,y)(x,y) is a solution of a linear equation, if the equation is a true statement when the xx- and yy-values of the ordered pair are substituted into the equation.

The graph of a linear equation is a straight line where every point on the line is a solution of the equation and every solution of this equation is a point on this line.

In the graph of the equation y=2x3y=2x-3, for every xx-value there is only one yy-value, as shown in the accompanying table.

xy−6−4−2246−10−8−6−4−2246810y = 2x − 3
xxyy(x,y)(x,y)
2-27-7(2,7)(-2,-7)
1-15-5(1,5)(-1,-5)
003-3(0,3)(0,-3)
3333(3,3)(3,3)
4455(4,5)(4,5)

A relation is a function if every element of the domain has exactly one value in the range. So the relation defined by the equation y=2x3y=2x-3 is a function.

If we look at the graph, each vertical line only intersects the line at one point. This makes sense as in a function, for every xx-value there is only one yy-value.

If the vertical line hit the graph twice, the xx-value would be mapped to two yy-values, and so the graph would not represent a function.

This leads us to the vertical line test. A set of points in a rectangular coordinate system is the graph of a function if every vertical line intersects the graph in at most one point. If any vertical line intersects the graph in more than one point, the graph does not represent a function.

Vertical Line Test. A set of points in a rectangular coordinate system is the graph of a function if every vertical line intersects the graph in at most one point. If any vertical line intersects the graph in more than one point, the graph does not represent a function.

Example 3.51. Determine whether each graph is the graph of a function.

(a)

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456

Since any vertical line intersects the graph in at most one point, the graph is the graph of a function.

(b)

xy−6−5−4−3−2−1123456−6−5−4−3−2−1123456

One of the vertical lines shown on the graph, intersects it in two points. This graph does not represent a function.

Determine whether the upward-opening parabola with vertex (0,1)(0,-1) is the graph of a function.

Determine whether the circle centered at the origin with radius 22 is the graph of a function.

Determine whether the nonvertical line y=x2y=x-2 is the graph of a function.

Identify graphs of basic functions

We used the equation y=2x3y=2x-3 and its graph as we developed the vertical line test. We said that the relation defined by the equation y=2x3y=2x-3 is a function.

We can write this as in function notation as f(x)=2x3f(x)=2x-3. It still means the same thing. The graph of the function is the graph of all ordered pairs (x,y)(x,y) where y=f(x)y=f(x). So we can write the ordered pairs as (x,f(x))(x,f(x)). It looks different but the graph will be the same.

Nothing has changed but the notation.

Graph of a Function. The graph of a function is the graph of all its ordered pairs, (x,y)(x,y) or using function notation, (x,f(x))(x,f(x)) where y=f(x)y=f(x).

SymbolMeaning
ffname of function
xxxx-coordinate of the ordered pair
f(x)f(x)yy-coordinate of the ordered pair

As we move forward in our study, it is helpful to be familiar with the graphs of several basic functions and be able to identify them.

Through our earlier work, we are familiar with the graphs of linear equations. The process we used to decide if y=2x3y=2x-3 is a function would apply to all linear equations. All non-vertical linear equations are functions. Vertical lines are not functions as the xx-value has infinitely many yy-values.

We wrote linear equations in several forms, but it will be most helpful for us here to use the slope-intercept form of the linear equation. The slope-intercept form of a linear equation is y=mx+by=mx+b. In function notation, this linear function becomes f(x)=mx+bf(x)=mx+b where mm is the slope of the line and bb is the yy-intercept.

The domain is the set of all real numbers, and the range is also the set of all real numbers.

Linear Function. For f(x)=mx+bf(x)=mx+b, mm and bb are any real numbers, mm is the slope of the line, and bb is the yy-intercept. The domain is (,)(-\infty,\infty) and the range is (,)(-\infty,\infty).

We will use the graphing techniques we used earlier, to graph the basic functions.

Example 3.52. Graph: f(x)=2x4f(x)=-2x-4.

We recognize this as a linear function.

Find the slope and yy-intercept.

m=2b=4 \begin{array}{rcl} m&=&-2\\[4pt] b&=&-4 \end{array}

Graph using the slope intercept.

xy−8−6−4−22468−8−6−4−22468f(x) = −2x − 4

Graph the linear function f(x)=3x1f(x)=-3x-1 by placing two points on the line.

Graph: f(x)=4x5f(x)=-4x-5. Enter its slope.

The next function whose graph we will look at is called the constant function and its equation is of the form f(x)=bf(x)=b, where bb is any real number. If we replace the f(x)f(x) with yy, we get y=by=b. We recognize this as the horizontal line whose yy-intercept is bb. The graph of the function f(x)=bf(x)=b, is also the horizontal line whose yy-intercept is bb.

Notice that for any real number we put in the function, the function value will be bb. This tells us the range has only one value, bb.

Constant Function. For f(x)=bf(x)=b, bb is any real number and is the yy-intercept. The domain is (,)(-\infty,\infty) and the range is {b}\{b\}.

Example 3.53. Graph: f(x)=4f(x)=4.

We recognize this as a constant function. The graph will be a horizontal line through (0,4)(0,4).

xy−6−4−2246−2246810

Graph: f(x)=2f(x)=-2. Enter the yy-coordinate of every point on the graph.

Graph: f(x)=3f(x)=3. Enter the yy-coordinate of every point on the graph.

The identity function, f(x)=xf(x)=x is a special case of the linear function. If we write it in linear function form, f(x)=1x+0f(x)=1x+0, we see the slope is 1 and the yy-intercept is 0.

Identity Function. For f(x)=xf(x)=x, the slope is 11 and the yy-intercept is 00. The domain is (,)(-\infty,\infty) and the range is (,)(-\infty,\infty).

The next function we will look at is not a linear function. So the graph will not be a line. The only method we have to graph this function is point plotting. Because this is an unfamiliar function, we make sure to choose several positive and negative values as well as 0 for our xx-values.

Example 3.54. Graph: f(x)=x2f(x)=x^2.

We choose xx-values. We substitute them in and then create a chart as shown.

xxf(x)=x2f(x)=x^2(x,f(x))(x,f(x))
3-399(3,9)(-3,9)
2-244(2,4)(-2,4)
1-111(1,1)(-1,1)
0000(0,0)(0,0)
1111(1,1)(1,1)
2244(2,4)(2,4)
3399(3,9)(3,9)
xy−4−3−2−11234−2−112345678910

Graph: f(x)=x2f(x)=x^2. Find f(3)f(-3).

Graph: f(x)=x2f(x)=-x^2. Find f(2)f(2).

Looking at the result in Example 3.54, we can summarize the features of the square function. We call this graph a parabola. As we consider the domain, notice any real number can be used as an xx-value. The domain is all real numbers.

The range is not all real numbers. Notice the graph consists of values of yy never go below zero. This makes sense as the square of any number cannot be negative. So, the range of the square function is all non-negative real numbers.

Square Function. For f(x)=x2f(x)=x^2, the domain is (,)(-\infty,\infty) and the range is [0,)[0,\infty).

The next function we will look at is also not a linear function so the graph will not be a line. Again we will use point plotting, and make sure to choose several positive and negative values as well as 0 for our xx-values.

Example 3.55. Graph: f(x)=x3f(x)=x^3.

We choose xx-values. We substitute them in and then create a chart.

xxf(x)=x3f(x)=x^3(x,f(x))(x,f(x))
2-28-8(2,8)(-2,-8)
1-11-1(1,1)(-1,-1)
0000(0,0)(0,0)
1111(1,1)(1,1)
2288(2,8)(2,8)
xy−3−2−1123−8−7−6−5−4−3−2−112345678

Graph: f(x)=x3f(x)=x^3. Find f(2)f(-2).

Graph: f(x)=x3f(x)=-x^3. Find f(2)f(2).

Looking at the result in Example 3.55, we can summarize the features of the cube function. As we consider the domain, notice any real number can be used as an xx-value. The domain is all real numbers.

The range is all real numbers. This makes sense as the cube of any non-zero number can be positive or negative. So, the range of the cube function is all real numbers.

Cube Function. For f(x)=x3f(x)=x^3, the domain is (,)(-\infty,\infty) and the range is (,)(-\infty,\infty).

The next function we will look at does not square or cube the input values, but rather takes the square root of those values.

Let’s graph the function f(x)=xf(x)=\sqrt{x} and then summarize the features of the function. Remember, we can only take the square root of non-negative real numbers, so our domain will be the non-negative real numbers.

Example 3.56. f(x)=xf(x)=\sqrt{x}.

We choose xx-values. Since we will be taking the square root, we choose numbers that are perfect squares, to make our work easier. We substitute them in and then create a chart.

xxf(x)=xf(x)=\sqrt{x}(x,f(x))(x,f(x))
0000(0,0)(0,0)
1111(1,1)(1,1)
4422(4,2)(4,2)
9933(9,3)(9,3)
xy1234567891012345

Graph: f(x)=xf(x)=\sqrt{x}. Find f(9)f(9).

Graph: f(x)=xf(x)=-\sqrt{x}. Find f(9)f(9).

Square Root Function. For f(x)=xf(x)=\sqrt{x}, the domain is [0,)[0,\infty) and the range is [0,)[0,\infty).

Our last basic function is the absolute value function, f(x)=xf(x)=|x|. Keep in mind that the absolute value of a number is its distance from zero. Since we never measure distance as a negative number, we will never get a negative number in the range.

Example 3.57. Graph: f(x)=xf(x)=|x|.

We choose xx-values. We substitute them in and then create a chart.

| xx | f(x)=xf(x)=|x| | (x,f(x))(x,f(x)) | | —: | —: | :—: | | 3-3 | 33 | (3,3)(-3,3) | | 2-2 | 22 | (2,2)(-2,2) | | 1-1 | 11 | (1,1)(-1,1) | | 00 | 00 | (0,0)(0,0) | | 11 | 11 | (1,1)(1,1) | | 22 | 22 | (2,2)(2,2) | | 33 | 33 | (3,3)(3,3) |

xy−4−3−2−11234−112345

Graph: f(x)=xf(x)=|x|. Find f(3)f(-3).

Graph: f(x)=xf(x)=-|x|. Find f(3)f(-3).

Absolute Value Function. For f(x)=xf(x)=|x|, the domain is (,)(-\infty,\infty) and the range is [0,)[0,\infty).

Read information from a graph of a function

In the sciences and business, data is often collected and then graphed. The graph is analyzed, information is obtained from the graph and then often predictions are made from the data.

We will start by reading the domain and range of a function from its graph.

Remember the domain is the set of all the xx-values in the ordered pairs in the function. To find the domain we look at the graph and find all the values of xx that have a corresponding value on the graph. Follow the value xx up or down vertically. If you hit the graph of the function then xx is in the domain.

Remember the range is the set of all the yy-values in the ordered pairs in the function. To find the range we look at the graph and find all the values of yy that have a corresponding value on the graph. Follow the value yy left or right horizontally. If you hit the graph of the function then yy is in the range.

Example 3.58. Use the graph of the function to find its domain and range. Write the domain and range in interval notation.

xy−6−4−2246−4−2246

To find the domain we look at the graph and find all the values of xx that correspond to a point on the graph. The domain is highlighted in red on the graph. The domain is [3,3][-3,3].

To find the range we look at the graph and find all the values of yy that correspond to a point on the graph. The range is highlighted in blue on the graph. The range is [1,3][-1,3].

Use the graph of the function to find its domain and range. Write the domain and range in interval notation. The graph has closed endpoints at (5,4)(-5,-4) and (1,2)(1,2) and contains one point for every xx between them. Enter the domain.

Use the graph of the function to find its domain and range. Write the domain and range in interval notation. The graph has closed endpoints at (2,1)(-2,1) and (4,5)(4,-5) and reaches a maximum of 33. Enter the range.

We are now going to read information from the graph that you may see in future math classes.

Example 3.59. Use the graph of the function to find the indicated values.

The graph crosses the xx-axis at 2π,π,0,π,2π-2\pi,-\pi,0,\pi,2\pi. It has maxima at (32π,1)(-\tfrac{3}{2}\pi,1) and (12π,1)(\tfrac{1}{2}\pi,1) and minima at (12π,1)(-\tfrac{1}{2}\pi,-1) and (32π,1)(\tfrac{3}{2}\pi,-1).

(a) When x=0x=0, the function crosses the yy-axis at 0. So, f(0)=0f(0)=0.

(b) When x=32πx=\tfrac{3}{2}\pi, the yy-value of the function is 1-1. So, f(32π)=1f(\tfrac{3}{2}\pi)=-1.

(c) When x=12πx=-\tfrac{1}{2}\pi, the yy-value of the function is 1-1. So, f(12π)=1f(-\tfrac{1}{2}\pi)=-1.

(d) The function is 0 at the points (2π,0),(π,0),(0,0),(π,0),(2π,0)(-2\pi,0),(-\pi,0),(0,0),(\pi,0), (2\pi,0). The xx-values when f(x)=0f(x)=0 are 2π,π,0,π,2π-2\pi,-\pi,0,\pi,2\pi.

(e) The xx-intercepts occur when y=0y=0. So the xx-intercepts occur when f(x)=0f(x)=0. The xx-intercepts are (2π,0),(π,0),(0,0),(π,0),(2π,0)(-2\pi,0),(-\pi,0),(0,0),(\pi,0),(2\pi,0).

(f) The yy-intercepts occur when x=0x=0. So the yy-intercepts occur at f(0)f(0). The yy-intercept is (0,0)(0,0).

(g) This function has a value for all values of xx. Therefore, the domain in interval notation is (,)(-\infty,\infty).

(h) This function values, or yy-values go from 1-1 to 1. Therefore, the range, in interval notation, is [1,1][-1,1].

Use the graph of the function to find the indicated value. The graph has a maximum at (12π,2)(\tfrac{1}{2}\pi,2). Find f(12π)f(\tfrac{1}{2}\pi).

Use the graph of the function to find the indicated value. The graph has the yy-intercept (0,1)(0,1). Find f(0)f(0).

Key terms. The vertical line test determines whether a graph represents a function; the graph of a function is the graph of all its ordered pairs (x,f(x))(x,f(x)); the basic functions in this section are the linear function, constant function, identity function, square function, cube function, square root function, and absolute value function.

Adapted from Intermediate Algebra 2e, Section 3.6, by Lynn Marecek and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at OpenStax. Changes: converted Try It exercises to interactive checks and recreated graphs for accessible web presentation.