Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 37 ยท Functions and Modeling

Function Notation, Domain and Range

Understand functions as input-output rules, read and use f(x) notation, find domain and range, and apply the vertical line test, with examples and code.

A function is a rule that assigns to each input exactly one output. A vending machine is a good picture: you press one button (input) and get one snack (output). Pressing the same button never gives two different snacks.

You have already used functions: y = 2x + 3 gives one y for each x. This lesson gives you the standard notation and the vocabulary to talk about functions precisely.

Function notation

We name a function with a letter, often f, and write f(x) (read "f of x") for the output when the input is x. So

f(x) = 2x + 3

means "take the input, double it, add 3". To evaluate the function, replace x with the input everywhere.

  • f(4) = 2(4) + 3 = 11
  • f(โˆ’1) = 2(โˆ’1) + 3 = 1
  • f(a + 1) = 2(a + 1) + 3 = 2a + 5

f(x) does not mean f times x. It is one symbol meaning "the output of f at x".

For a quadratic function such as g(x) = xยฒ โˆ’ 3x:

  • g(5) = 25 โˆ’ 15 = 10
  • g(โˆ’2) = 4 + 6 = 10
  • g(0) = 0

Different inputs may give the same output, as g(5) and g(โˆ’2) do. That is fine. What a function may not do is give two outputs for one input.

Python Evaluate functions and build a table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The vertical line test

A graph represents a function if no vertical line crosses it more than once. Why? A vertical line marks one input value; two crossing points would mean two outputs for that input.

  • The line y = 2x + 3 passes the test.
  • The parabola y = xยฒ โˆ’ 3x passes.
  • A circle fails: a vertical line through its middle crosses twice.
  • The sideways parabola x = yยฒ fails, since x = 4 gives y = 2 and y = โˆ’2.

Domain and range

  • The domain is the set of all allowed inputs.
  • The range is the set of all outputs the function actually produces.

When no domain is stated, use all real numbers for which the rule makes sense. Two things cause trouble at this level:

  1. Division by zero. For h(x) = 1/(x โˆ’ 2), x = 2 is not allowed. Domain: all real numbers except 2.
  2. Square roots of negatives. For k(x) = โˆš(x โˆ’ 3) you need x โˆ’ 3 โ‰ฅ 0, so the domain is x โ‰ฅ 3.

For the range, think about the graph's lowest and highest points.

Function Domain Range
f(x) = 2x + 3 all real numbers all real numbers
g(x) = xยฒ all real numbers y โ‰ฅ 0
k(x) = โˆš(x โˆ’ 3) x โ‰ฅ 3 y โ‰ฅ 0
h(x) = 1/(x โˆ’ 2) x โ‰  2 y โ‰  0
p(x) = โˆ’xยฒ + 4 all real numbers y โ‰ค 4

For the last one, the vertex (0, 4) is the highest point, so outputs never exceed 4.

A function can also have a restricted domain from context. If A(w) = w(w + 3) gives the area of a garden of width w, then only w > 0 makes sense.

Python Find which inputs a rule accepts

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Mapping diagrams

A mapping diagram draws arrows from inputs to outputs. It is a function when each input has exactly one arrow leaving it.

flowchart LR
    subgraph Inputs
        a1["โˆ’2"]
        a2["1"]
        a3["2"]
    end
    subgraph Outputs
        b1["4"]
        b2["1"]
    end
    a1 --> b1
    a2 --> b2
    a3 --> b1

Two different inputs (โˆ’2 and 2) may share an output. This is a function, since every input has one arrow.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. If f(x) = 3x โˆ’ 5, what is f(4)?

    f(4) = 3(4) โˆ’ 5 = 12 โˆ’ 5 = 7.
  2. 2. Which of these graphs is NOT a function?

    A vertical line through a circle meets it twice, so one input would have two outputs.
  3. 3. What is the domain of h(x) = 1/(x + 4)?

    The denominator is zero when x = โˆ’4, so that input is excluded.
  4. 4. What is the range of y = xยฒ + 1?

    xยฒ is at least 0, so xยฒ + 1 is at least 1.

Summary

  • A function gives exactly one output for each input; f(x) names the output.
  • To evaluate, substitute the input for x everywhere.
  • A graph is a function if it passes the vertical line test.
  • Domain: allowed inputs (avoid division by zero and roots of negatives). Range: the outputs produced.

Next: Exponential Functions