Paul's Online Notes
Paul's Online Notes
Home / Algebra / Graphing and Functions / Graphing Functions
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 3.5 : Graphing Functions

Now we need to discuss graphing functions. If we recall from the previous section we said that \(f\left( x \right)\) is nothing more than a fancy way of writing \(y\). This means that we already know how to graph functions. We graph functions in exactly the same way that we graph equations. If we know ahead of time what the function is a graph of we can use that information to help us with the graph and if we don’t know what the function is ahead of time then all we need to do is plug in some \(x\)’s compute the value of the function (which is really a \(y\) value) and then plot the points.

Example 1 Sketch the graph of \(f\left( x \right) = {\left( {x - 1} \right)^3} + 1\).
Show Solution

Now, as we talked about when we first looked at graphing earlier in this chapter we’ll need to pick values of \(x\) to plug in and knowing the values to pick really only comes with experience. Therefore, don’t worry so much about the values of \(x\) that we’re using here. By the end of this chapter you’ll also be able to correctly pick these values.

Here are the function evaluations.

\(x\) \(f(x)\) \(\left( {x,y} \right)\)
-1 -7 \(\left( { - 1, - 7} \right)\)
0 0 \(\left( {0,0} \right)\)
1 1 \(\left( {1,1} \right)\)
2 2 \(\left( {2,2} \right)\)
3 9 \(\left( {3,9} \right)\)

Here is the sketch of the graph.

The coordinate system for this graph has a domain from -1 to 3 and a range from -6 to 9.  The left most point is at (-1, -7) and the graph increases as it moves to the right and cupped slightly downwards.  The graph goes through (0,0) and then goes through (1,1) before continuing to increase only now it is cupped slightly upwards.  It goes through the point (2,2) and ends at the point (3,9).

So, graphing functions is pretty much the same as graphing equations.

There is one function that we’ve seen to this point that we didn’t really see anything like when we were graphing equations in the first part of this chapter. That is piecewise functions. So, we should graph a couple of these to make sure that we can graph them as well.

Example 2 Sketch the graph of the following piecewise function. \[g\left( x \right) = \left\{ {\begin{array}{*{20}{l}}{ - {x^2} + 4}&{{\mbox{if }}x < 1}\\{2x - 1}&{{\mbox{if }}x \ge 1}\end{array}} \right.\]
Show Solution

Okay, now when we are graphing piecewise functions we are really graphing several functions at once, except we are only going to graph them on very specific intervals. In this case we will be graphing the following two functions,

\[\begin{align*} - {x^2} + 4\hspace{0.25in} & {\mbox{on}}\hspace{0.25in}x < 1\\ 2x - 1\hspace{0.25in} & {\mbox{on}}\hspace{0.25in}x \ge 1\end{align*}\]

We’ll need to be a little careful with what is going on right at \(x = 1\) since technically that will only be valid for the bottom function. However, we’ll deal with that at the very end when we actually do the graph. For now, we will use \(x = 1\) in both functions.

The first thing to do here is to get a table of values for each function on the specified range and again we will use \(x = 1\) in both even though technically it only should be used with the bottom function.

\(x\) \( - {x^2} + 4\) \(\left( {x,y} \right)\)
-2 0 \(\left( { - 2,0} \right)\)
-1 3 \(\left( { - 1,3} \right)\)
0 4 \(\left( {0,4} \right)\)
1 3 \(\left( {1,3} \right)\)

\(x\) \(2x - 1\) \(\left( {x,y} \right)\)
1 1 \(\left( {1,1} \right)\)
2 3 \(\left( {2,3} \right)\)
3 5 \(\left( {3,5} \right)\)

Here is a sketch of the graph and notice how we denoted the points at \(x = 1\). For the top function we used an open dot for the point at \(x = 1\) and for the bottom function we used a closed dot at \(x = 1\). In this way we make it clear on the graph that only the bottom function really has a point at \(x = 1\).

The coordinate system for this graph has a domain from -2 to 3 and a range from -2 to 6.  The graph starts in the 3rd quadrant and increases going through the x-axis at (-2,0).  It continues to increase until reaching a peak at (0,4) and then starts to decrease into the 1st quadrant and ending with an open dot at (1,3).  Below this point is a closed dot at (1,1) and increases through the point (3,5).

Notice that since the two graphs didn’t meet at \(x = 1\) we left a blank space in the graph. Do NOT connect these two points with a line. There really does need to be a break there to signify that the two portions do not meet at \(x = 1\).

Sometimes the two portions will meet at these points and at other times they won’t. We shouldn’t ever expect them to meet or not to meet until we’ve actually sketched the graph.

Let’s take a look at another example of a piecewise function.

Example 3 Sketch the graph of the following piecewise function. \[h\left( x \right) = \left\{ {\begin{array}{*{20}{l}}{x + 3}&{{\mbox{if }}\,x < - 2}\\{{x^2}}&{{\mbox{if }} - 2 \le x < 1}\\{ - x + 2}&{{\mbox{if }}\,x \ge 1}\end{array}} \right.\]
Show Solution

In this case we will be graphing three functions on the ranges given above. So, as with the previous example we will get function values for each function in its specified range and we will include the endpoints of each range in each computation. When we graph we will acknowledge which function the endpoint actually belongs with by using a closed dot as we did previously. Also, the top and bottom functions are lines and so we don’t really need more than two points for these two. We’ll get a couple more points for the middle function.

\(x\) \(x + 3\) \(\left( {x,y} \right)\)
-3 0 \(\left( { - 3,0} \right)\)
-2 1 \(\left( { - 2,1} \right)\)

\(x\) \({x^2}\) \(\left( {x,y} \right)\)
-2 4 \(\left( { - 2,4} \right)\)
-1 1 \(\left( { - 1,1} \right)\)
0 0 \(\left( {0,0} \right)\)
1 1 \(\left( {1,1} \right)\)

\(x\) \( - x + 2\) \(\left( {x,y} \right)\)
1 1 \(\left( {1,1} \right)\)
2 0 \(\left( {2,0} \right)\)

Here is the sketch of the graph.

The coordinate system for this graph has a domain from -3 to 2 and a range from 0 to 4.  The graph starts in the 3rd quadrant and is a line that goes through the x-axis at (-3,0) and ends at an open dot at (-2,1).  Above this is a close dot at (-2,4) and the graph decreases down to a valley at (0,0) and then increases until reaching a closed dot at (1,1).  At this point a line then decreases from (1,1) and goes through the x-axis at (2,0).

Note that in this case two of the portions met at the breaking point \(x = 1\) and at the other breaking point, \(x = - 2\), they didn’t meet up. As noted in the previous example sometimes they meet up and sometimes they won’t.