# Graphs of Functions

A graph of a function is a visual representation of the function. An algebraic rule can be used to produce the graph of a function.
The algebraic rule of the function is a way of describing a set of ordered pairs. The set of ordered pairs can also be represented visually by using a graph. For example:
$f(x)=x+1$
It is used to represent the set of ordered pairs where the second coordinate is one more than the first coordinate. There are infinitely many pairs in this set, such as $(0,1),\,(1,2),\,(2,3)$, and $(3,4)$. If these points are plotted on a coordinate plane, the line through them represents all the possible ordered pairs in the function.
Functions can be graphed using a variety of methods. Some methods are more suitable for certain types of functions than others. One method that can be slow, but works for any type of function, is plotting points.

When plotting points to graph a function, it is important to plot enough points to represent the important information about the function. After plotting several points, fill in missing information as needed by plotting additional points. It is also helpful to have a general idea of the shape of the graph based on the type of function.

Step-By-Step Example
Graphing a Function by Plotting Points
Sketch the graph of the function:
$f(x)=x^2+3$
Step 1

Make a table of values by evaluating the function for several values of $x$.

$x$
$f(x)=x^{2}+3$
$y=f(x)$
$-2$
$(-2)^2+3$
$7$
$-1$
$(-1)^2+3$
$4$
$0$
$0^2+3$
$3$
$1$
$1^2+3$
$4$
$2$
$2^2+3$
$7$
Step 2

Use the table to identify the points on the graph.

$x$
$y=f(x)$
$(x, y)$
$-2$
$7$
$(-2,7)$
$-1$
$4$
$(-1,4)$
$0$
$3$
$(0,3)$
$1$
$4$
$(1,4)$
$2$
$7$
$(2,7)$
Solution
Plot the points on the coordinate plane, and draw a smooth curve through the points.
The shape of the graph is a parabola. The domain of the function is all real numbers. The range is $[3,\infty)$. The minimum value is 3. There is no maximum. The function is even. It is decreasing on the interval $(-\infty, 0)$ and increasing on the interval $(0, \infty)$.

### Vertical Line Test

The vertical line test uses vertical lines to determine whether a relation is a function.

Any two distinct points on a vertical line have the same $x$-coordinate and different $y$-coordinates. So if two or more points in a relation are on the same vertical line, then the $x$-value corresponds to multiple $y$-values. Using vertical lines on a graph to determine whether a relation is a function is called the vertical line test. If any vertical line intersects the graph in more than one point, the graph does not represent a function.

To determine whether the graph of a relation represents a function:

1. Draw or imagine vertical lines running through the graph.

2. Look for any places that a vertical line would cross or touch the graph more than one time. These represent an $x$-value that corresponds to more than one $y$-value.

• If every vertical line crosses the graph only once, the relation is a function.
• If any vertical line crosses the graph more than once, the relation is not a function.
Function Not a Function
The graph represents the relation $y=x^2$. There is no vertical line that touches the graph more than once. The relation is a function. The graph of the relation is in the shape of a circle. Each vertical line intersects the circle at two different $y$-values. Therefore, the relation is not a function.

### Piecewise Functions

A piecewise function consists of separate pieces of the same function. Each piece behaves differently based on the rules of their defined intervals.
Some functions are defined in pieces. A piecewise function has different rules applied to different intervals in the domain. To graph a piecewise function, graph the pieces separately over the intervals for which they are defined.
Step-By-Step Example
Graphing a Piecewise Function
Graph the function:
f(x)=\left\{\begin{aligned}3x+5&&x \lt 0\\4x+7&&x\ge0\end{aligned}\right.
Step 1

Analyze the first piece of the function.

When the $x$-values are less than zero, this rule applies:
$f(x)=3x+5$
The slope is 3. The $y$-intercept is 5. The interval extends to negative infinity and does not include zero.
Step 2

Analyze the second piece of the graph.

When the $x$-values are greater than or equal to zero, this equation applies:
$f(x)=4x+7$
The slope is 4. The $y$-intercept is 7. The interval extends to infinity and includes zero.
Solution

Graph the pieces together.

The first piece is:
$f(x)=3x+5$
It is a line with a slope of 3 and a $y$-intercept of 5. The interval extends to negative infinity. So, use an arrow at the left end of the graph. Since the interval does not include zero, show the $y$-intercept with an empty circle to indicate that the value is not a part of the graph. The second piece is:
$f(x)=4x+7$
It is a line with a slope of 4 and a $y$-intercept of 7. The interval extends to infinity, so use an arrow at the right end of the graph. Since the interval includes zero, show the $y$-intercept with a solid circle at the endpoint to indicate that the value is part of the graph.