Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Mathematics: Analysis and Approaches
  3. ›2 Functions
  4. ›2.2 Functions, domain and range

IB Mathematics: Analysis and Approaches · Topic 2 · Functions

2.2 Functions, domain and range

Define a function, state its domain and range, test whether a relation is a function, and write sets of values in interval notation.

  • 5 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5A function gives exactly one output for each input
  1. 1A function gives exactly one output for each input
  2. 2Domain and range describe the possible inputs and outputs
  3. 3Mappings and graphs show whether a relation is a function
  4. 4Interval notation writes sets of values compactly
  5. 5Division and square roots restrict which inputs are allowed
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: A function gives exactly one output for each input

A taxi fare depends on the distance travelled. For each distance, there is one fare. A function works in the same way: each input has exactly one output.

A function can be shown as a mapping, such as x↦2x+1x\mapsto 2x+1x↦2x+1. It can also be written as a rule, f(x)=2x+1f(x)=2x+1f(x)=2x+1. Here f(3)f(3)f(3) means the output when the input is 3.

So f(3)=2(3)+1=7f(3)=2(3)+1=7f(3)=2(3)+1=7. The letter fff is only a name. Other functions might be called ggg or hhh. The letter xxx is only a placeholder for any input in the domain.

Worked example

Evaluate a function

Given f(x)=3x2−xf(x)=3x^2-xf(x)=3x2−x, find f(−2)f(-2)f(−2).
  1. 1
    Replace xxx with -2: f(−2)=3(−2)2−(−2)f(-2)=3(-2)^2-(-2)f(−2)=3(−2)2−(−2).
  2. 2
    Square first: 3(4)+23(4)+23(4)+2.
  3. 3
    Add: 12+2=1412+2=1412+2=14.

Answer: f(−2)=14f(-2)=14f(−2)=14.

Common mistake

The symbol f(x)f(x)f(x) does not mean fff multiplied by xxx. It means the output of fff for the input xxx.

Key terms · tap one for its definition

function

A function assigns exactly one output to each input in its domain.

mapping

A mapping is a rule or diagram that pairs each input value with an output value.

Part 1 done

2

Part 2 of 5: Domain and range describe the possible inputs and outputs

Every function has a set of allowed inputs. For the taxi fare, distances cannot be negative. This set is the domain of the function.

The outputs that actually occur form the range. The range depends on both the rule and the domain. It can be much smaller than the set of all real numbers.

If no domain is given, assume the largest set of real numbers that works. Write x∈Rx\in\mathbb{R}x∈R to say that xxx can be any real number. On a graph, the domain is read along the xxx-axis and the range is read along the yyy-axis.

Worked example

Domain and range of a short list

A function is defined by f(x)=x2f(x)=x^2f(x)=x2 for x∈{−1,0,1,2}x\in\{-1,0,1,2\}x∈{−1,0,1,2}. Write down the domain and range.
  1. 1
    The domain is the given inputs: {−1,0,1,2}\{-1,0,1,2\}{−1,0,1,2}.
  2. 2
    Find each output: f(−1)=1f(-1)=1f(−1)=1, f(0)=0f(0)=0f(0)=0, f(1)=1f(1)=1f(1)=1, f(2)=4f(2)=4f(2)=4.
  3. 3
    List the different outputs once each.

Answer: Domain: {−1,0,1,2}\{-1,0,1,2\}{−1,0,1,2}. Range: {0,1,4}\{0,1,4\}{0,1,4}.

Exam tip

When you list a range, write outputs, not inputs. Write a repeated output only once.

Key terms · tap one for its definition

domain

A function’s domain is the set of inputs where the function is defined.

range

A function’s range is the set of all outputs that the function produces.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the set of pairs that defines a function.
Show answer and explanation

Answer: C · Worked explanation

In the correct set, each input appears once, so each has exactly one output. The repeated output 4 is allowed. The set (1,2),(1,3),(2,5)(1,2),(1,3),(2,5)(1,2),(1,3),(2,5) fails because the input 1 is paired with both 2 and 3, giving two outputs for one input.
3

Part 3 of 5: Mappings and graphs show whether a relation is a function

A relation is any rule that pairs inputs with outputs. It may allow two outputs for one input. Only some relations are functions.

Check a mapping by looking at each input. Each input must lead to one output only. Different inputs may share an output, and the rule is still a function.

Types of mapping

Mapping typeExample pairsFunction?
One-to-one1→21\to21→2 and 2→32\to32→3Yes
Many-to-one−1→1-1\to1−1→1 and 1→11\to11→1Yes
One-to-many4→24\to24→2 and 4→−24\to-24→−2No
Mapping type
One-to-one
Example pairs
1→21\to21→2 and 2→32\to32→3
Function?
Yes
Mapping type
Many-to-one
Example pairs
−1→1-1\to1−1→1 and 1→11\to11→1
Function?
Yes
Mapping type
One-to-many
Example pairs
4→24\to24→2 and 4→−24\to-24→−2
Function?
No

For a graph, use the vertical line test. Draw vertical lines through the graph. If any line meets the graph more than once, one input has two outputs. The graph is then not a function. A circle fails this test. The graph of y=x2y=x^2y=x2 passes it, because each vertical line meets it at most once.

Key term

vertical line test

The vertical line test says a graph represents a function if no vertical line meets it more than once.

Part 3 done

4

Part 4 of 5: Interval notation writes sets of values compactly

Writing domains as inequalities can be slow. A set of values from one endpoint to another is an interval. Brackets show whether each endpoint is included. Many domains and ranges are intervals, so this notation appears often.

Square brackets include an endpoint, and round brackets exclude it. For example, [1,5)[1,5)[1,5) means 1≤x<51\le x<51≤x<5. Infinity is not a number, so it always takes a round bracket. Use ∪\cup∪ to join two intervals. The symbols −∞-\infty−∞ and ∞\infty∞ show that an interval continues without end.

Inequalities and interval notation

InequalityInterval notation
1≤x≤51\le x\le51≤x≤5[1,5][1,5][1,5]
1<x<51<x<51<x<5(1,5)(1,5)(1,5)
x≥2x\ge2x≥2[2,∞)[2,\infty)[2,∞)
x<−1x<-1x<−1(−∞,−1)(-\infty,-1)(−∞,−1)
x≠3x\ne3x=3(−∞,3)∪(3,∞)(-\infty,3)\cup(3,\infty)(−∞,3)∪(3,∞)
Inequality
1≤x≤51\le x\le51≤x≤5
Interval notation
[1,5][1,5][1,5]
Inequality
1<x<51<x<51<x<5
Interval notation
(1,5)(1,5)(1,5)
Inequality
x≥2x\ge2x≥2
Interval notation
[2,∞)[2,\infty)[2,∞)
Inequality
x<−1x<-1x<−1
Interval notation
(−∞,−1)(-\infty,-1)(−∞,−1)
Inequality
x≠3x\ne3x=3
Interval notation
(−∞,3)∪(3,∞)(-\infty,3)\cup(3,\infty)(−∞,3)∪(3,∞)

Worked example

Domain and range in interval notation

The function g(x)=x2g(x)=x^2g(x)=x2 has domain −1≤x≤2-1\le x\le2−1≤x≤2. Write its domain and range in interval notation.
  1. 1
    Domain: [−1,2][-1,2][−1,2].
  2. 2
    Check the ends: g(−1)=1g(-1)=1g(−1)=1 and g(2)=4g(2)=4g(2)=4.
  3. 3
    Between them the graph reaches g(0)=0g(0)=0g(0)=0, the smallest output.
  4. 4
    The largest output is 4.

Answer: Domain [−1,2][-1,2][−1,2] and range [0,4][0,4][0,4].

Common mistake

Never write a square bracket next to ∞\infty∞. Infinity cannot be reached, so it is never included.

Key term

interval

An interval specifies the input values from a lower endpoint to an upper endpoint.

Part 4 done

Quick check

One question on the part you just read

Easy

Write down the interval notation for x≥3x\ge3x≥3.
Show answer and explanation

Answer: D · Worked explanation

The value 3 is included, so the left bracket is square. Infinity cannot be reached, so it takes a round bracket. The interval (3,∞)(3,\infty)(3,∞) is wrong because it excludes 3, even though x≥3x\ge3x≥3 includes it. The interval [3,∞][3,\infty][3,∞] wrongly uses a square bracket for infinity.
5

Part 5 of 5: Division and square roots restrict which inputs are allowed

Now that the notation is clear, look at which inputs a rule allows. Two restrictions come up often. Both follow from the rule that every allowed input needs a defined output.

  • Division: the denominator cannot be zero.
  • Square root: the expression under the root cannot be negative.

For example, f(x)=1x−3f(x)=\frac{1}{x-3}f(x)=x−31​ has domain x≠3x\ne3x=3. Exclude any input that breaks a restriction. The domain is every real number that remains.

Worked example

Domain and range of a square root

Find the domain and range of f(x)=x−2f(x)=\sqrt{x-2}f(x)=x−2​.
  1. 1
    The expression under the root must satisfy x−2≥0x-2\ge0x−2≥0.
  2. 2
    So x≥2x\ge2x≥2, and the domain is [2,∞)[2,\infty)[2,∞).
  3. 3
    At x=2x=2x=2, f(2)=0f(2)=0f(2)=0. As xxx increases, f(x)f(x)f(x) increases without limit.
  4. 4
    A square root is never negative.

Answer: Domain [2,∞)[2,\infty)[2,∞); range [0,∞)[0,\infty)[0,∞).

Figure 1. The graph starts at x=2x=2x=2 and never falls below the xxx-axis.

You can read a range from a graph in the same way. Find the lowest and highest heights of the curve. The curve in the figure starts at x=2x=2x=2 and rises without limit.

Note read

Check your recall[14 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Define[1 mark]

    Define the term function.

    Show mark schemeHide mark scheme

    Model answer

    A function assigns exactly one output to each input in its domain.

    • 1 mark for stating that each input has exactly one output
  2. 2.Explain[2 marks]

    Explain why a relation containing the pairs (3,5)(3,5)(3,5) and (3,8)(3,8)(3,8) is not a function.

    Show mark schemeHide mark scheme

    Model answer

    The input 3 is paired with two different outputs, 5 and 8. A function must give exactly one output for each input.

    • 1 mark for stating that the input 3 has two outputs
    • 1 mark for linking this to a function needing exactly one output per input
  3. 3.Describe[2 marks]

    Describe how the vertical line test shows that a graph is not a function.

    Show mark schemeHide mark scheme

    Model answer

    Draw vertical lines across the graph. If any vertical line meets the graph more than once, one input has two outputs, so the graph is not a function.

    • 1 mark for drawing vertical lines through the graph
    • 1 mark for stating that a line meeting the graph more than once means the graph is not a function
  4. 4.Calculate[3 marks]

    Calculate f(−1)f(-1)f(−1) and f(4)f(4)f(4) for f(x)=x2−5xf(x)=x^2-5xf(x)=x2−5x.

    Show mark schemeHide mark scheme

    Model answer

    f(−1)=(−1)2−5(−1)=1+5=6f(-1)=(-1)^2-5(-1)=1+5=6f(−1)=(−1)2−5(−1)=1+5=6 and f(4)=16−20=−4f(4)=16-20=-4f(4)=16−20=−4.

    • 1 mark for substituting both inputs correctly
    • 1 mark for obtaining f(−1)=6f(-1)=6f(−1)=6
    • 1 mark for obtaining f(4)=−4f(4)=-4f(4)=−4
  5. 5.Determine[3 marks]

    Determine the domain and range of f(x)=x+3f(x)=\sqrt{x+3}f(x)=x+3​. Give both in interval notation.

    Show mark schemeHide mark scheme

    Model answer

    The expression under the root must be non-negative, so x+3≥0x+3\ge0x+3≥0 and x≥−3x\ge-3x≥−3. The domain is [−3,∞)[-3,\infty)[−3,∞). A square root is never negative, and it reaches 0, so the range is [0,∞)[0,\infty)[0,∞).

    • 1 mark for stating the condition x+3≥0x+3\ge0x+3≥0
    • 1 mark for giving the domain [−3,∞)[-3,\infty)[−3,∞)
    • 1 mark for giving the range [0,∞)[0,\infty)[0,∞)
  6. 6.Deduce[3 marks]

    Deduce the domain of g(x)=1x−5g(x)=\frac{1}{x-5}g(x)=x−51​, in interval notation.

    Show mark schemeHide mark scheme

    Model answer

    The denominator cannot be zero, so x≠5x\ne5x=5. The domain is (−∞,5)∪(5,∞)(-\infty,5)\cup(5,\infty)(−∞,5)∪(5,∞).

    • 1 mark for identifying that the denominator must not be zero
    • 1 mark for stating x≠5x\ne5x=5
    • 1 mark for writing (−∞,5)∪(5,∞)(-\infty,5)\cup(5,\infty)(−∞,5)∪(5,∞)

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Calculate[1 mark]

Calculate f(4)f(4)f(4) for f(x)=2x−5f(x)=2x-5f(x)=2x−5.
Show answer and explanation

Answer: A · Worked explanation

Substitute x=4x=4x=4: f(4)=2(4)−5=8−5=3f(4)=2(4)-5=8-5=3f(4)=2(4)−5=8−5=3. The value 13 comes from adding 5 instead of subtracting it. The value 8 comes from forgetting to subtract 5. Always follow the rule exactly as written, including the sign of each term. Check each step by substituting, writing every line of working.
4.

Medium·Determine[1 mark]

Determine the domain of f(x)=1x+4f(x)=\frac{1}{x+4}f(x)=x+41​.
Show answer and explanation

Answer: B · Worked explanation

The denominator is zero when x+4=0x+4=0x+4=0, which gives x=−4x=-4x=−4. This single input must be excluded, so the domain is x≠−4x\ne-4x=−4. The condition x≠4x\ne4x=4 comes from a sign error when solving x+4=0x+4=0x+4=0. Check by substituting: 4+4=84+4=84+4=8, which is not zero. The excluded value is the only input that makes the denominator zero.
5.

Medium·Determine[2 marks]

Determine the range of g(x)=x2+1g(x)=x^2+1g(x)=x2+1 for x∈Rx\in\mathbb{R}x∈R.
Show answer and explanation

Answer: C · Worked explanation

A square is never negative, so x2≥0x^2\ge0x2≥0 and g(x)=x2+1≥1g(x)=x^2+1\ge1g(x)=x2+1≥1. The value 1 is reached when x=0x=0x=0, so it is included. The range g(x)>1g(x)>1g(x)>1 is wrong because it excludes 1, and g(x)≥0g(x)\ge0g(x)≥0 ignores the added 1. The lowest output is reached, so 1 belongs in the range.
6.

Medium·Determine[2 marks]

Determine the domain of h(x)=6−2xh(x)=\sqrt{6-2x}h(x)=6−2x​.
Show answer and explanation

Answer: D · Worked explanation

The expression under the root must satisfy 6−2x≥06-2x\ge06−2x≥0. Then 6≥2x6\ge2x6≥2x, so x≤3x\le3x≤3. At x=3x=3x=3, h(3)=0h(3)=0h(3)=0, which is defined, so 3 is included. The answer x≥3x\ge3x≥3 comes from forgetting that dividing by a negative number reverses the inequality sign. Check with x=4x=4x=4: 6−8=−26-8=-26−8=−2 is negative, so 4 is outside the domain.
7.

Medium·Deduce[1 mark]

A graph contains the points (2,3)(2,3)(2,3) and (2,−1)(2,-1)(2,−1). Deduce which statement is correct.
Show answer and explanation

Answer: A · Worked explanation

Both points have input 2, but the outputs are 3 and -1. One input with two outputs breaks the definition of a function, and a vertical line at x=2x=2x=2 meets the graph twice. Having different outputs does not make a function; it is what causes the failure here.
8.

Hard·Determine[2 marks]

The function f(x)=x2−4f(x)=x^2-4f(x)=x2−4 has domain −3≤x≤1-3\le x\le1−3≤x≤1. Determine its range.
Show answer and explanation

Answer: B · Worked explanation

Check the end points: f(−3)=5f(-3)=5f(−3)=5 and f(1)=−3f(1)=-3f(1)=−3. Between them, f(0)=−4f(0)=-4f(0)=−4 is the smallest output. So the range is [−4,5][-4,5][−4,5]. The interval [−3,5][-3,5][−3,5] uses only the two end values and misses the lowest output at x=0x=0x=0. The lowest output -4 occurs at x=0x=0x=0, inside the domain, so it must be included.
9.

Hard·Determine[2 marks]

Determine the domain of f(x)=x−1x−4f(x)=\frac{\sqrt{x-1}}{x-4}f(x)=x−4x−1​​.
Show answer and explanation

Answer: A · Worked explanation

The root needs x−1≥0x-1\ge0x−1≥0, so x≥1x\ge1x≥1. The denominator needs x≠4x\ne4x=4. Combining both gives [1,4)∪(4,∞)[1,4)\cup(4,\infty)[1,4)∪(4,∞). The interval [1,∞)[1,\infty)[1,∞) ignores the zero denominator at 4. The interval (−∞,4)∪(4,∞)(-\infty,4)\cup(4,\infty)(−∞,4)∪(4,∞) ignores the square root restriction. Both restrictions must hold at once, so the domain is what remains after excluding the values each one breaks.
10.

Hard·Determine[2 marks]

The function f(x)=ax+bf(x)=ax+bf(x)=ax+b satisfies f(1)=5f(1)=5f(1)=5 and f(3)=11f(3)=11f(3)=11. Determine f(0)f(0)f(0).
Show answer and explanation

Answer: D · Worked explanation

The conditions give a+b=5a+b=5a+b=5 and 3a+b=113a+b=113a+b=11. Subtracting gives 2a=62a=62a=6, so a=3a=3a=3 and b=2b=2b=2. Then f(0)=a(0)+b=2f(0)=a(0)+b=2f(0)=a(0)+b=2. The value 3 is the gradient aaa, not the output at 0. The value 8 is the average of 5 and 11. Check: a=3a=3a=3 and b=2b=2b=2 give f(1)=5f(1)=5f(1)=5 and f(3)=11f(3)=11f(3)=11.

Keep going

Next topic2.3 Graphs of functionsPrevious topic2.1 Equations of straight lines

More in Topic 2 · Functions

  1. 2.1Equations of straight linesNotes · 10 questions
  2. 2.2Functions, domain and rangeNotes · 10 questions
  3. 2.3Graphs of functionsNotes · 10 questions
  4. 2.4Key features of graphsNotes · 10 questions
  5. 2.5Composite and inverse functionsNotes · 10 questions
  6. 2.6Quadratic functionsNotes · 10 questions
  7. 2.7Quadratic equations and inequalitiesNotes · 10 questions
  8. 2.8Reciprocal and rational functionsNotes · 10 questions
  9. 2.9Exponential and logarithmic functionsNotes · 10 questions

All IB Mathematics: Analysis and Approaches topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1A function gives exactly one output for each input
  2. 2Domain and range describe the possible inputs and outputs
  3. 3Mappings and graphs show whether a relation is a function
  4. 4Interval notation writes sets of values compactly
  5. 5Division and square roots restrict which inputs are allowed
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe

Square root function with a starting point

f(x)0246810-101234x
  • f(x) = √(x − 2)
  • Start (2, 0)