Sub topic 3
Reading and Plotting Graphs
Prerequisites
Assume you can plot ordered pairs, solve basic equations, and read positive and negative numbers on a coordinate plane. You should also know that a function assigns an output \(y\) to each allowed input \(x\).
A graph shows this relationship visually. The horizontal axis is the \(x\)-axis, and the vertical axis is the \(y\)-axis. The point \((a,b)\) means that the function has input \(a\) and output \(b\), so \(f(a)=b\).
Plotting a Function
To plot a function:
- Choose several allowed \(x\)-values.
- Calculate the corresponding \(y=f(x)\).
- Plot each point \((x,y)\).
- Join the points only when the function is continuous over that interval.
For example, consider \(f(x)=2x+1\).
| \(x\) | \(f(x)=2x+1\) | Point |
|---|---|---|
| -2 | -3 | \((-2,-3)\) |
| -1 | -1 | \((-1,-1)\) |
| 0 | 1 | \((0,1)\) |
| 1 | 3 | \((1,3)\) |
These points lie on a straight line. The graph crosses the \(y\)-axis at \((0,1)\). It crosses the \(x\)-axis when \(2x+1=0\), giving \(x=-\frac12\).
def f(x):
return 2 * x + 1
for x in [-2, -1, 0, 1]:
print((x, f(x)))Reading a Graph
A graph lets you answer questions without calculating every value.
- To find \(f(2)\), start at \(x=2\), move vertically to the graph, and read the corresponding \(y\)-value.
- To find the roots, locate where the graph crosses or touches the \(x\)-axis. At these points, \(f(x)=0\).
- To find the \(y\)-intercept, locate the point where \(x=0\).
- To compare \(f(a)\) and \(f(b)\), compare the heights of the graph above \(x=a\) and \(x=b\).
- A horizontal line test checks whether a function has an inverse: every horizontal line must meet the graph at most once.
Important Graph Details
An open circle means that the point is excluded. A filled circle means that the point is included. An arrow indicates that the graph continues beyond the visible window.
When plotting a piece of a graph, do not join points across a break, such as a missing value or a vertical asymptote. For a discrete function, plot separate points rather than drawing a continuous curve.
Exercise
A graph contains the points (-2, 4), (0, 1), and (2, 4). What is the value of f(0), and what symmetry do these points suggest?
Show answer
f(0)=1. The equal values f(-2)=f(2)=4 suggest symmetry about the y-axis.