You have met the three sets already in the parent note : the domain (inputs allowed in), the codomain (the declared target), the range (what actually comes out). This page does one thing: it drags the topic through every kind of function you could be handed and works each one to the end. No new idea is used before we've hit it in an example.
Intuition Why a "matrix" of cases?
When a domain/range question appears on an exam, it is always one of a small number of shapes : a parabola-type that turns around, a fraction that forbids a value, a square-root that clips outputs, a line that hits everything, a wall you cannot cross (asymptote), a rule that switches formula halfway (piecewise), or a story dressed up in words. If you have seen one worked example of each shape , you have seen them all. Below is that shape-list, then one worked example per shape.
Definition "Natural domain" — a phrase used below
When a function is given by a formula only , with no domain written next to the arrow, its natural domain is the largest set of real inputs for which the formula makes sense — i.e. every x that does not force a division by zero or a square root of a negative. We compute it, rather than being told it.
Each row is a case class — a distinct reason the range behaves the way it does. The last column names the example that covers it.
#
Case class
What makes it special
Danger
Covered by
A
Turning function (parabola, both signs of input)
goes down then up ⇒ a minimum, range starts there
forgetting negative inputs give same outputs
Ex 1
B
Monotonic on closed interval
increasing/decreasing ⇒ range = [ f ( low ) , f ( high )]
reading endpoints off wrong
Ex 2
C
Fraction with a forbidden input
one x makes denominator 0
domain-hole and a missed output
Ex 3
D
Square-root clip
output can't go below 0 , and a ceiling from domain
inventing outputs that never happen
Ex 4
E
Straight line, all reals
hits every real, range = codomain
thinking a line ever "misses" something
Ex 5
F
Degenerate / constant
one single output for all inputs
calling it "not a function"
Ex 6
G
Word problem with hidden domain
reality forbids some inputs
ignoring physical limits
Ex 7
H
Exam twist: fraction that CAN reach its wall
numerator lets y hit a value Ex 3 would miss
copying Ex 3's conclusion blindly
Ex 8
I
Piecewise-defined (rule switches at a break)
each piece has its own sub-range; union them
ignoring one branch, or the join point
Ex 9
We now walk down the rows.
Worked example Example 1 — cell A: parabola over all reals
f : R → R , f ( x ) = x 2 − 4 x + 7. Find domain, codomain, range.
Forecast: before reading on, guess — does the range start at 0 ? Below 0 ? Above 0 ? Where does the curve turn?
Domain = R . Why this step? The notation f : R → … declares every real is allowed; a polynomial never divides or square-roots, so nothing forbids any input.
Codomain = R . Why this step? We read the target set straight off the arrow … → R ; it records where we promise outputs will live, before checking which are actually hit.
Find the turning point by completing the square . Why this tool and not just "solve y = f ( x ) "? A parabola is not one-to-one — inverting gives x = ± … , two branches, messy. Completing the square instead rewrites the formula so the smallest value is visible directly:
x 2 − 4 x + 7 = ( x 2 − 4 x + 4 ) + 3 = ( x − 2 ) 2 + 3.
Read the minimum. Why? A real square ( x − 2 ) 2 is ≥ 0 , and equals 0 only at x = 2 . So f ( x ) = ( x − 2 ) 2 + 3 ≥ 3 , hitting exactly 3 at x = 2 . In the figure this lowest point is marked as the vertex dot at ( 2 , 3 ) — the floor of the range.
Check the top. Why? As x marches away from 2 in either direction, ( x − 2 ) 2 grows without bound, so outputs climb to + ∞ . The figure shows the two rising arms of the U-shape shooting upward from that vertex.
Range = [ 3 , ∞ ) .
Verify: f ( 2 ) = 4 − 8 + 7 = 3 ✓ (floor reached). Pick any target above, say y = 7 : solve ( x − 2 ) 2 + 3 = 7 ⇒ ( x − 2 ) 2 = 4 ⇒ x = 0 or x = 4 ; indeed f ( 0 ) = 7 ✓. Try y = 2 (below floor): ( x − 2 ) 2 = − 1 , no real x ✓ — correctly unreachable.
Figure s01 — description: the U-shaped parabola f ( x ) = x 2 − 4 x + 7 ; its lowest point (vertex) sits at ( 2 , 3 ) , and a shaded band above y = 3 marks the range [ 3 , ∞ ) ; arrows on both arms show the curve rising to + ∞ on either side.
Common mistake The trap in cell A
Writing "range = R because a polynomial covers everything." A parabola turns around — the negative-input side gives the same outputs as the positive side, so a whole strip below the vertex is never produced.
Worked example Example 2 — cell B: same rule, chopped domain
g : [ 0 , 3 ] → R , g ( x ) = x 2 − 4 x + 7. Find the range.
Forecast: same formula as Ex 1 but only x from 0 to 3 . Does the range still start at 3 ? Does it still go to infinity?
Domain = [ 0 , 3 ] . Why this step? We read it straight off the arrow g : [ 0 , 3 ] → … ; it is a closed interval, meaning the endpoints 0 and 3 are themselves allowed inputs.
Locate the vertex x = 2 . Why? From Ex 1 the turn is at x = 2 , and 2 lies inside [ 0 , 3 ] , so the floor 3 is still achievable.
Check both endpoints. Why this step? On a closed interval a continuous function reaches its max at an endpoint (or the vertex). Compute:
g ( 0 ) = 0 − 0 + 7 = 7
g ( 3 ) = 9 − 12 + 7 = 4
Assemble. Why? Minimum is the vertex value 3 ; maximum is the larger endpoint value 7 . Continuity fills everything between.
Range = [ 3 , 7 ] .
Verify: g ( 2 ) = 3 ✓, g ( 0 ) = 7 ✓, g ( 3 ) = 4 ✓, all inside [ 3 , 7 ] . Target y = 6 : ( x − 2 ) 2 + 3 = 6 ⇒ ( x − 2 ) 2 = 3 ⇒ x = 2 ± 3 ; only x = 2 − 3 ≈ 0.268 ∈ [ 0 , 3 ] works, still valid ✓.
Recall Why does restricting the domain shrink the range?
Fewer allowed inputs ::: fewer producible outputs, so the range can only stay the same or get smaller.
Worked example Example 3 — cell C: rational function
h : R ∖ { − 1 } → R , h ( x ) = x + 1 2 x + 3 . Find domain and range.
Forecast: the graph has a vertical wall. Guess which single output value it can never reach.
Domain. Why exclude a point? Division by zero is undefined; set x + 1 = 0 ⇒ x = − 1 . Domain = R ∖ { − 1 } .
Invert to test outputs. Why? y is in the range exactly when y = h ( x ) has a solution x in the domain. Solve for x :
y ( x + 1 ) = 2 x + 3 ⇒ y x + y = 2 x + 3 ⇒ x ( y − 2 ) = 3 − y .
Read the danger value. Why look at y = 2 ? The coefficient of x is ( y − 2 ) ; if it is zero we cannot divide. At y = 2 : 0 = 3 − 2 = 1 , a contradiction — no x gives output 2 .
For y = 2 : x = y − 2 3 − y . Why the extra check? This x must stay in the domain, i.e. x = − 1 . Test: y − 2 3 − y = − 1 ⇒ 3 − y = − ( y − 2 ) = − y + 2 ⇒ 3 = 2 , false. So the forbidden x = − 1 is never demanded — every y = 2 is genuinely reachable.
Range = R ∖ { 2 } .
Verify: y = 2 unreachable — the missed value equals the ratio of leading coefficients 1 2 = 2 ✓ (the horizontal asymptote). Reachability of, say, y = 5 : x = 5 − 2 3 − 5 = 3 − 2 , and h ( − 3 2 ) = − 2/3 + 1 2 ( − 2/3 ) + 3 = 1/3 − 4/3 + 3 = 1/3 5/3 = 5 ✓.
Figure s02 — description: the two branches of h ( x ) = x + 1 2 x + 3 ; a dashed vertical line at x = − 1 marks the forbidden input (the wall the curve never crosses), and a dashed horizontal line at y = 2 marks the output value the curve approaches but never attains.
Worked example Example 4 — cell D: semicircle function
p ( x ) = 9 − x 2 . Find the natural domain and the range.
Forecast: a square root never gives a negative. So the floor is surely 0 . But is there a ceiling? Guess it.
Natural domain from inside the root. Why? No domain is written beside the formula, so we take the natural domain (largest set where the formula is real). of a negative is not real, so require 9 − x 2 ≥ 0 ⇒ x 2 ≤ 9 ⇒ − 3 ≤ x ≤ 3 . Domain = [ − 3 , 3 ] .
Floor of the output. Why? returns the non-negative root, so p ( x ) ≥ 0 , hitting 0 when 9 − x 2 = 0 , i.e. x = ± 3 (the two ends of the arc, where it meets the x -axis).
Ceiling of the output. Why not + ∞ ? Here is the standard square-root pitfall: after inverting, one must remember that x is trapped in the domain [ − 3 , 3 ] , which caps the inside expression. (This is Mistake 2 from the parent note: forgetting the original domain restriction when finding the range, and so inventing outputs that never occur. ) The inside 9 − x 2 is largest when x = 0 , giving 9 − 0 = 9 , so p ( 0 ) = 9 = 3 . That is the peak at the top of the arc.
Fill the gap. Why? p is continuous on [ − 3 , 3 ] , so it sweeps every value from 0 up to 3 .
Range = [ 0 , 3 ] .
Verify: p ( 0 ) = 3 ✓ top; p ( ± 3 ) = 0 ✓ ends. Target y = 1 : 9 − x 2 = 1 ⇒ x 2 = 8 ⇒ x = ± 2 2 ≈ ± 2.83 ∈ [ − 3 , 3 ] ✓ reachable. Target y = 4 (above ceiling): 9 − x 2 = 16 ⇒ x 2 = − 7 , no real x ✓ correctly unreachable.
Figure s03 — description: the upper semicircle p ( x ) = 9 − x 2 ; the peak dot at ( 0 , 3 ) marks the ceiling, the two dots at ( ± 3 , 0 ) where the arc meets the axis mark the floor 0 , and the shaded band from y = 0 to y = 3 is the range [ 0 , 3 ] .
Definition "Onto" (surjective) — defined here before first use
A function f : A → B is onto (the fancy word is surjective ) when every element of the codomain B is actually produced — that is, when the range equals the whole codomain , with nothing left over. If even one value of B is never an output, the function is not onto. (This idea gets its own note, Surjective Functions , but we need the word right now, so it is defined here.)
Worked example Example 5 — cell E: linear function
ℓ : R → R , ℓ ( x ) = 5 − 2 x . Find the range.
Forecast: a slanted line. Does it miss any output, or hit them all?
Domain = R . Why this step? Read off the arrow ℓ : R → … ; the formula 5 − 2 x has no division and no root, so every real input is safe and nothing is excluded.
Invert. Why? Test solvability of y = 5 − 2 x : 2 x = 5 − y ⇒ x = 2 5 − y .
When does this fail? Why check? The expression 2 5 − y is a real number for every real y (we never divide by something that could be zero — the denominator is the constant 2 ). So a valid x exists for all y .
Range = R . Here range equals codomain, so — by the definition just above — ℓ is onto (surjective).
Verify: target y = − 11 : x = 2 5 − ( − 11 ) = 8 , and ℓ ( 8 ) = 5 − 16 = − 11 ✓. Any non-constant line hits all reals ✓.
Worked example Example 6 — cell F: constant function
c : R → R , c ( x ) = 7. Find domain, codomain, range.
Forecast: every input gives 7 . Is this even a function? How big is the range?
Is it a function? Why ask? A function needs exactly one output per input — here every x maps to the single value 7 , which is perfectly "exactly one." So yes , it is a valid function (revisit Function Basics ).
Domain and codomain. Why this step? Both are read off the arrow c : R → R : domain = R (all inputs allowed), codomain = R (declared target), before we ask which outputs are actually produced.
Range. Why so small? The set of actual outputs is { c ( x ) : x ∈ R } = { 7 } — a single point, not an interval.
Range = { 7 } .
Verify: c ( 0 ) = c ( 100 ) = c ( − 3 ) = 7 ✓. No other value is ever produced, so { 7 } is correct — and since { 7 } = R , this is spectacularly not onto.
Common mistake Cell F trap
Writing range = [ 7 , 7 ] as if it were an interval, or claiming "constant is not a function." A single point is the whole range, and constant maps are genuine functions.
Worked example Example 7 — cell G: the ticket-price story
A stall sells n printed tickets, each costing 20 rupees (the currency symbol for the Indian rupee is ₹ , so ₹20 means "twenty rupees"), but the printer can make at most 150 tickets and n must be a whole number. Revenue is R ( n ) = 20 n . Find the realistic domain and range.
Forecast: pure algebra says R = 20 n works for any n . But reality forbids things — what?
Hidden domain. Why not all reals? You cannot print − 4 tickets, or 2.5 tickets, or more than 150 . So the domain is the finite set of integers { 0 , 1 , 2 , … , 150 } , not an interval.
Codomain and function notation. Why this step? To state the function properly we still need an arrow. We declare R : { 0 , 1 , … , 150 } → R ; the codomain R is our promised target (rupee amounts), chosen before we check which amounts are actually produced.
Range. Why not [ 0 , 3000 ] ? Because n jumps in whole steps, R jumps in steps of 20 : possible values are 0 , 20 , 40 , … , 3000 . The range is the finite set { 20 n : n = 0 , 1 , … , 150 } .
Its largest member is R ( 150 ) = 20 × 150 = 3000 . Why is this the top? R ( n ) = 20 n increases with n , so revenue is greatest at the biggest allowed input, and the biggest allowed input is the printer's cap n = 150 ; no larger n exists to push revenue higher, so 3000 is the ceiling.
Range = { 0 , 20 , 40 , … , 3000 } (that's 151 values), not the continuous interval [ 0 , 3000 ] .
Verify: R ( 150 ) = 3000 ✓ ceiling; R ( 0 ) = 0 ✓ floor; R ( 73 ) = 1460 , a multiple of 20 ✓. The amount ₹1450 (i.e. 1450 rupees) is not achievable (not a multiple of 20 ) — reality clips it out ✓.
Worked example Example 8 — cell H: don't copy Ex 3!
q : R → R , q ( x ) = x 2 + 1 x 2 . Find domain and range.
Forecast: it's a fraction, so cell C instinct says "one value is missed." Guess the horizontal wall — and guess whether q can actually reach 0 .
Domain = R . Why no exclusions? The denominator x 2 + 1 is always ≥ 1 > 0 — it can never be zero, so nothing is forbidden. (Contrast Ex 3, where a linear denominator did vanish.)
Invert. Why? Solve y = x 2 + 1 x 2 for x 2 :
y ( x 2 + 1 ) = x 2 ⇒ y x 2 + y = x 2 ⇒ x 2 ( y − 1 ) = − y ⇒ x 2 = y − 1 − y = 1 − y y .
Reality condition on x 2 . Why this and not "x = something"? A real x exists iff x 2 ≥ 0 . So we need 1 − y y ≥ 0 . This fraction is ≥ 0 exactly when numerator and denominator share a sign: 0 ≤ y < 1 .
Check the boundary y = 0 . Why — this is the twist. Plug y = 0 : x 2 = 0 ⇒ x = 0 , and q ( 0 ) = 1 0 = 0 ✓. So 0 is reached (unlike the missed value in Ex 3). But y = 1 makes the denominator 1 − y = 0 — no x 2 , so 1 is the wall the graph approaches but never touches.
Range = [ 0 , 1 ) — floor included , ceiling excluded .
Verify: q ( 0 ) = 0 ✓ (floor hit). As x → ∞ , q → x 2 x 2 = 1 but never equals it: y = 1 gives contradiction ✓. Target y = 2 1 : x 2 = 1/2 1/2 = 1 ⇒ x = ± 1 , and q ( 1 ) = 2 1 ✓. Target y = 1 : unreachable ✓.
Figure s04 — description: the bump-shaped curve q ( x ) = x 2 + 1 x 2 ; a dot at the origin ( 0 , 0 ) marks the floor 0 that is reached, and a dashed horizontal line at y = 1 marks the ceiling the curve rises toward but never touches; the shaded band from y = 0 up to (but not including) y = 1 is the range [ 0 , 1 ) .
Definition "Piecewise" — the switch-rule machine
A piecewise function uses different formulas on different parts of the domain , joined with a brace. You find its range by finding the range of each piece separately on its own sub-domain, then taking the union (all values that come out of any branch).
Worked example Example 9 — cell I: two rules, one function
s ( x ) = { x + 1 x 2 if x < 0 , if 0 ≤ x ≤ 2.
Domain is ( − ∞ , 2 ] . Find the range.
Forecast: two formulas. Guess each branch's output-set, then whether they overlap or leave a gap.
Domain. Why this shape? The braces cover x < 0 (first line) and 0 ≤ x ≤ 2 (second line); together they are ( − ∞ , 0 ) ∪ [ 0 , 2 ] = ( − ∞ , 2 ] . Every input lands in exactly one branch, so s is a genuine function.
Range of branch 1 on x < 0 . Why treat it alone? On its own sub-domain the rule is just the line x + 1 . As x runs over ( − ∞ , 0 ) , x + 1 runs over ( − ∞ , 1 ) — it climbs toward 1 but never reaches it, since x = 0 is excluded from this branch. Sub-range1 = ( − ∞ , 1 ) .
Range of branch 2 on 0 ≤ x ≤ 2 . Why separately? Here the rule is x 2 on a closed interval where it increases : minimum 0 2 = 0 , maximum 2 2 = 4 , continuous in between. Sub-range2 = [ 0 , 4 ] .
Union the sub-ranges. Why union and not intersect? A value is an output of s if some branch produces it. ( − ∞ , 1 ) ∪ [ 0 , 4 ] = ( − ∞ , 4 ] — the [ 0 , 1 ) overlap fuses seamlessly, and [ 0 , 4 ] supplies everything from 1 up to 4 that branch 1 missed.
Range = ( − ∞ , 4 ] .
Verify: branch-1 sample s ( − 3 ) = − 3 + 1 = − 2 ✓ (a negative output). Branch-2 top s ( 2 ) = 4 ✓ (the ceiling). Value y = 0.5 : branch 1 gives x = − 0.5 (< 0 ) with s = 0.5 ✓, so no gap near the join. Value y = 5 (> 4 ): branch 1 needs x = 4 (not < 0 , rejected), branch 2 needs x 2 = 5 i.e. x = 5 ≈ 2.24 (not ≤ 2 , rejected) — unreachable ✓, confirming 4 is the top.
Function Basics — Ex 6 and Ex 9 lean on "exactly one output per input" to accept the map.
Surjective Functions — Ex 5 is onto (range = codomain); Ex 1, 3, 4, 6, 8, 9 are not.
Injective Functions — Ex 1's parabola fails one-to-one (two inputs, one output), which is why completing the square beat inverting.
Inverse Functions — a clean inverse needs the range analysis of Ex 3 and Ex 8.
Composite Functions — to build g ∘ f , the range found here must sit inside g 's domain.
Graphing Functions — every figure on this page reads range off the y -extent.