Functions, domain and representations

6 visual steps · 3 worked examples · 5 exercises with solutions

First, let’s see the idea.

Why does √(x − a) not accept every real input?

Move forward one step at a time. Change the values and observe what happens.

A machine with a gateThe square-root gatef(x) = √(x − (2))input x = 6
Drawing description

The machine receives input 6 and uses the rule square root of x minus 2.

Step 1 of 6

Read the order of operations

Read the input in the purple box and the rule above it.

The machine receives x. The rule √(x − a) says first subtract a, then take the square root. Changing a changes the amount subtracted; it is not a machine output.

f(x) = √(x − (2))
Input x
6
Limit a
2

What if you change this?

-23
-37

Before moving on

With a = 2, are inputs 1 and 6 allowed?

Compare with the explanation

1 is not allowed: 1 − 2 < 0. Input 6 gives √(6 − 2) = 2.

You decide when to mark this lesson as studied.

A machine with a gate

Slide the drawing to see the details.

Explore the full explanationThe foundations, principles, worked examples and all the exercises, at your own pace.

What you will understand

  • Distinguish domain, codomain and range using finite and continuous examples.
  • Determine restrictions of real formulas and combine simultaneous restrictions.
  • Connect representations, read variation and evaluate a model's limits.

Before you start

You do not need to know everything by heart. The explanation revisits the necessary ideas and shows how they connect. If a foundation is still unclear, you can return to these lessons:

Review: from a rule to ordered pairs

A relation associates elements. A function is a relation where each allowed input has exactly one output. Consider the rule “associate each integer from 1 to 4 with its square”. The pairs are (1, 1), (2, 4), (3, 9), (4, 16). The list allows output uniqueness to be checked for every input of this finite domain.

In f(x), x is the input and f(x) the result. If f(x) = 3x − 2, then f(5) = 13. By contrast, f(x) = 13 is an equation whose solution is x = 5. The letter f names the function; we could call it g without changing the idea if the definition stayed the same. The input variable can also be called t, especially when it represents time.

Reviewing substitution is essential: if g(x) = x² + 2x, then g(−3) = (−3)² + 2(−3) = 9 − 6 = 3. Parentheses keep the whole negative input under the square. We can also have g(1) = 3. This does not violate the definition: two inputs can give the same output.

Domain, codomain and range

Writing f: D → C indicates that D is the domain and C the declared codomain. Every x in D must receive a value f(x) belonging to C. The range, Im(f), includes only values actually reached. Thus Im(f) is contained in C but need not equal C.

For example, define f: {−2, −1, 0, 1, 2} → ℝ by f(x) = x². The domain contains five inputs; the range is {0, 1, 4}; the codomain is all ℝ. The number 3 belongs to the codomain but not the range. If we declared codomain {0, 1, 4}, the same rule on the same inputs would reach the entire codomain.

For q: ℝ → ℝ, q(x) = x², the range is [0, +∞[. Every y ≥ 0 is reached by x = √y, whereas no negative y can be a real square. A function reaching its entire declared codomain is called surjective. A function where different inputs produce different outputs is injective; q is not injective on ℝ because q(−2) = q(2).

How to find a formula's domain

When a formula is given without explicit domain and we work in ℝ, we seek its natural domain: real values for which every operation makes sense. Polynomials such as x³ − 2x + 1 accept all reals. A denominator cannot be zero. An even-index root requires a nonnegative radicand; an odd-index root also permits negative numbers.

For f(x) = √(x − 2)/(x − 5), we need x − 2 ≥ 0 and x − 5 ≠ 0 simultaneously. The first condition gives x ≥ 2; the second excludes 5. The domain is [2, 5[ ∪ ]5, +∞[. The symbol ∪ means union: inputs from one interval or the other. “Simultaneously” corresponds to intersecting conditions, not choosing only one.

Simplification does not eliminate original restrictions. The expression (x² − 9)/(x − 3) matches x + 3 only for x ≠ 3. The first forbids input 3; the second, if defined on all ℝ, does not. Simplified formulas may describe the same values where both exist, but functions with different domains are not the same function.

Words, table, diagram and graph

A verbal description explains quantity meanings and assumptions; a table shows concrete pairs; an expression allows values to be calculated; a graph reveals trends and intersections. No representation automatically replaces all the others. A finite table alone does not determine a unique formula for all reals: many rules can agree at the listed points and differ between them.

In an arrow diagram, each domain element must have exactly one outgoing arrow. Several arrows may reach the same destination. On a Cartesian graph, a vertical line x = a cannot meet two points with different y-coordinates if the relation is a function of x. The vertical-line test geometrically expresses output uniqueness.

A complete circle is not the graph of a single function y of x: several x-coordinates have both positive and negative y-coordinates. The upper semicircle can be a function, for example y = √(r² − x²) on [−r, r], with r > 0. Restricting the relation selects a single output, but we need to declare that choice.

Read growth and average rates

A function is increasing on an interval when larger inputs give larger outputs; it is decreasing when larger inputs give smaller outputs. Always compare from left to right along the input axis. For f(x) = (x − 3)², the function decreases until x = 3 and increases afterwards. Positive outputs do not imply growth: between 0 and 2, values 9, 4 and 1 are positive and decrease.

The average rate of change between distinct inputs a and b is [f(b) − f(a)]/(b − a). The numerator measures output change; the denominator input change. If output is volume in litres and input time in minutes, the rate is litres per minute. An average rate does not guarantee that change occurred uniformly.

For V(t) = 120 − 6t, between t = 2 and t = 7, V changes from 108 to 78. Average rate is (78 − 108)/(7 − 2) = −30/5 = −6 L/min. The negative sign indicates decreasing volume. For this linear function, all average rates coincide; that is no longer true for a quadratic function.

Contextual domain and piecewise functions

A model can have a more restricted domain than its expression. If V(t) = 120 − 6t represents a tank emptying at constant rate, time starts at 0 and ends when V = 0, at t = 20 min. Using t = 30 would give volume −60 L, allowed by the calculation but incompatible with this physical model.

Some situations use different rules in different regions. A hypothetical service may charge C(n) = 100n for 0 ≤ n ≤ 5 and C(n) = 500 + 80(n − 5) for n > 5, where n is a whole number of units and C is in Kz. The second branch retains the cost of the first five and adds 80 per additional unit; it does not reapply the price to all units.

To evaluate C(7), first select the right branch: C(7) = 500 + 80 × 2 = 660 Kz. Merely seeing a letter and substituting into any expression is not enough. Branch endpoints need clear rules: if two branches include the same input with different outputs, the definition fails; if a domain input has no branch, it also fails.

Worked examples, without skipping steps

Follow the reasoning first. Then cover the solution and try to reconstruct it in your own words.

Example 1

Finite range and codomain

Define f: {−3, −1, 0, 2} → ℝ by f(x) = x² − 1. Determine the range.
  1. Evaluate the four inputs: f(−3) = 9 − 1 = 8 and f(−1) = 1 − 1 = 0.
  2. Calculate f(0) = −1 and f(2) = 4 − 1 = 3.
  3. Collect outputs without repeated elements: {−1, 0, 3, 8}. The declared codomain remains ℝ.
Result
Im(f) = {−1, 0, 3, 8}.
Check the result
There are four inputs and four distinct outputs in this example. The number 5 belongs to ℝ, but none of the four inputs produces 5.

Example 2

Two restrictions together

Determine the real domain of h(x) = √(7 − x)/(x + 1).
  1. The root requires 7 − x ≥ 0, hence x ≤ 7.
  2. The denominator requires x + 1 ≠ 0, hence x ≠ −1.
  3. Combine the conditions: all real numbers up to 7, including 7, except −1.
Result
D = ]−∞, −1[ ∪ ]−1, 7].
Check the result
At 7, the root is 0 and denominator 8, so output exists. At −1 there would be division by zero; at 8, a square root of −1.

Example 3

The interval is part of the model

A tank's volume is V(t) = 90 − 3t litres, with t in minutes after discharge starts. Calculate V(8), the model's endpoint and average rate between 5 and 10 min.
  1. V(8) = 90 − 24 = 66 L. For an empty tank, 90 − 3t = 0 gives t = 30 min.
  2. The contextual domain is [0, 30], assuming uniform discharge and no refilling.
  3. V(5) = 75 and V(10) = 60; average rate is (60 − 75)/(10 − 5) = −15/5 = −3 L/min.
Result
After 8 min there are 66 L; the model ends at 30 min; average rate is −3 L/min.
Check the result
Total loss over 30 min is 3 × 30 = 90 L. The rate's sign agrees with emptying.

Now try it yourself

There is no timer. Write what you know, choose a relationship and justify each step. Hints and solutions are available whenever you need them.

Exercise 1

If f: ℝ → ℝ has f(x) = x² + 1, does −2 belong to the codomain? And to the range?
A hint
The codomain is declared; the range depends on results.
See the worked solution
−2 belongs to codomain ℝ but not the range. Since x² ≥ 0, f(x) ≥ 1; and every y ≥ 1 is reached by x = √(y − 1). Thus Im(f) = [1, +∞[.

Exercise 2

Is the relation {(1, 4), (2, 5), (1, 7)} a function from first to second coordinate?
A hint
Look for an input with two outputs.
See the worked solution
No. Input 1 is associated with 4 and 7, violating unique output. The problem is not the pairs' presentation order but a duplicated association with different results.

Exercise 3

Find the domain of 1/√(x − 4).
A hint
The root is in the denominator, so merely being real is not enough.
See the worked solution
We need x − 4 ≥ 0 for the root to exist and √(x − 4) ≠ 0 to divide. Together the conditions give x > 4. The domain is ]4, +∞[; endpoint 4 is excluded.

Exercise 4

For p(x) = x², compare average rates on [0, 2] and [2, 4].
A hint
Calculate output change divided by input change.
See the worked solution
On the first interval, (4 − 0)/(2 − 0) = 2. On the second, (16 − 4)/(4 − 2) = 6. Inputs increase by the same amount, but outputs do not; the rate is not constant.

Exercise 5

A service uses the lesson's piecewise tariff. How much do 5 and 8 units cost? Does the domain allow 2,5 units?
A hint
Respect boundaries and the meaning of n.
See the worked solution
C(5) = 100 × 5 = 500 Kz. C(8) = 500 + 80 × 3 = 740 Kz. The domain was declared with integer n; 2,5 units does not belong to this counting model even though the formula accepts the number.

Mistakes worth avoiding

Range and codomain are always equal.
Range contains only outputs actually reached; codomain is the declared destination set.
The formula determines everything about a function.
Domain and codomain are part of the definition.
A repeated output prevents a function.
One input with two different outputs violates the definition.
A positive function must be increasing.
Positivity compares outputs with zero; growth compares outputs with each other as input increases.

The essentials to take with you

  • A function assigns exactly one output to each domain input.
  • Range is contained in codomain and can be smaller.
  • A formula's restrictions must be satisfied simultaneously.
  • Table, expression and graph answer complementary questions.
  • Context can restrict a domain that algebra alone would allow.

If you still cannot explain one of these ideas, return to the corresponding section and work through an example again. Recognising the difficulty is part of studying.

References for further study

Text and examples prepared for this learning path. These sources help check the principles and continue studying:

The organisation by school year is a study proposal. Pedagogical review by teachers remains a stage of the project.