Graphs of Functions

Learning goals

  • Read the graph as every pair (x,f(x))(x, f(x))
  • Build a graph from a table of inputs and outputs
  • Find f(a)f(a) by moving up or down to the curve and across
  • Locate any intercepts, where the graph meets an axis
  • Take the domain as horizontal spread and the range as vertical
  • Say where a function increases, decreases, and turns

The graph of a function is a picture of every input and output

Take f(x)=x2−2x−3f(x) = x^2 - 2x - 3. The input 22 gives f(2)=4−4−3=−3f(2) = 4 - 4 - 3 = -3, so the graph includes the point (2,−3)(2, -3). Every other allowed input produces another point the same way, and together all of those points make up the graph.

The graph of a function ff is the set of all points (x,f(x))(x,f(x)) for inputs xx in its domain; it has no other points. The first coordinate is the input and the second is its output. Thus graphing ff means graphing y=f(x)y=f(x), using the same methods you used for lines and parabolas.

At any allowed input aa, the graph has exactly one point, (a,f(a))(a,f(a)). Its height, which can be negative, is f(a)f(a). This is the vertical line test from What Is a Function?: a vertical line meets the graph at most once, because one input has only one output.

A point lies on the graph exactly when y=f(x)y = f(x)#

For the rule above, f(−3)=12f(-3)=12. Then (−3,12)(-3,12) lies on the graph, but (−3,1)(-3,1) does not: its height 11 is not the output f(−3)=12f(-3)=12. Conversely, reading (−3,12)(-3,12) tells us that f(−3)=12f(-3)=12.

Now let aa be any input in the domain. If (a,b)(a,b) is on the graph, it must be the point (a,f(a))(a,f(a)), so its second coordinate is b=f(a)b=f(a). Conversely, if b=f(a)b=f(a), then (a,b)(a,b) is exactly (a,f(a))(a,f(a)), one of the graph’s points. Both directions hold:

(a,b) is on the graph⟺b=f(a).\begin{aligned} &(a,b)\text{ is on the graph}\\ &\qquad\Longleftrightarrow b=f(a). \end{aligned}

If you fix an input aa, you can read f(a)f(a) as a height. If you fix a height bb instead, you can find every input where the horizontal line y=by=b meets the graph. These are the two readings we will use throughout the lesson.

A point (a, f(a)) on the graph of a functionA rising curve with one marked point whose horizontal position is the input a and whose height is the output f(a), shown by dashed guide lines to the two axes.xy(a, f(a))af(a)
Every point on the graph of f has the form (a, f(a)): its horizontal position is the input a, and its vertical coordinate is the output f(a). Move vertically to the horizontal axis to read the input, and straight across to the vertical axis to read the output.

Building a graph from a table

Choose several inputs, calculate their outputs, and plot the points (x,f(x))(x,f(x)). A table gives only those points; to know what happens between them, you need the rule. Join points with a line when the rule is linear, or with a parabola when it is quadratic.

For a known line or parabola, a useful table includes negative inputs, zero, and positive inputs. Choose points around any intercept or turning point you want to show.

Worked example 1 Graph f(x)=x2−2x−3f(x) = x^2 - 2x - 3 from a table

The rule squares the input, subtracts twice the input, then subtracts 33. Because the highest power of xx is a square, you already know the graph will be a parabola. Pick a spread of inputs and evaluate, keeping the parentheses so the signs are safe.

f(−1)=(−1)2−2(−1)−3=1+2−3=0.f(-1) = (-1)^2 - 2(-1) - 3 = 1 + 2 - 3 = 0.f(0)=0−0−3=−3,f(1)=1−2−3=−4,f(2)=4−4−3=−3.\begin{aligned} f(0) &= 0 - 0 - 3 = -3, \\ f(1) &= 1 - 2 - 3 = -4, \\ f(2) &= 4 - 4 - 3 = -3. \end{aligned}f(3)=9−6−3=0.f(3) = 9 - 6 - 3 = 0.

Collect the input-output pairs in a table so each point is easy to plot:

xx−1-100112233
f(x)f(x)00−3-3−4-4−3-300

Plot the five points (−1,0)(-1, 0), (0,−3)(0, -3), (1,−4)(1, -4), (2,−3)(2, -3), and (3,0)(3, 0). They do not lie on a line; they bend into a smooth U. Joining them gives the parabola that is the graph of ff, dipping to its lowest point at (1,−4)(1, -4) and rising on both sides.

The graph of f(x) = x^2 - 2x - 3A parabola through the five plotted table points, with lowest point at (1, -4) and x-intercepts at -1 and 3.xy-2-11231-1-3-4(-1, 0)(3, 0)(0, -3)(1, -4)y = f(x)
The graph of f(x) = x squared minus 2x minus 3, built from the five table points. It is a parabola with its lowest point at (1, -4). Every point on the curve has the form (x, f(x)), and the two x-intercepts and the y-intercept are marked.

Check your understanding

A function hh is given by this table of inputs and outputs.

x−2−101h(x)30−10\begin{array}{c|cccc} x & -2 & -1 & 0 & 1 \\ \hline h(x) & 3 & 0 & -1 & 0 \end{array}

Building the graph means plotting each input together with the output written beneath it. Which point belongs on the graph of hh?

Answer choices

Reading a value off the graph

Keep track of whether the question gives you an input or an output.

Finding f(a)f(a) from the picture. Locate the input aa on the horizontal axis, move straight up or down until you meet the curve, then read the height there against the vertical axis. That height is f(a)f(a), because the point you land on is (a,f(a))(a, f(a)).

Solving f(x)=bf(x)=b from the picture. Find the height bb on the vertical axis and follow the horizontal line y=by=b. Read the input at every meeting with the graph. These inputs solve the equation. There can be several, one, or none, even though each input has only one output.

Solving f(x) = -3 by reading across the graphA dashed horizontal line at y = -3 crosses the parabola at the points at x = 0 and x = 2, the two solutions of f(x) = -3.xy2-3y = -3x = 0x = 2
Reading the graph of f(x) = x squared minus 2x minus 3 at the height y = -3. The horizontal line y = -3 meets the curve at two points, at x = 0 and x = 2, so f(x) = -3 has the two solutions x = 0 and x = 2. Read the other way, going down from x = 2 to the curve gives the height f(2) = -3.

Worked example 2 Reading f(2)f(2) and solving f(x)=−3f(x) = -3 from the graph

Use the graph of f(x)=x2−2x−3f(x) = x^2 - 2x - 3 above, without any algebra.

To find f(2)f(2), start at x=2x = 2 on the horizontal axis and move straight down to the curve. You land on the point (2,−3)(2, -3), whose height is −3-3, so

f(2)=−3.f(2) = -3.

To solve f(x)=−3f(x) = -3, do the reverse. Find −3-3 on the vertical axis and slide across the horizontal line y=−3y = -3. It meets the parabola at two points, the ones at x=0x = 0 and x=2x = 2. Reading the corresponding input on the horizontal axis gives the two solutions

f(x)=−3⟹x=0  or  x=2.f(x) = -3 \quad \Longrightarrow \quad x = 0 \ \text{ or } \ x = 2.

The same value −3-3 is an output of the function at two different inputs, which is why the horizontal line crosses twice. A quick check confirms both: f(0)=−3f(0) = -3 and f(2)=4−4−3=−3f(2) = 4 - 4 - 3 = -3.

Check your understanding

The graph of a function gg passes through the points (−2,5)(-2, 5), (−1,0)(-1, 0), (0,−3)(0, -3), (1,−4)(1, -4), and (2,−3)(2, -3). What is g(−2)g(-2)?

Answer choices

Check your understanding

Using the same graph of gg, through (−2,5)(-2, 5), (−1,0)(-1, 0), (0,−3)(0, -3), (1,−4)(1, -4), and (2,−3)(2, -3), which of these five points have g(x)=−3g(x) = -3?

Answer choices

Intercepts and where the graph meets the axes

Two special readings come up so often that they have their own names.

The y-intercept is the point where the graph meets the vertical axis. Every point on that axis has x=0x = 0, so when 00 is an allowed input, the y-intercept is the single point (0,f(0))(0, f(0)), found by evaluating f(0)f(0). A function has at most one y-intercept: either 00 is not an input at all, or it is one input with one output.

The x-intercepts are the points where the graph meets the horizontal axis. Every point on that axis has y=0y = 0, so an x-intercept is a point (a,0)(a, 0) with f(a)=0f(a) = 0. Finding the x-intercepts therefore means solving the equation f(x)=0f(x) = 0, which is the b=0b = 0 case of the reading above. These inputs are also called the zeros or roots of the function, and there may be several, one, or none.

Worked example 3 Find the intercepts of f(x)=x2−2x−3f(x) = x^2 - 2x - 3

The graph plotted earlier already marks these crossings: (0,−3)(0, -3) on the vertical axis, and (−1,0)(-1, 0) and (3,0)(3, 0) on the horizontal axis. Here is how to find each one directly from the rule, which confirms what the picture already shows.

For the y-intercept, evaluate the rule at x=0x = 0:

f(0)=0−0−3=−3,f(0) = 0 - 0 - 3 = -3,

so the y-intercept is the point (0,−3)(0, -3).

For the x-intercepts, set the output to 00 and solve f(x)=0f(x) = 0. The rule factors, which is the fastest route to its zeros:

x2−2x−3=0⟹(x−3)(x+1)=0.x^2 - 2x - 3 = 0 \quad \Longrightarrow \quad (x - 3)(x + 1) = 0.

A product is zero exactly when one of its factors is zero, so x=3x = 3 or x=−1x = -1. The x-intercepts are (3,0)(3, 0) and (−1,0)(-1, 0).

Check your understanding

The graph of a function kk passes through (−2,0)(-2, 0), (−1,−3)(-1, -3), (0,−4)(0, -4), (1,−3)(1, -3), and (2,0)(2, 0). What is the y-intercept?

Answer choices

Check your understanding

Using the same graph of kk, through (−2,0)(-2, 0), (−1,−3)(-1, -3), (0,−4)(0, -4), (1,−3)(1, -3), and (2,0)(2, 0), which of these listed points are x-intercepts?

Answer choices

Domain and range from a graph

The domain is the set of allowed inputs; the range is the set of outputs actually reached. Read the domain along the horizontal axis and the range along the vertical axis. A full parabola continues left and right forever, so its domain is all real numbers. A restricted piece may stop at endpoints.

A filled dot includes its point; a hollow dot leaves that point out. For example, a curve running from a hollow point at x=−1x=-1 to a filled point at x=3x=3, with every input between them, has domain −1<x≤3-1<x\le3. A curve that runs off the edge of the drawing, often marked with an arrow, continues beyond it. Use the curve and these marks together when deciding which values belong.

Domain and range of a curve with endpointsA bounded parabola arc from (-1, 0) to (3, 0) with lowest point (1, -4); its domain runs from -1 to 3 and its range from -4 to 0.xy-13-4(-1, 0)(3, 0)(1, -4)
Reading domain and range from a graph. This curve is the same rule but defined only for inputs from -1 to 3, so its domain is -1 is less than or equal to x is less than or equal to 3. The heights it reaches run from the low point -4 up to 0, so its range is -4 is less than or equal to y is less than or equal to 0.

Worked example 4 Read the domain and range from the graph

The curve above is drawn only between its two filled endpoints, (−1,0)(-1, 0) on the left and (3,0)(3, 0) on the right, so those endpoints fence in the inputs.

Sweeping left to right, the graph occupies every horizontal position from x=−1x = -1 to x=3x = 3, and nothing outside. That horizontal spread is the domain:

domain ⁣:−1≤x≤3.\text{domain} \colon \quad -1 \le x \le 3.

Sweeping bottom to top, the lowest the curve reaches is the valley at height −4-4, and the highest is 00, shared by the two endpoints. That vertical spread is the range:

range ⁣:−4≤y≤0.\text{range} \colon \quad -4 \le y \le 0.

Notice the domain is read along the horizontal axis and the range along the vertical axis. If instead the parabola were drawn with arrows running off both sides, the inputs would never stop and the domain would be all real numbers. With those arrows, the range would be y≥−4y \ge -4, every height from the low point upward.

Check your understanding

A graph is one continuous curve, drawn only between the filled endpoints (−3,1)(-3, 1) and (4,1)(4, 1) and reaching every height in between as it goes. Over that stretch its lowest height is −2-2 and its highest height is 55. What is the range?

Answer choices

Check your understanding

Using the same continuous graph, drawn only between the filled endpoints (−3,1)(-3, 1) and (4,1)(4, 1), what is the domain?

Answer choices

Increasing and decreasing

The last thing a picture shows at a glance is the function’s direction. Read the graph the way you read a sentence, left to right, in the direction of increasing xx. Where the curve rises as you move right, the outputs are getting larger, and the function is increasing there. Where the curve falls as you move right, the outputs are getting smaller, and the function is decreasing.

More precisely, a function is increasing on an interval if any two inputs a<ba<b there satisfy f(a)<f(b)f(a)<f(b). It is decreasing if a<ba<b always gives f(a)>f(b)f(a)>f(b) instead.

A turning point is where the curve changes from falling to rising, or from rising to falling. A valley gives a local minimum, lower than nearby values; a hill gives a local maximum, higher than nearby values. The lowest or highest value on the whole domain is an overall minimum or maximum. A graph can have more than one valley or hill.

Where f(x) = x^2 - 2x - 3 is increasing and decreasingThe parabola falls to its minimum at (1, -4), where it turns, and rises afterward; the left branch is labeled decreasing and the right branch increasing.xy1decreasingincreasingminimum (1, -4)
The graph of f(x) = x squared minus 2x minus 3 falls as x moves from the left up to the turning point at (1, -4), then rises after it. So f is decreasing for x less than 1 and increasing for x greater than 1, and the turning point (1, -4) is its minimum.

Worked example 5 Where is f(x)=x2−2x−3f(x) = x^2 - 2x - 3 increasing?

Trace the graph from left to right. Starting far to the left, the curve comes down steadily, so the outputs are shrinking and ff is decreasing. It keeps falling until it reaches the lowest point at (1,−4)(1, -4), then it turns and climbs. To the right of that turning point the outputs grow, so ff is increasing.

Reading the two stretches off the horizontal axis, the turning happens at x=1x = 1, so

f is decreasing for x<1and increasing for x>1.f \text{ is decreasing for } x < 1 \quad \text{and increasing for } x > 1.

The turning point (1,−4)(1, -4) is the minimum point, and −4-4 is the single lowest output the function ever produces. This is the same value you would get by hunting for the vertex algebraically, but here you simply saw it on the picture.

Check your understanding

The graph of a function falls as xx goes from −4-4 up to 22, then rises for xx greater than 22. On which interval is the function increasing?

Answer choices

Check your understanding

Using the same graph (falls as xx goes from −4-4 up to 22, then rises for xx greater than 22), on which interval is the function decreasing, and what kind of turning point sits at x=2x = 2?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

How could an engineer watch pressure change inside a working steam engine? A reading at one moment could not show the whole piston stroke. In 17961796, Boulton and Watt introduced an instrument that turned the changing pressure into a picture.

John Southern, one of James Watt’s staff, is credited with adding the recording arrangement: a pencil moved with a small pressure-sensitive piston while a sheet of paper moved across its path. The engine’s cycle drew a loop. This indicator diagram helped engineers adjust the valves and work out how much work the engine delivered during a stroke.

The picture was so useful that Boulton and Watt kept it secret, entrusting the instrument only to their own staff. The Science Museum’s surviving indicator records that story. With the moving pencil, an engineer could see on paper how the pressure in the cylinder changed through the stroke.

The loop is not itself the graph of pressure as a function of piston position: one position can have different pressures on the outward and return strokes. A vertical line can meet the loop twice. A function’s graph has the stricter rule of one output for each input.

Your progress

See all your progress →