Skip to lesson content

Lesson 3 of 5

Relations and Functions · Lesson 3 of 5

Functions, Graphs and Operations

“Connect a function’s input rule, graph, domain and range, then combine functions while respecting their restrictions.”

Learning Objectives

• Check that every declared input has exactly one image. • Interpret function notation, images and preimages. • Explain and sketch the identity, constant, polynomial, rational, modulus, signum and greatest-integer functions. • Determine domains and ranges from rules and graphs. • Evaluate functions in numerical and temperature-conversion examples. • Add, subtract, scale, multiply and divide real functions with correct domain restrictions.

A special kind of relation

A relation may connect an input to several outputs or to none. Many useful rules need something more precise: give a permitted input, and the output must be determined uniquely. A function is a relation with exactly this reliability.

Definition
Function

A function from A to B is a relation in which every element of A has one and only one image in B. Its domain is the entire declared input set A.

There are two checks, not one. First, every input in A must receive an output. Second, no input may receive two different outputs. Several inputs may share an output, and some elements of B may receive no input. Neither situation violates the definition.

Function notationLaTeX
The arrow declares the input set A and codomain B. The statement f(a) = b says the output corresponding to input a is b, or equivalently that (a, b) belongs to the function.
Definition
Image and preimage

If f(a) = b, then b is the image of a, and a is a preimage of b. An output can have more than one preimage or none in the stated domain.

A function is also called a map or mapping. The symbol f is the name of the function. Writing f(3) means “the value produced by f at input 3”; it does not mean f multiplied by 3. Once you know a rule, replace every occurrence of its input variable by the selected input, using parentheses around negative values or expressions.

Input set ACodomain B234125
Different inputs can share an output— This is a function from A to B. Every left entry has one arrow; two arrows may end at the same right entry.
Example — Checking three collections of pairs

Problem
Decide whether {(2, 1), (3, 1), (4, 2)}, {(2, 2), (2, 4), (3, 3), (4, 4)}, and {(1, 2), (2, 3), (3, 4)} are functions on their respective sets of first entries.

  1. 1.In the first collection, each input 2, 3 and 4 appears with one output. The repeated output 1 is allowed, so it is a function.
  2. 2.In the second collection, input 2 has both output 2 and output 4. These are distinct outputs, so it is not a function.
  3. 3.In the third collection, every input 1, 2 and 3 has one output. It is a function. If a larger starting set were declared, we would also have to check its additional inputs.

Return to the successor relation y = x + 1 on {1, 2, 3, 4, 5, 6}. It is not a function from that whole set to itself because 6 has no image in the destination set. Restricted to starting set {1, 2, 3, 4, 5}, the same pairs do define a function into {1, 2, 3, 4, 5, 6}. A function is therefore specified by its permitted inputs as well as its pairs or rule.

Example — Doubling natural numbers

Problem
Let f: ℕ → ℕ be given by f(x) = 2x. Find its domain, range and codomain.

  1. 1.ℕ here means {1, 2, 3, ...}. Each allowed input x produces the natural number 2x, and this output is unique. Therefore the rule defines a function.
  2. 2.The domain is ℕ and the codomain is ℕ. Its outputs are 2, 4, 6, ..., so its range is the set of positive even integers.
  3. 3.Every positive even integer 2k occurs at input k. Odd integers are allowed in the codomain but never occur as outputs.
A function need not use its entire codomain

The function rule checks unique outputs for inputs, not unique inputs for outputs. An unused codomain entry is allowed. An unused declared input is not allowed. These two kinds of “unused element” play different roles.

Real functions and evaluating a rule

Functions can take inputs that are names, objects or numbers. Here we focus on numerical functions so that we can calculate outputs and draw graphs. Before drawing anything, identify what kind of values the input and output sets permit.

Definition
Real-valued function

A function is real-valued if all its output values are real numbers. Its input set need not consist of real numbers.

Definition
Real function

A real function has real-number inputs and real-number outputs: both its domain and range are subsets of ℝ.

The real numbers contain the natural numbers and integers, so f: ℕ → ℕ given by f(x) = 2x + 1 is also a real function. Its domain is still ℕ, not all of ℝ. Calling a function real does not remove the restrictions stated in its definition.

Example — Completing a value table

Problem
For f: ℕ → ℕ with f(x) = 2x + 1, calculate its values at inputs 1 through 7.

  1. 1.At x = 1, f(1) = 2(1) + 1 = 3. At x = 2, f(2) = 2(2) + 1 = 5.
  2. 2.Continuing with the same substitution gives f(3) = 7, f(4) = 9, f(5) = 11, f(6) = 13 and f(7) = 15.
  3. 3.The outputs rise by 2 when the input rises by 1. Since inputs begin at 1, the range is {3, 5, 7, ...}; 1 is not an output of this particular function.
x1234567
f(x) = 2x + 13579111315
Example — A conversion rule

Problem
A temperature conversion is t(C) = 9C/5 + 32. Find t(0), t(28), t(−10), and the input whose output is 212.

  1. 1.C records a Celsius temperature; t(C) records its Fahrenheit value. At input 0, t(0) = 9(0)/5 + 32 = 32.
  2. 2.At input 28, t(28) = 252/5 + 32 = 50.4 + 32 = 82.4. At input −10, t(−10) = −90/5 + 32 = −18 + 32 = 14.
  3. 3.To find the input for output 212, solve 9C/5 + 32 = 212. Subtract 32 to obtain 9C/5 = 180; multiply by 5 to obtain 9C = 900; divide by 9 to obtain C = 100.
  4. 4.Evaluating starts with an input and calculates an output. Finding a preimage starts with an output and solves for an allowed input.

A graph records input–output pairs

For a real function, plot input x horizontally and output f(x) vertically. The graph consists of all points (x, f(x)) for allowed inputs. A table supplies sample points, but the complete graph also contains the points for inputs not listed in the table.

To read the domain from a graph, ask which horizontal positions have a point on the graph. To read the range, ask which vertical heights occur. A graph must not contain two points with the same horizontal coordinate and different heights if it represents a function. This is a visual restatement of the unique-output rule.

A graph over a discrete domain such as ℕ consists of separate points; joining them would introduce inputs outside the domain. A graph over an interval of real numbers usually contains infinitely many points between the tabulated values. We will specify domains carefully when interpreting the familiar graph families below.

Identity and constant functions

Two simple rules show why input and output play different roles. One returns every input unchanged. The other ignores the numerical value of the input and always returns the same fixed output. Both satisfy the unique-output requirement.

Definition
Identity function

The identity function on ℝ is f(x) = x for every real x. Its domain and range are both ℝ.

For the identity function, input −2 gives output −2, input 0 gives 0, and input 3 gives 3. The graph is the straight line y = x, passing through the origin. Every real output y occurs because choosing input x = y produces it.

-4-3-2-101234-4-3-2-101234xy
The identity function y = x— Inputs and outputs match. The line continues in both directions beyond the displayed window.
Definition
Constant function

A constant function on ℝ has the rule f(x) = c, where c is a fixed real number. Its domain is ℝ and its range is the single-element set {c}.

For f(x) = 3, the inputs −4, 0 and 2 all produce 3. The graph is horizontal because changing the input does not change the output. If c = 0, the graph coincides with the horizontal axis; otherwise it is parallel to that axis.

-4-3-2-101234-101234xy
The constant function y = 3— The graph extends across all inputs but occupies only the height 3.
A one-element range is still a set

For f(x) = 3, write range = {3}, not range = 3. The number 3 is an output; {3} is the collection of all outputs. Constant functions are functions even though every input shares that output.

Polynomial functions: powers shape a graph

A polynomial combines constant multiples of nonnegative whole-number powers of x. This family includes constants, linear rules and many curved graphs. The restriction on powers matters: a fractional or negative power of x does not become a polynomial term just because it can be evaluated for some inputs.

General polynomial ruleLaTeX
The coefficients a₀, a₁, ..., aₙ are real numbers, and n is a nonnegative integer. The usual domain of a polynomial function here is ℝ.

For example, x³ − x² + 2 and x⁴ + √2 x are polynomial expressions. In the second rule, √2 is a real constant coefficient; the power of x is still 1. By contrast, x^(2/3) + 2x is not a polynomial because the first power is not a nonnegative integer.

Example — The square function

Problem
For f: ℝ → ℝ defined by f(x) = x², make a table and determine the domain and range.

  1. 1.Squaring −4, −3, −2, −1, 0, 1, 2, 3 and 4 gives 16, 9, 4, 1, 0, 1, 4, 9 and 16. Negative and positive inputs of equal magnitude have the same square.
  2. 2.Every real input can be squared, so the domain is ℝ. No square is negative, and zero occurs at input 0.
  3. 3.Every positive real output y occurs at x = √y or x = −√y. Therefore the range is [0, ∞), meaning all real numbers greater than or equal to zero.
  4. 4.Plot the sample pairs and join them with the smooth U-shaped graph of the rule. The complete graph extends beyond the table; the largest tabulated output 16 is not a maximum.
x−4−3−2−101234
x²16941014916
-4-3-2-101234-10123456789xy
The square function y = x²— Opposite inputs have the same height. The graph includes the origin and never falls below the horizontal axis.

Interval notation [0, ∞) includes 0, indicated by the square bracket, and continues without an upper bound. Infinity is not a real endpoint that can be included. The codomain of this function is ℝ, while its range is only [0, ∞). Those two sets must not be confused.

Example — The cube function

Problem
Describe the graph and range of f(x) = x³ on ℝ.

  1. 1.At inputs −3, −2, −1, 0, 1, 2 and 3, the outputs are −27, −8, −1, 0, 1, 8 and 27.
  2. 2.Unlike squaring, cubing keeps the sign: negative inputs give negative outputs. Every real y has a real cube root, so input x = ∛y produces output y.
  3. 3.The domain and range are both ℝ. The graph passes through the origin and rises from negative to positive values. In a finite picture we see only part of this unbounded graph.
x−3−2−10123
x³−27−8−101827
-3-2-10123-8-7-6-5-4-3-2-1012345678xy
The cube function y = x³— The curve takes both negative and positive heights, unlike the square function.

Rational functions and excluded inputs

A rational function is a quotient of polynomials. Polynomial arithmetic permits every real input, but division adds a restriction: the denominator must not be zero. Identify excluded inputs before treating the expression as a function rule.

Definition
Rational function

A rational function has the form p(x)/q(x), where p and q are polynomials and q is not the zero polynomial. Its allowed domain excludes any input at which q(x) = 0.

Example — The reciprocal function

Problem
For f(x) = 1/x, determine the domain and range and calculate representative values.

  1. 1.Division by zero is undefined, so x = 0 is excluded. The domain is ℝ ∖ {0}.
  2. 2.At inputs −2, −3/2, −1, −1/2, 1/4, 1/2, 1, 3/2 and 2, the outputs are −1/2, −2/3, −1, −2, 4, 2, 1, 2/3 and 1/2. Exact fractions avoid rounding errors.
  3. 3.The value 1/x can never equal 0 for a real allowed input. Conversely, for any nonzero real y, input x = 1/y gives output y. Thus the range is also ℝ ∖ {0}.
  4. 4.Positive inputs have positive outputs and negative inputs have negative outputs. There is no point on either coordinate axis: x = 0 is forbidden, and y = 0 is unattainable.
x−2−3/2−1−1/21/41/213/22
1/x−1/2−2/3−1−24212/31/2
-4-3-2-101234-4-3-2-101234xy
The reciprocal function y = 1/x— The two branches stay separate. Do not join them across the excluded input x = 0.
Small is not zero

For large nonzero inputs, 1/x may be very close to zero, but it never becomes zero. A graph window or rounded decimal can hide this difference. Domain and range statements need exact reasoning, not just the appearance of a plotted curve.

Modulus: retaining magnitude without sign

The modulus of a real number measures its distance from zero on a number line. Distance is nonnegative, so positive and negative inputs of the same magnitude give the same result. This geometric idea explains the two-part rule.

Definition
Modulus function

The modulus function is f(x) = |x|. It returns x for x ≥ 0 and −x for x < 0.

Modulus as a piecewise ruleLaTeX
Choose the expression using the sign of the input. In the second case, −x is positive because x itself is negative.

For example, |−5| = −(−5) = 5, |5| = 5, and |0| = 0. The domain is ℝ and the range is [0, ∞). The graph forms a V: its right branch is y = x and its left branch is y = −x. This is not the curved graph of x², even though their domains and ranges match.

-4-3-2-101234-1012345xy
The modulus function y = |x|— Two straight branches meet at the origin. The output measures distance from zero.

Signum: recording only the sign

Sometimes the size of a number is irrelevant and only its sign matters. The signum function places every real input into one of three cases. A tiny positive number and a large positive number therefore have the same output.

Definition
Signum function

The signum function returns 1 for a positive input, 0 for input zero and −1 for a negative input.

Signum ruleLaTeX

The domain is ℝ and the range is {−1, 0, 1}. Thus sgn(−0.2) = −1, sgn(0) = 0 and sgn(200) = 1. In the graph, the horizontal pieces at heights −1 and 1 exclude x = 0. A separate filled point at (0, 0) records the value at zero.

-4-3-2-101234-2-1012xy
The signum function— Hollow circles exclude the endpoints (0, −1) and (0, 1); the filled origin supplies the unique value at x = 0.

Greatest integer: the step below an input

The greatest-integer function returns the largest integer that does not exceed the input. Think of standing at x on a number line and looking for the nearest integer at or to your left. This is different from rounding to the nearest integer.

Definition
Greatest-integer function

For a real input x, [x] is the greatest integer less than or equal to x. It is also written ⌊x⌋. If n is an integer and n ≤ x < n + 1, then [x] = n.

A complete description of each stepLaTeX

For 2 ≤ x < 3, the output is 2. At x = 3, it changes to 3. For −1 ≤ x < 0, the output is −1, so [−0.2] = −1, not 0. Zero is larger than −0.2 and therefore is not an allowed answer. Also [−2] = −2 exactly, whereas [−2.01] = −3.

Input intervalOutputIncluded left endpointExcluded right endpoint
−2 ≤ x < −1−2−2−1
−1 ≤ x < 0−1−10
0 ≤ x < 1001
1 ≤ x < 2112
2 ≤ x < 3223
-3-2-10123-4-3-2-101234xy
The greatest-integer function— Each step includes its left endpoint and excludes its right endpoint. At each integer, the next step begins.

Every real input has a greatest integer below it, so the domain is ℝ. Only integers can appear as outputs, and every integer n occurs at input x = n, so the range is ℤ. The displayed graph is a window into steps that continue without end in both directions.

Example — Distinguishing three rules at one input

Problem
At x = −1.4, calculate |x|, sgn(x) and [x].

  1. 1.The modulus measures magnitude, so |−1.4| = 1.4.
  2. 2.The signum records that the input is negative, so sgn(−1.4) = −1.
  3. 3.The greatest integer no larger than −1.4 is −2, because −2 ≤ −1.4 < −1. Thus [−1.4] = −2.
  4. 4.The outputs differ because the rules retain different information: magnitude, sign, and the integer at or below the input.
Do not remove the sign when finding [x]

For a negative noninteger, truncating its decimal part moves right toward zero. The greatest-integer rule moves to the integer on the left. That is why [−1.4] = −2 while simply dropping “.4” would give the wrong answer −1.

Determining domain and range from a rule

The domain asks which inputs can legally enter a rule. The range asks which outputs those inputs actually produce. Division and real square roots impose different input restrictions, and a restriction on the input can also change the range of a familiar rule.

Example — A real square-root rule

Problem
Determine the domain and range of f(x) = √(9 − x²).

  1. 1.A real square root requires a nonnegative radicand, so 9 − x² ≥ 0. This is equivalent to x² ≤ 9, giving −3 ≤ x ≤ 3. The domain is [−3, 3].
  2. 2.The quantity 9 − x² lies between 0 and 9 on this interval. Its nonnegative square root therefore lies between 0 and 3.
  3. 3.Both endpoints occur: f(−3) = f(3) = 0 and f(0) = 3. For any y between 0 and 3, choose x = √(9 − y²); this input is in the domain and gives f(x) = y. Thus the range is the whole interval [0, 3].
Example — Restricting a linear input

Problem
Find the range of f(x) = 2 − 3x for real x > 0.

  1. 1.Since x > 0, multiplying by −3 gives −3x < 0. Adding 2 gives f(x) < 2. The inequality is strict, so 2 is excluded.
  2. 2.Every y < 2 occurs: solving y = 2 − 3x gives x = (2 − y)/3, which is positive.
  3. 3.The range is (−∞, 2). If the domain had been all real numbers, the range would instead have been ℝ. Always read the stated domain before naming the range.

For f(x) = −x on ℝ, every real y occurs at input −y, so the range is ℝ. For f(x) = x² + 2 on ℝ, all outputs are at least 2; every y ≥ 2 occurs by choosing x = √(y − 2), so the range is [2, ∞). These arguments justify the entire range rather than only checking a few sample values.

Combining functions point by point

Two functions can be combined by applying both to the same input and then performing ordinary arithmetic on their outputs. The phrase “pointwise” means that the operation is carried out separately at each allowed input. It does not mean feeding one function’s output into the other.

Suppose f and g are real functions on a common input set X. At each x in X, the sum takes f(x) and g(x) and adds them. Subtraction and multiplication work in the same way. A scalar is a fixed real number; multiplying by a scalar scales each output of one function.

Sum and differenceLaTeX
Scalar multiple and productLaTeX
α is a fixed real number, and x belongs to the common domain X.

Division needs one additional check. The quotient at x is allowed only if the output g(x), which becomes the denominator, is nonzero. If the functions originally have different domains, first restrict to inputs where both are defined, then remove any zeros of g.

Quotient and its domainLaTeX
D_f and D_g denote the domains of f and g. The intersection D_f ∩ D_g contains inputs allowed for both.
Example — Combining a square rule and a linear rule

Problem
Let f(x) = x² and g(x) = 2x + 1 on ℝ. Find their sum, difference, product, quotient and the scalar multiple 3f.

  1. 1.Substitute the rules into the definition of the sum: (f + g)(x) = x² + (2x + 1) = x² + 2x + 1. Its domain is ℝ.
  2. 2.For subtraction, (f − g)(x) = x² − (2x + 1) = x² − 2x − 1. The minus sign acts on both terms of g. Its domain is ℝ.
  3. 3.For the product, (fg)(x) = x²(2x + 1) = 2x³ + x². For the scalar multiple, (3f)(x) = 3x². Both are defined on ℝ.
  4. 4.For the quotient, (f/g)(x) = x²/(2x + 1). Solve 2x + 1 = 0 to find the excluded input x = −1/2. Its domain is ℝ ∖ {−1/2}.
  5. 5.At x = 1, f(1) = 1 and g(1) = 3, so the combined outputs are 4, −2, 3, 1/3 and 3 respectively. This checks the symbolic formulas at a permitted input.
Example — A square root combined with x

Problem
Let f(x) = √x and g(x) = x on X = [0, ∞). Find their four binary operations.

  1. 1.The sum is √x + x and the difference is √x − x. Their domain is X because both original rules are defined there.
  2. 2.The product is x√x = x^(3/2), still defined at every nonnegative input including zero.
  3. 3.The quotient is √x/x. It is undefined at zero even though both f(0) and g(0) exist, because g(0) = 0. Its domain is (0, ∞).
  4. 4.For x > 0, √x/x = 1/√x = x^(−1/2). The simplified formula must retain the domain restriction. At x = 4, its output is 2/4 = 1/2.
An algebraic simplification does not restore a forbidden input

For example, (x² − 1)/(x − 1) simplifies to x + 1 only for x ≠ 1. Cancellation assumes x − 1 is nonzero. The original quotient still excludes 1; a new rule x + 1 on all of ℝ would be a different function.

Quiz

Quick check

Which relation is a function from A = {1, 2, 3} to B = {4, 5}?

Quick check

What is the range of f(x) = x² on ℝ?

Quick check

What is [−2.3]?

Quick check

Which function records only whether an input is positive, zero or negative?

Quick check

For f(x) = √x and g(x) = x on [0, ∞), what is the domain of f/g?

Quick check

If f(x) = x² and g(x) = 2x + 1, what is (f − g)(x)?

Quick check

Which rule is a polynomial?

Quick check

For f(x) = 1/x on ℝ ∖ {0}, why is zero absent from the range?

Practice Problems

Practice Problems
  1. For f(x) = 2x − 5, calculate f(0), f(7) and f(−3), showing substitution with parentheses.
  2. Give a relation that is a function on its set of first entries but is not a function from {1, 2, 3} to {4, 5}. Explain the missing-input issue.
  3. Sketch y = x, y = 3, y = x² and y = x³. State their domains and ranges on ℝ and explain two differences among the graphs.
  4. Sketch y = 1/x, y = |x|, y = sgn(x) and y = [x]. Label open and closed endpoints where needed and state all domains and ranges.
  5. At x = −0.7, 0 and 1.8, compare modulus, signum and greatest-integer outputs. Explain each negative-input case.
  6. Find the domain and range of √(16 − x²) and of x² + 5 on their largest real domains. Justify the whole range, not just its endpoints.
  7. Let f(x) = x + 2 and g(x) = x − 3 on ℝ. Find f + g, f − g, 2f, fg and f/g, including domain restrictions.
  8. For f(x) = 5 − 2x on x > 1, find the range and explain why its endpoint is excluded.
  9. A temperature rule is t(C) = 9C/5 + 32. Find the input corresponding to output 68 and check it by substitution.

Key Takeaways

Key Takeaways

• Every declared input of a function has exactly one image; outputs may be shared or unused. • A graph plots (x, f(x)); domain concerns horizontal positions and range concerns attained heights. • Identity, constant, polynomial, rational, modulus, signum and greatest-integer rules have distinct behaviours. • The range of x² and |x| on ℝ is [0, ∞); the reciprocal excludes zero in both domain and range. • Greatest integer means the integer at or below the input, including for negative inputs. • Operations use the same input in both functions; division also excludes zeros of the denominator function.