Functions and Their Graphs

Learning goals

  • Identify functions and connect their verbal, numerical, graphical, and algebraic representations
  • Determine domains and ranges while respecting formula restrictions and model boundaries
  • Evaluate piecewise functions and interpret included or excluded graph endpoints
  • Read intercepts, symmetry, and increasing or decreasing intervals from complete graphs
  • Calculate average rates with units and distinguish signed position change from total distance

One input determines one output

A function makes the output unambiguous once you choose an allowed input. Suppose a sensor records a temperature of 1818 degrees at noon and 2121 degrees at 1 p.m. Different times give different temperatures. It could also record 1818 degrees again at 2 p.m. Repeated outputs cause no problem: each time still has one recorded temperature.

A function assigns exactly one output to every input in its domain, the set of allowed inputs. Its range is the set of outputs it actually attains. The input is also called the independent variable; the output is the dependent variable.

Let T(h)T(h) be the recorded temperature at hh hours after midnight. Then T(13)=21T(13)=21 says the temperature at 1 p.m. is 2121 degrees. Read T(13)T(13) as “T of thirteen.” The parentheses identify an input; they do not mean multiplication by 1313.

The pairs (2,7)(2,7) and (5,7)(5,7) can belong to one function. The pairs (2,7)(2,7) and (2,9)(2,9) cannot: they would assign two different outputs to the same input. An equation need not define one variable as a function of another. For example, y2=xy^2=x allows both y=2y=2 and y=−2y=-2 when x=4x=4. Without an additional choice of branch, it does not define yy as a function of xx.

Check your understanding

Which collection of input-output pairs defines a function?

Answer choices

Four ways to represent a function

The same relationship can appear in words, a table, a formula, and a graph. Consider a rental service that charges 88 dollars to start and 33 dollars per hour. Assume fractional hours are charged proportionally and a rental lasts from 00 to 66 hours.

RepresentationWhat it says about this rental
WordsStart at 88 dollars, then add 33 dollars for each hour
TableC(0)=8C(0)=8, C(2)=14C(2)=14, and C(6)=26C(6)=26
FormulaC(t)=8+3tC(t)=8+3t for 0≤t≤60\le t\le6
GraphThe line segment through (0,8)(0,8) and (6,26)(6,26), including both endpoints

The formula gives every value under the stated charging rule. The table lists only three of those values. If those three numbers were measurements with no rule supplied, connecting them with straight segments would be an extra modeling assumption.

The graph of ff consists of all points (x,f(x))(x,f(x)) for inputs in its domain. This explains the vertical line test: a graph represents yy as a function of xx exactly when each vertical line meets it at most once. Two intersections would give two outputs for one input. No intersection means that input is outside the domain.

Worked example 1 Read a formula as a statement about a situation

Problem. A machine’s model for the length of ribbon remaining is R(n)=95−4nR(n)=95-4n, where nn is the number of completed decorations and RR is measured in centimeters. The machine is used for at most 2020 decorations. Find R(7)R(7) and interpret it. State the domain and decide whether its graph contains a connected segment or separate points.

Solution. For 77 decorations, substitute the input into the rule:

R(7)=95−4(7)=67.R(7)=95-4(7)=67.

The machine has 6767 centimeters of ribbon remaining after completing 77 decorations. The domain is the whole-number set {0,1,…,20}\{0,1,\ldots,20\}, because completed decorations are counted. The graph contains separate points rather than a connected segment. A formula alone does not decide whether fractional inputs make sense.

Allowed inputs and attained outputs

A formula’s operations and a situation’s meaning can both restrict its inputs. For q(x)=x+5/(x−2)q(x)=\sqrt{x+5}/(x-2), the input −6-6 fails because it would require a real square root of −1-1. The input 22 fails because the denominator would be zero. The input −5-5 works: its numerator is zero and its denominator is −7-7.

Throughout this chapter, inputs and outputs are real unless stated otherwise. When no domain is supplied for a formula, use all real inputs for which its operations are defined. An even root needs a nonnegative radicand, the expression under the root. A denominator must be nonzero. Apply all restrictions together. A stated domain or a model’s context can narrow that set further.

For qq, these restrictions give x≥−5x\ge-5 and x≠2x\ne2, so its domain is

[−5,2)∪(2,∞).[-5,2)\cup(2,\infty).

A square bracket includes an endpoint and a parenthesis excludes it. The union symbol ∪\cup joins allowed pieces. Infinity describes an unbounded direction, not an included number, so it always takes a parenthesis.

To find a range, ask which outputs occur as the input varies over the stated domain. For s(x)=x2s(x)=x^2 with −1≤x≤3-1\le x\le3, the smallest output is 00, attained at x=0x=0. The largest is 99, attained at x=3x=3. Every output between them occurs because each yy from 00 to 99 is produced by the allowed input x=yx=\sqrt y. The range is [0,9][0,9], not the interval made from the two endpoint outputs 11 and 99.

Worked example 2 Keep a restriction after simplifying

Problem. Find the domain and range of

p(x)=x2−16x−4,p(x)=\frac{x^2-16}{x-4},

with no additional domain stated.

Solution. The original denominator excludes x=4x=4. For every other real input, factoring gives

p(x)=(x−4)(x+4)x−4=x+4.p(x)=\frac{(x-4)(x+4)}{x-4}=x+4.

The domain is (−∞,4)∪(4,∞)(-\infty,4)\cup(4,\infty). The simplified expression does not restore the missing input. The output 88 would require x+4=8x+4=8, hence x=4x=4, which is excluded. Every other real output yy is attained at x=y−4x=y-4. The range is (−∞,8)∪(8,∞)(-\infty,8)\cup(8,\infty).

Check your understanding

A square has side length uu centimeters, restricted to 1≤u≤41\le u\le4. What are the domain and range of its area function A(u)=u2A(u)=u^2?

Answer choices

Read the whole graph and its endpoints

A graph shows both input restrictions and output behavior, provided you know whether it shows the complete graph or only a viewing window. The following is the complete graph of gg; its two pieces are straight segments.

Read allowed inputs and attained outputsThe left endpoint (-2, 1) is included and the right endpoint (3, 1) is excluded. The peak (0, 4) is included. Only the two connecting segments are in the graph.-2-11231234xy
The complete graph includes its left endpoint and excludes its right endpoint. Height 1 is still attained at the left endpoint.

A filled dot includes its point; an open circle excludes its point. The leftmost input is −2-2 and is included. The rightmost displayed endpoint has input 33 and is excluded. Thus the domain is [−2,3)[-2,3). The range is [1,4][1,4]. Although the right endpoint at height 11 is open, the filled left endpoint attains that same height.

The vertical intercept is the graph’s point with input zero, here (0,4)(0,4). A zero of a function is an input giving output zero; it produces a horizontal-axis intercept. This graph has no zeros because all its outputs are positive.

The graph rises from left to right on [−2,0][-2,0] and falls on [0,3)[0,3). In general, ff is increasing on an interval when any two inputs in it satisfy f(x1)<f(x2)f(x_1)<f(x_2) whenever x1<x2x_1<x_2. It is decreasing when the output inequality reverses. These terms compare outputs, not whether they are above or below the horizontal axis. A function can be positive while decreasing, as this graph is on its right segment. Here increasing and decreasing mean strictly increasing and strictly decreasing. A constant function is neither on an interval containing two distinct inputs.

Check your understanding

For the complete graph of gg above, which statement is correct?

Answer choices

Symmetry compares opposite inputs

A graph can match itself after a reflection or a half turn. For e(x)=∣x∣e(x)=|x| on [−2,2][-2,2], the inputs −1-1 and 11 both give 11. Reflecting the complete V across the vertical axis preserves it. For o(x)=xo(x)=x on [−2,2][-2,2], those inputs give −1-1 and 11. A half turn about the origin exchanges the points (−1,−1)(-1,-1) and (1,1)(1,1) and preserves that graph.

Two ways a graph can match itselfThe V joins (-2, 2), (0, 0), and (2, 2); its two filled endpoints are included. The slanted segment joins filled points (-2, -2) and (2, 2). Both domains include both endpoints.-2202-2202-2xyxye(x) = |x|o(x) = x
Vertical-axis reflection keeps the V unchanged; a half turn about the origin keeps the slanted segment unchanged. Each symmetry must preserve the whole graph.

For either symmetry, the domain must contain −x-x whenever it contains xx. An even function satisfies f(−x)=f(x)f(-x)=f(x) for every allowed xx; its graph is symmetric about the vertical axis. An odd function satisfies f(−x)=−f(x)f(-x)=-f(x) for every allowed xx; its graph has half-turn symmetry about the origin. The identities ∣−x∣=∣x∣|-x|=|x| and o(−x)=−x=−o(x)o(-x)=-x=-o(x) verify these properties for the two complete graphs above.

One matching pair, or a finite table of matching pairs, does not establish symmetry at unlisted inputs. A function may have neither symmetry: the earlier graph of gg has domain [−2,3)[-2,3), which is not symmetric about zero. The zero function on a symmetric domain has both symmetries.

Check your understanding

A function has domain [−6,6][-6,6] and satisfies f(−x)=−f(x)f(-x)=-f(x) for every allowed input. If f(4)=7f(4)=7, which statement follows?

Answer choices

Piecewise rules choose a formula by input

One function can use different rules on different parts of its domain. A study room costs 55 dollars for any booking up to one hour, then 22 dollars per additional hour, with fractional additional hours charged proportionally. A booking lasts more than zero and at most four hours. Its cost is

B(t)={5,0<t≤1,5+2(t−1),1<t≤4.B(t)= \begin{cases} 5,&0<t\le1,\\ 5+2(t-1),&1<t\le4. \end{cases}

For t=0.5t=0.5, use the first rule, giving B(0.5)=5B(0.5)=5.

For t=2.5t=2.5, use the second rule, giving B(2.5)=5+2(1.5)=8B(2.5)=5+2(1.5)=8.

At t=1t=1, the first condition includes equality, so B(1)=5B(1)=5. The conditions tell you which rule to use before you calculate.

Overlapping rules can still give one output. At input 33, the rules 2x−32x-3 and x+x−3x+x-3 both give 33. Suppose the first rule applies when x≤5x\le5 and the second when x≥2x\ge2. Their conditions overlap on [2,5][2,5], and the rules agree throughout it because x+x−3=2x−3x+x-3=2x-3.

Now replace the second rule by 4x−74x-7, keeping those conditions. At input 22, both rules still give 11.

At input 33, however, the first gives 33 and the replacement gives 55. This assigns two different outputs to one input. Agreement at just one shared input is not enough.

A piecewise function specifies rules for different input sets. Together the conditions must assign exactly one output to each input in the stated domain. Overlapping conditions are valid only if their rules agree on every shared input. Gaps are allowed only when those inputs are outside the domain. The pieces need not meet to define a function.

Worked example 3 Use the boundary condition rather than the nearest formula

Problem. The complete rule is

h(x)={2−x,−2≤x<1,x+3,1≤x≤4.h(x)=\begin{cases} 2-x,&-2\le x<1,\\ x+3,&1\le x\le4. \end{cases}

Find h(1)h(1) and the range. Describe the open and filled points at input 11.

Solution. The input 11 belongs to the second piece, so h(1)=1+3=4h(1)=1+3=4.

On the first piece, outputs fall from 44, included at x=−2x=-2, toward 11, excluded because that piece does not include x=1x=1. Its output set is (1,4](1,4].

The second piece attains every output from 44 to 77, including both. Combining the output sets gives

(1,4]∪[4,7]=(1,7].(1,4]\cup[4,7]=(1,7].

The graph has an open point at (1,1)(1,1) and a filled point at (1,4)(1,4). Only the filled point determines the output at that input.

The input condition chooses the included endpointAt input 1 there are two endpoint markers, but only the filled point at height 4 belongs to the graph. The hollow point at height 1 belongs to neither piece at that input.-2140147xyFirst ruleSecond rule
At input 1, the open point at height 1 is excluded and the filled point at height 4 gives the actual value.

Change across an interval

Average change compares a net output change with the input span over which it happened. Suppose a reservoir contains 120120 cubic meters at time 11 hour and 8484 cubic meters at time 55 hours. Its volume changes by 84−120=−3684-120=-36 cubic meters over 5−1=45-1=4 hours. Dividing gives an average rate of −9-9 cubic meters per hour. The negative sign describes a net loss. It does not say the reservoir lost water at that rate throughout the interval.

For any distinct inputs aa and bb at which ff is defined, the average rate of change from aa to bb is

f(b)−f(a)b−a.\frac{f(b)-f(a)}{b-a}.

Subtract outputs in the same order as inputs. The denominator must be nonzero, and the units are output units per input unit. Endpoint data suffice for the computation even if no values between the endpoints are known.

On a graph, the line through (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)) is a secant line. Its slope is rise divided by run, the same quotient. For f(x)=x2/2f(x)=x^2/2 from 11 to 33, the rise is 4.5−0.5=44.5-0.5=4 and the run is 3−1=23-1=2.

A secant measures change between endpointsThe curve is not a straight line. Its marked points (1, 0.5) and (3, 4.5) determine a dashed secant segment of slope 2. A horizontal guide at height 0.5 and vertical guide at x equals 3 show run 2 and rise 4.1231234xyrun 2rise 4
The blue curve and red dashed secant share the marked endpoints. The secant's rise is 4 and its run is 2.

The average rate is 4/2=24/2=2. The secant measures the change between its two endpoints; the curve between those points need not follow the secant.

Worked example 4 Use unequal input intervals correctly

Problem. A probe reports depth dd in meters: d(0)=2d(0)=2, d(2)=8d(2)=8, and d(7)=13d(7)=13, with time in seconds. Find its average rate of change over the whole interval from 00 to 77. Decide whether the simple mean of the two shorter-interval rates gives this whole-interval rate.

Solution. Use the endpoints of the requested interval:

d(7)−d(0)7−0=117.\frac{d(7)-d(0)}{7-0}=\frac{11}{7}.

The probe’s depth increases by an average of 11/711/7 meters per second over these seven seconds. On [0,2][0,2], the rate is 6/2=36/2=3 meters per second.

On [2,7][2,7], the rate is 5/5=15/5=1 meter per second.

Their simple mean, 22, is not the whole-interval rate because they cover different amounts of time. The whole calculation counts all 1111 meters of net depth change and all 77 seconds.

An average rate of zero says that the endpoint outputs agree. For example, v(x)=x2v(x)=x^2 has v(−2)=v(2)=4v(-2)=v(2)=4, so its average rate on [−2,2][-2,2] is zero. It still attains v(0)=0v(0)=0. Endpoint agreement does not make the function constant between them.

Check your understanding

A freezer's temperature falls from −3-3 degrees Celsius at time 22 hours to −15-15 degrees Celsius at time 66 hours. What is the average rate of change?

Answer choices

Signed position and total distance

Position records where an object is relative to a chosen origin; it can be positive, zero, or negative. Its change records the net movement in the chosen positive direction. Total distance traveled instead adds the lengths of all parts of the trip. Retracing a segment adds distance even when it cancels some position change.

Worked example 5 Separate a trip's net change from its total length

Problem. An object moves along a straight track. Its signed position ss, in meters, is a function of time tt, in seconds. The complete position graph joins consecutive points in this table by straight segments.

tt (seconds)00441010
s(t)s(t) (meters)−4-48822

Find the signed position change, total distance traveled, and average rate of change of position on [0,10][0,10]. Explain what the secant measures.

Position can reverse while distance keeps accumulatingThe position rises from negative 4 meters to 8 meters, then falls to 2 meters. The secant does not follow the reversal at time 4 seconds.4100-428t (s)s (m)PositionSecant
Each blue segment records motion in one direction. The red dashed secant compares only the first and last positions.

Solution. The signed change uses only the final and initial positions:

s(10)−s(0)=2−(−4)=6 meters.s(10)-s(0)=2-(-4)=6\text{ meters}.

From 00 to 44 seconds, the object travels from −4-4 to 88, a distance of 1212 meters in the positive direction.

From 44 to 1010 seconds, it returns from 88 to 22, adding 66 meters of distance in the negative direction. Thus the total distance traveled is 12+6=1812+6=18 meters.

The average rate of change of position is

s(10)−s(0)10−0=610=35 meter per second.\frac{s(10)-s(0)}{10-0}=\frac{6}{10}=\frac35\text{ meter per second}.

This is the secant’s slope, a net position rate. Dividing the total distance by the elapsed time would give 18/10=9/518/10=9/5 meters per second, the average speed. These differ because the object reverses direction. A cumulative total-distance graph starts at zero and cannot decrease. A signed position graph may start at a negative value and may decrease.

A mathematical model also has a boundary of use. If a draining model is V(t)=48−6tV(t)=48-6t for 0≤t≤80\le t\le8, its stated domain stops when the tank empties. Substituting t=10t=10 into the expression gives −12-12, but the model supplies no volume there. Calculation outside a model’s domain does not extend the situation it describes.

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 resources (optional)

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

A bit of history (optional)

In 1748, Leonhard Euler published a book with an ambitious title, Introduction to the Analysis of the Infinite. Before readers reached its later calculations, he asked them to think about variables and functions. That choice of starting point helped make functions central to the organization of mathematical analysis.

Euler explained his plan in the preface. He divided the work into two books, giving the first to analysis and the second to geometry. His reason for treating functions at length was that analysis concerned variable quantities and functions of them. The book’s grand title did not send readers straight into the infinite; its first chapter was “On Functions in General.”

The Euler Archive at the University of the Pacific catalogs the book as E101 and records its publication in Lausanne. The publisher’s page for the English translation reproduces the passage from Euler’s preface and preserves that opening in its table of contents.

Your progress

See all your progress →