Graphs of Functions

The graph of a function is the visual representation of every input-output pair. It turns abstract formulas into pictures that reveal domain, range, behavior, and much more at a glance. This section explains how to construct and read graphs of functions.

Quick Reference

Concept Description
Graph of $f$ Set of all points $(x, f(x))$ in the coordinate plane
Table of values Selected $(x, y)$ pairs used to sketch the graph
Domain (from graph) Projection of the graph onto the $x$-axis
Range (from graph) Projection of the graph onto the $y$-axis
Smooth curve Connect plotted points with a smooth, free-hand line

What Is a Graph?

If we represent the independent variable by $x$ and the corresponding output by $y = f(x)$, each pair $(x, y)$ determines a point in the coordinate plane. Plotting all such points produces the graph of the function.

The graph of a function $f$ is the set of all ordered pairs

$\{(x, f(x)) \mid x \in \operatorname{Dom}(f)\}.$

The graph gives a complete picture of the function's behavior: where it is positive or negative, where it rises or falls, what happens at the boundary of the domain, and more.

The graph of a function $f$ is shown below.

A graph of a function f. The curve crosses the x-axis at (1, 0), passes through (2, 1), falls vertically near x=0, and grows slowly for large x.
Graph of $f$.

From this graph we can read off the following facts:

  • $f(1) = 0$: the graph crosses the $x$-axis at $x = 1$.
  • $f(2)=1
  • For $x > 1$: $f(x)$ is positive and increasing.
  • For $0 < x < 1$: $f(x)$ is negative and decreases without bound as $x$ approaches $0$ from the right.
  • The domain of $f$ is $(0, \infty)$.

How to Plot a Function by Hand

To plot the graph of $f$ over an interval, follow these steps:

  1. Construct a table of values by choosing several values of $x$ in the interval and computing $y = f(x)$ for each.
  2. Plot the corresponding $(x, y)$ points in the coordinate plane.
  3. Draw a smooth free-hand curve through the points.

Plot the graph of $f(x) = x^3/2$ for $x \in [-2, 2]$.

Solution Step 1. Build a table using a few values:
$x$$-2$$-1.5$$-0.5$$0$$0.5$$1$$1.5$$2$
$y = x^3/2$$-4$$-1.6875$$-0.0625$$0$$0.0625$$1$$1.6875$$4$
Step 2. Plot these points and connect with straight lines for a rough sketch:
Graph of y = x³/2 drawn by connecting a few plotted points with straight line segments.
Graph of $y = x^3/2$ connecting a few points with straight lines.
Step 3. For a finer representation, increase the number of points:
A smooth curve graph of y = x³/2 using many plotted points.
Graph of $y = x^3/2$ with many points produces a smooth curve.

This is exactly how computer programs such as MATLAB and Python's Matplotlib plot functions: they compute many $(x, y)$ pairs and connect them with line segments. With enough points, the result looks like a smooth curve.

Reading Domain and Range from a Graph

  • The domain of $f$ is the projection of the graph onto the $x$-axis: the set of all $x$-values for which the graph has a point.
  • The range of $f$ is the projection of the graph onto the $y$-axis: the set of all $y$-values that appear on the graph.

To test whether a specific $x$-value is in the domain, draw a vertical line through that $x$. If it hits the graph, that $x$ is in the domain. To test whether a specific $y$-value is in the range, draw a horizontal line through that $y$. If it hits the graph, that $y$ is in the range.

Frequently Asked Questions

Why do we connect plotted points with a smooth curve? Most functions encountered in algebra and calculus are continuous: they have no jumps or breaks. Between the points we plotted, the function exists and takes intermediate values. The smooth curve is our best guess at those intermediate values. If the function has discontinuities (jumps or holes), we do not connect those parts smoothly. You will learn about functions with discontinuities in calculus.

How many points do I need to get an accurate graph? More points give a more accurate graph. For a simple function like $y = x^2$, five or six points often suffice. For a more complex function with multiple turning points, you may need 10 to 20 or more. Computer software uses hundreds or thousands of points.

Can a graph represent two different functions? No. A valid function graph passes the vertical line test: any vertical line intersects the graph at most once. If a curve fails this test, it does not represent a function.

Is the graph of  f(x) = x2  the same as a parabola? Yes. The graph of $y = x^2$ is the standard upward-opening parabola with vertex at the origin. More generally, $y = ax^2 + bx + c$ (with $a \neq 0$) is a parabola.