1.2 - Functions, domains and ranges

1.2 - Functions, domains and ranges

A function is more than a formula: its permitted inputs decide which outputs are possible and whether the rule can be reversed. In this part of 1.2, you will use mappings and familiar graphs to find domains and ranges, distinguish one–one functions from many–one functions, and choose useful domain restrictions.

One output for each input

Can two different inputs give the same output and still define a function? Squaring gives (−2)2=4(-2)^2=4 and 22=42^2=4. That is allowed. The crucial question is whether each individual input has exactly one output.

Function, domain and range

A function assigns exactly one output to each input in its domain. The domain is the set of permitted inputs. The range is the set of outputs actually obtained from those inputs.

The notation f:x↦x2f:x\mapsto x^2 says that ff maps xx to x2x^2; f(3)=9f(3)=9 gives one input–output pair. The symbol R\mathbb R means the set of real numbers.

For the domain {−2,0,2}\{-2,0,2\}, the square function has arrows −2↦4-2\mapsto4, 0↦00\mapsto0, 2↦42\mapsto4. Its range is {0,4}\{0,4\}: do not list 44 twice. This is a many–one function because distinct inputs share an output. A mapping with two arrows leaving the same input for different outputs is not a function.

A graph represents a function of xx when every vertical line through its domain meets the graph exactly once. For example, y=x2y=x^2 passes this test. The circle x2+y2=1x^2+y^2=1 does not: at x=0x=0, both y=1y=1 and y=−1y=-1 occur. Similarly, “f(x)=±xf(x)=\pm\sqrt{x}” does not define a function on positive inputs. The usual symbol x\sqrt{x} alone means the non-negative square root and does give one output.

Worked example 1: a finite domain

Question. The function ff is defined by f(x)=x2+1f(x)=x^2+1 for x∈{−2,0,2}x\in\{-2,0,2\}. State its range.

Plan. Apply the rule to every permitted input and collect the distinct outputs.

f(−2)=5,f(0)=1,f(2)=5.f(-2)=5,\qquad f(0)=1,\qquad f(2)=5.

Each input has one output, although two inputs share 55.

Answer. The range is {1,5}\{1,5\}.

Check. Both listed values are attained, and all three permitted inputs have been used.

Now change only the domain. The same formula can define a different function because its allowed inputs have changed.

Worked example 2: changing the permitted inputs

Question. The function gg is defined by g(x)=x2+1g(x)=x^2+1 for x∈{0,1,2}x\in\{0,1,2\}. State its range and find g(1)g(1). Is g(−1)g(-1) defined?

Plan. Evaluate the rule only at inputs in the stated domain.

g(0)=1,g(1)=2,g(2)=5.g(0)=1,\qquad g(1)=2,\qquad g(2)=5.

The expression (−1)2+1(-1)^2+1 can be calculated, but −1-1 is not a permitted input to gg.

Answer. Range {1,2,5}\{1,2,5\}, g(1)=2g(1)=2, and g(−1)g(-1) is undefined.

Check. The three distinct outputs come from the three stated inputs; the algebraic rule has not enlarged the domain.

When no restriction is stated and you are asked for the largest real domain, exclude inputs that make the rule undefined. For 1/(x−3)1/(x-3), exclude x=3x=3. For x−3\sqrt{x-3}, require x≥3x\ge3. If a smaller domain is explicitly supplied, respect it.

Watch out

The domain is not automatically R\mathbb R. Writing down a formula does not permit division by zero or a real square root of a negative number.

Check the distinction between the number of inputs and the number of outputs.

Finding the range

To find a range, ask how low and how high the output can go, then check whether any boundary value is actually reached. A range is a set of output values, so use an inequality in f(x)f(x), or introduce y=f(x)y=f(x).

For a linear rule, the direction is easy to follow. If f(x)=2x+1f(x)=2x+1 for −1<x≤3-1<x\le3, multiplying by positive 22 and adding 11 gives −1<f(x)≤7-1<f(x)\le7. The lower endpoint is excluded because x=−1x=-1 is excluded. Every output between the endpoints occurs because the straight line has no gaps.

For a reciprocal, consider both sign and size. If g(x)=1/xg(x)=1/x for x≥2x\ge2, then g(2)=1/2g(2)=1/2. Increasing positive xx makes its reciprocal smaller but never zero. Therefore the range is 0<g(x)≤1/20<g(x)\le1/2. The value 00 is approached as xx grows, but no finite input produces it. This is why the boundary at zero is strict.

You already know

A completed square reveals a quadratic's vertex: a(x−h)2+ka(x-h)^2+k has turning point (h,k)(h,k). Use the domain to decide whether that vertex is available and which part of the curve remains.

A quadratic can turn inside an interval, so merely substituting the two endpoints can miss its minimum or maximum.

Worked example 3: a domain containing the vertex

Question. Find the range of f(x)=(x−2)2+1f(x)=(x-2)^2+1 for 0≤x≤50\le x\le5.

Plan. Check the vertex and both ends of the permitted interval.

The square is zero at x=2x=2, which is in the domain, so the minimum is 11. At the endpoints,

f(0)=5,f(5)=10.f(0)=5,\qquad f(5)=10.

Throughout this interval, the largest distance from 22 is 33, attained at x=5x=5. Thus the largest square is 99.

Answer. 1≤f(x)≤101\le f(x)\le10.

Check. The boundary outputs occur at x=2x=2 and x=5x=5. For any 1≤y≤101\le y\le10, the input x=2+y−1x=2+\sqrt{y-1} lies between 22 and 55, so every claimed output is attained.

Keep the formula and upper endpoint, but place the domain strictly to the right of the vertex. Now the smallest output is approached rather than reached.

Worked example 4: an excluded boundary

Question. Find the range of g(x)=(x−2)2+1g(x)=(x-2)^2+1 for 2<x≤52<x\le5.

Plan. Follow the positive quantity x−2x-2 across the stated interval.

0<x−2≤3⟹0<(x−2)2≤9⟹1<g(x)≤10.0<x-2\le3 \quad\Longrightarrow\quad 0<(x-2)^2\le9 \quad\Longrightarrow\quad 1<g(x)\le10.

Squaring preserves this order because all the quantities being squared are non-negative.

Answer. 1<g(x)≤101<g(x)\le10.

Check. g(5)=10g(5)=10. The equation g(x)=1g(x)=1 would require x=2x=2, which is excluded. The continuous right-hand branch fills every value between.

The same endpoint reasoning applies to familiar power graphs. For example, x3x^3 increases through every real value, whereas x2x^2 has range y≥0y\ge0. The graphs x\sqrt{x} and 1/x1/\sqrt{x} require x≥0x\ge0 and x>0x>0, respectively; on these largest real domains their ranges are y≥0y\ge0 and y>0y>0. For a positive integer nn, x−n=1/xnx^{-n}=1/x^n, so x=0x=0 must be excluded. The sign and whether the power is even or odd help you recognise the branches.

Watch out

An open domain endpoint need not give an open range endpoint. For y=x2y=x^2, −2<x≤2-2<x\le2, the output 44 is still attained at x=2x=2. Check whether another permitted input reaches the same height.

Apply the right-branch argument with a new vertex and endpoints.

One–one functions

A function can be valid without allowing its input to be recovered from its output. If you are told that a square is 99, the original number could have been 33 or −3-3. A suitable domain restriction removes that ambiguity.

One–one function

A function is one–one when different inputs in its domain always give different outputs. Equivalently, f(a)=f(b)f(a)=f(b) implies a=ba=b for permitted inputs a,ba,b.

On its graph, every horizontal line meets at most one point. A single pair of distinct inputs with equal outputs proves that a function is not one–one.

The horizontal-line test differs from the vertical-line test: vertical lines test whether a rule is a function; horizontal lines test whether that function is one–one.

[DIAGRAM: asset_name: Keeping one branch; asset_slug: function-one-one-restriction; caption: The whole quadratic repeats heights, while its right-hand branch gives each output once; description: Two equal-scale coordinate plots of y equals the square of x minus 2 plus 1. The left plot allows all real x and a horizontal line y equals 5 meets at 0 comma 5 and 4 comma 5. The right plot restricts x to at least 2 and the same horizontal line meets only at 4 comma 5. The vertex 2 comma 1 is included in both.]
The whole quadratic repeats heights, while its right-hand branch gives each output once

Worked example 5: repeated outputs

Question. Determine whether f(x)=(x−2)2+1f(x)=(x-2)^2+1, for x∈Rx\in\mathbb R, is one–one.

Plan. Look for two inputs equally far from the vertex's horizontal coordinate.

f(0)=(−2)2+1=5,f(4)=22+1=5.f(0)=(-2)^2+1=5,\qquad f(4)=2^2+1=5.

The inputs 00 and 44 are different and both belong to the domain.

Answer. ff is not one–one.

Check. The horizontal line y=5y=5 meets the graph twice, matching the algebraic counterexample.

Change only the domain to keep the right-hand branch. Checking a few values would not prove one–one behaviour for infinitely many inputs; the argument must cover them all.

Worked example 6: a one–one restriction

Question. Determine whether g(x)=(x−2)2+1g(x)=(x-2)^2+1, for x≥2x\ge2, is one–one. State another half-line restriction that would also work.

Plan. Show that two permitted inputs with the same output must coincide.

If g(a)=g(b)g(a)=g(b), then (a−2)2=(b−2)2(a-2)^2=(b-2)^2. Since a−2≥0a-2\ge0 and b−2≥0b-2\ge0, taking the non-negative square root gives a−2=b−2a-2=b-2, so a=ba=b.

Answer. gg is one–one on x≥2x\ge2. The restriction x≤2x\le2 also gives a one–one function, using the left-hand branch.

Check. On either single branch, each available height occurs once. A domain containing inputs equally far on both sides of 22 would repeat a height.

Linear functions with nonzero gradient are one–one on R\mathbb R. A reciprocal 1/x1/x is also one–one on x≠0x\ne0: if 1/a=1/b1/a=1/b for nonzero a,ba,b, multiplying by abab gives a=ba=b. A constant function on a domain with more than one input is not one–one.

Key idea

One–one behaviour belongs to the rule together with its domain. A restriction can turn a many–one function into a one–one function, preparing it to have an inverse.

Return to the opening puzzle with a new quadratic.

Quick Recap

  • A function gives exactly one output for every permitted input; its range contains only outputs actually reached.
  • Find range boundaries using the graph, vertex and domain, and check whether each boundary is attained.
  • Different inputs may share an output in a function. A one–one function forbids this.
  • Keeping one side of a quadratic's vertex makes it one–one.

Two inputs can give the same output and still define a function. They cannot do so in a one–one function.