Page 2.5: Graphing Types of Functions
- Graph linear functions.
- Graph quadratic functions.
- Graph radical functions.
Introduction
When both the input (independent variable) and the output (dependent variable) are real numbers, a function can be represented by a coordinate graph. The input is plotted on the x-axis and the output is plotted on the y-axis.
Linear Functions
Definition: A linear function , \(f\), refers to a function \(f: \mathbb{R} \rightarrow \mathbb{R} \) of the form \( f(x) = mx + b \). We call \(m\) the slope of the function and \(b\) the y-intercept of the function.
Allow us to graph a few linear functions. A helpful first step in graphing a function is to make a table of values. This is particularly useful when you don’t know the general shape the function will have. You probably already know that a linear function will be a straight line, but let’s make a table first to see how it can be helpful.
Make a table of values for \(\ f(x)=3 x+2\).
Solution
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline & \end{array}\) |
Make a two-column table. Label the columns \(\ x\) and \(\ f(x)\). |
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & \\ -1 & \\ 0 & \\ 1 & \\ 3 & \end{array}\) |
Choose several values for \(\ x\) and put them as separate rows in the \(\ x\) column. Tip: It’s always good to include 0, positive values, and negative values, if you can. |
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & -4 \\ -1 & -1 \\ 0 & 2 \\ 1 & 5 \\ 3 & 11 \end{array}\) |
Evaluate the function for each value of \(\ x\), and write the result in the \(\ f(x)\) column next to the \(\ x\) value you used. When \(\ x=0, f(0)=3(0)+2=2\), \(\ f(1)=3(1)+2=5\), \(\ f(-1)=3(-1)+2=-3+2=-1\) and so on. |
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & -4 \\ -1 & -1 \\ 0 & 2 \\ 1 & 5 \\ 3 & 11 \end{array}\) |
(Note that your table of values may be different from someone else’s. You may each choose different numbers for \(\ x\).) |
Now that you have a table of values, you can use them to help you draw both the shape and location of the function. Important: The graph of the function will show all possible values of \(\ x\) and the corresponding values of \(\ y\). This is why the graph is a line and not just the dots that make up the points in our table.
Graph \(\ f(x)=3 x+2\).
Solution
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & -4 \\ -1 & -1 \\ 0 & 2 \\ 1 & 5 \\ 3 & 11 \end{array}\) |
Start with a table of values, like the one in the previous example. If you think of \(\ f(x)\) as \(\ y\), each row forms an ordered pair that you can plot on a coordinate grid. |
| Plot the points. | |
| Since the points lie on a line, use a straight edge to draw the line. Try to go through each point without moving the straight edge. |
Let’s try another one.
Graph \(\ f(x)=-x+1\).
Solution
|
\(\ \begin{array}{c}
\(\ \begin{array}{c|c}
|
Start with a table of values. You can choose different values for \(\ x\), but once again, it’s helpful to include 0, some positive values, and some negative values. f you think of \(\ f(x)\) as \(\ y\), each row forms an ordered pair that you can plot on a coordinate grid. |
| Plot the points. | |
| Since the points lie on a line, use a straight edge to draw the line. Try to go through each point without moving the straight edge. |
These graphs are representations of a linear function. Remember that a function is a correspondence between two variables, such as \(\ x\) and \(\ y\).
Graph \(\ f(x)=2 x-1\). Which of the following graphs is correct?
- Answer
-
-
Incorrect.
Two good points to check are when \(\ x=0\) and when \(\ y=0\). In this case, that would be \(\ (0,-1)\) and \(\ \left(\frac{1}{2}, 0\right)\). The correct answer is Graph D.
-
Incorrect.
Two good points to check are when \(\ x=0\) and when \(\ y=0\). In this case, that would be \(\ (0,-1)\) and \(\ \left(\frac{1}{2}, 0\right)\). The correct answer is Graph D.
-
Incorrect.
Two good points to check are when \(\ x=0\) and when \(\ y=0\). In this case, that would be \(\ (0,-1)\) and \(\ \left(\frac{1}{2}, 0\right)\). The correct answer is Graph D.
-
Correct.
Two good points to check are when \(\ x=0\) and when \(\ y=0\). In this case, that would be \(\ (0,-1)\) and \(\ \left(\frac{1}{2}, 0\right)\). So, Graph D is the correct answer.
-
Incorrect.
Graph the function \(f(x) = 5 \).
- Answer
-
Note that in general, that if \(c\) denotes some constant, then the line \(y = c\) is a horizontal line passing through \(c\) on the y-axis.
Here is a collection of some helpful facts to remember when it comes to linear lines:
For the graph of \(y = mx + b\),
1) the slope, \(m\) controls the direction and steepness of the line. If \(m\) is positive, then the graph rises upwards from left to right. As \(m\) increases, the rise becomes more steep (vertical). On the other hand, if \(m\) is negative, then the graph decreases or points down from left to right. As \(m\) becomes larger in the negative direction, the graph also becomes more steep (vertical). These properties are illustrated in the following two diagrams:
2) the \(y\)-intercept controls where the graph crosses the \(y\) axis.
Quadratic Functions
Nonlinear functions can also be graphed. It’s helpful to have an idea what the shape should be, so you can be sure that you’ve chosen enough points to plot as a guide. Let’s start with the most basic quadratic function, \(\ f(x)=x^{2}\).
Graph \(\ f(x)=x^{2}\).
Solution
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & 4 \\ -1 & 1 \\ 0 & 0 \\ 1 & 1 \\ 2 & 4 \end{array}\) |
Start with a table of values. Then think of the table as ordered pairs. |
| Plot the points. | |
| Since the points are not on a line, you can’t use a straight edge. Connect the points as best you can, using a smooth curve (not a series of straight lines). You may want to find and plot additional points (such as the ones in blue here). |
Notice that the shape is like the letter U. This is called a parabola . One-half of the parabola is a mirror image of the other half. The line that goes down the middle is called the line of reflection . In this case that line is the y-axis.
The equations for quadratic functions have the form \(\ f(x)=a x^{2}+b x+c\) where \(\ a \neq 0\). In the basic graph above, \(\ a=1\), \(\ b=0\), and \(\ c=0\). Here are some graphs with different values for \(\ a\), \(\ b\), and \(\ c\). Notice how each value changes the shape and location of the parabola.
Changing \(\ a\) changes the width of the parabola and whether it opens up \(\ (a>0)\) or down \(\ (a<0)\).
If there is no \(\ b\) term, changing \(\ c\) moves the parabola up or down so that the \(\ y\) intercept is \(\ (0, c)\).
Changing \(\ b\) moves the line of reflection. The way it moves depends also on \(\ a\).
For \(\ f(x)=a x^{2}+b x+c\), where \(\ a\), \(\ b\), and \(\ c\) are real numbers.
- The parabola opens upward if \(\ a>0\) and downward if \(\ a<0\).
- \(\ a\) changes the width of the parabola. The parabola gets narrower if \(\ |a|>1\) and wider if \(\ |a|<1\).
- The vertex depends on the values of \(\ a\), \(\ b\), and \(\ c\). The vertex is \(\ \left(\frac{-b}{2 a}, f\left(\frac{-b}{2 a}\right)\right)\).
Graph \(\ f(x)=-2 x^{2}+3 x-3\).
Solution
|
\(\ a=-2\), so the graph will open down and be thinner than \(\ f(x)=x^{2}\). \(\ c=-3\), so it will move to intercept the y-axis at \(\ (0,-3)\). |
Before making a table of values, look at the values of \(\ a\) and \(\ c\) to get a general idea of what the graph should look like. |
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline-2 & -17 \\ -1 & -8 \\ 0 & -3 \\ 1 & -2 \\ 2 & -5 \end{array}\) |
Create a table of values. Notice that in this table, the \(\ x\) values increase. The \(\ y\) values increase and then start to decrease again. That indicates a parabola. |
|
\(\ \text { Vertex formula }=\left(\frac{-b}{2 a}, f\left(\frac{-b}{2 a}\right)\right)\) x-coordinate of vertex: \(\ \frac{-b}{2 a}=\frac{-(3)}{2(-2)}=\frac{-3}{-4}=\frac{3}{4}\) y-coordinate of vertex:
\(\ \begin{array}{r}
Vertex: \(\ \left(\frac{3}{4},-\frac{15}{8}\right)\) |
To find the vertex of the parabola, use the formula \(\ \left(\frac{-b}{2 a}, f\left(\frac{-b}{2 a}\right)\right)\). Finding the vertex may make graphing the parabola easier. |
| Use the table pairs to plot points. Note the vertex, \(\ \left(\frac{3}{4},-\frac{15}{8}\right)\), in blue. | |
|
Connect the points as best you can, using a smooth curve . Remember that the parabola is two mirror images, so if your points don’t have pairs with the same value, you may want to include additional points (such as the ones in blue here). Plot points on either side of the vertex. \(\ x=\frac{1}{2}\) and \(\ x=\frac{3}{2}\) are good values to include. |
Would the graph for \(\ f(x)=-3 x^{2}+2 x-1\) open up or down, and why?
- Up, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
- Down, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
- Up, because \(\ b\) (the coefficient of \(\ x\)) is positive.
- Down, because \(\ b\) (the coefficient of \(\ x\)) is positive.
- Answer
-
-
Up, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
Incorrect. The coefficient of \(\ x^{2}\) is the correct place to look, but a negative coefficient means the graph opens down. The correct answer is down, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
-
Down, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
Correct. A negative coefficient of \(\ x^{2}\) means the graph opens down.
-
Up, because \(\ b\) (the coefficient of \(\ x\)) is positive.
Incorrect. Look at the coefficient for \(\ x^{2}\), not the coefficient for \(\ x\). The correct answer is down, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
-
Down, because \(\ b\) (the coefficient of \(\ x\)) is positive.
Incorrect. Look at the coefficient for \(\ x^{2}\), not the coefficient for \(\ x\). The correct answer is down, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
-
Up, because \(\ a\) (the coefficient of \(\ x^{2}\)) is negative.
Radical Functions
You can also graph radical functions (such as square root functions) by choosing values for \(\ x\) and finding points that will be on the graph. Again, it’s helpful to have some idea about what the graph will look like.
Think about the basic square root function, \(\ f(x)=\sqrt{x}\). Let’s take a look at a table of values for \(\ x\) and \(\ y\) and then graph the function. (Notice that all the values for \(\ x\) in the table are perfect squares. Since you are taking the square root of \(\ x\), using perfect squares makes more sense than just finding the square roots of 0 ,1, 2 ,3 ,4, etc.)
| \(\ x\) | \(\ f(x)\) |
| 0 | 0 |
| 1 | 1 |
| 4 | 2 |
| 9 | 3 |
| 16 | 4 |
Recall that \(\ x\) can never be negative here because the square root of a negative number would be imaginary, and imaginary numbers cannot be graphed. There are also no values for \(\ x\) that will result in \(\ y\) being a negative number. Take a look at the graph.
As with parabolas, multiplying and adding numbers makes some changes, but the basic shape is still the same. Here are some examples.
Multiplying \(\ \sqrt{x}\) by a positive value changes the width of the half-parabola. Multiplying \(\ \sqrt{x}\) by a negative number gives you the other half of a horizontal parabola.
Adding a value outside the radical moves the graph up or down. Think about it as adding the value to the basic \(\ y\) value of \(\ \sqrt{x}\), so a positive value added moves the graph up.
Adding a value inside the radical moves the graph left or right. Think about it as adding a value to \(\ x\) before you take the square root, so the \(\ y\) value gets moved to a different \(\ x\) value. For example, for \(\ f(x)=\sqrt{x}\), the square root is 3 if \(\ x=9\). For \(\ f(x)=\sqrt{x+1}\), the square root is 3 when \(\ x+1\) is 9, so \(\ x\) is 8. Changing \(\ x\) to \(\ x+1\) shifts the graph to the left by 1 unit (from 9 to 8). Changing \(\ x\) to \(\ x-2\) shifts the graph to the right by 2 units.
Notice that as \(\ x\) gets greater, adding or subtracting a number inside the square root has less of an effect on the value of \(\ y\)!
Graph \(\ f(x)=-2+\sqrt{x-1}\).
Solution
|
Inside the square root, you’re subtracting 1, so the graph will move to the right 1 from the basic \(\ f(x)=\sqrt{x}\) graph. You’re also adding -2 outside the square root, so the graph will move down two from the basic \(\ f(x)=\sqrt{x}\) graph. |
Before making a table of values, look at the function equation to get a general idea what the graph should look like. |
|
\(\ \begin{array}{c|c}
x & f(x) \\ \hline 1 & -2 \\ 2 & -1 \\ 5 & 0 \\ 10 & 1 \end{array}\) |
Create a table of values. Choose values that will make your calculations easy. You want \(\ x-1\) to be a perfect square, such as 0, 1, 4, 9, and so on, so you can take the square root. Since values of \(\ x\) less than 1 makes the value inside the square root negative, there will be no points on the coordinate graph to the left of \(\ x=1\). There is no need to choose \(\ x\) values less than 1 for your table! |
| Use the table pairs to plot points. | |
| Connect the points as best you can, using a smooth curve . |
Which of the following is a graph of \(\ f(x)=-2 \sqrt{x}\)?
- Answer
-
-
Incorrect.
Recall that the graph of \(\ f(x)=-\sqrt{x}\) is entirely under the x-axis, in Quadrant IV. The graph of \(\ f(x)=-2 \sqrt{x}\) will be similar but wider. The correct answer is Graph C.
-
Incorrect.
In the function \(\ f(x)=-2 \sqrt{x}\), \(\ f(0)=0\). This point is not represented on this graph. Find a graph that looks similar to Graph B, but which goes through the point \(\ (0,0)\). The correct answer is Graph C.
-
Correct.
The graph of \(\ f(x)=-2 \sqrt{x}\) will be similar to the graph of \(\ f(x)=-\sqrt{x}\), although it will be a bit wider.
-
Incorrect.
This is the graph of \(\ f(x)=2 \sqrt{x}\). The graph of \(\ f(x)=-2 \sqrt{x}\) will be below the x-axis. The correct answer is Graph C.
-
Incorrect.
Summary
Creating a graph of a function is one way to understand the relationship between the inputs and outputs of that function. Creating a graph can be done by choosing values for \(\ x\), finding the corresponding \(\ y\) values, and plotting them. However, it helps to understand the basic shape of the function. Knowing the effect of changes to the basic function equation is also helpful.
One common shape you will see is a parabola. Parabolas have the equation \(\ f(x)=a x^{2}+b x+c\), where \(\ a\), \(\ b\), and \(\ c\) are real numbers and \(\ a \neq 0\). The value of \(\ a\) determines the width and the direction of the parabola, while the vertex depends on the values of \(\ a\), \(\ b\), and \(\ c\). The vertex is \(\ \left(-\frac{b}{2 a}, f\left(-\frac{b}{2 a}\right)\right)\).