2.1 What Is a Function?


2.1.1 Learning Objectives

By the end of this section, you should be able to:

  • explain a function as an input-output relationship;
  • evaluate functions using function notation;
  • evaluate piecewise-defined functions;
  • determine the domain and range of a function; and
  • interpret functions represented by formulas, tables, graphs, and verbal descriptions.

2.1.2 Functions as Input-Output Relationships

A function is a rule that assigns exactly one output to each permitted input. The set of permitted inputs is the domain, and the set of resulting outputs is the range.

If a function is named \(f\), then \(f(x)\) is the output associated with the input \(x\). The variable \(x\) is the independent variable, while \(f(x)\) is the dependent variable.

Thinking of a function as a machine can be useful:

  1. an input enters the machine;
  2. the function rule is applied; and
  3. exactly one output is produced.

Different inputs are allowed to produce the same output. However, one input cannot produce two different outputs under the same function rule.

Example 2.1 Identifying a Function from Ordered Pairs

Determine whether each relation is a function.

\[ A=\{(1,4),(2,7),(3,7),(4,10)\} \]

\[ B=\{(1,4),(2,7),(1,9),(4,10)\} \]

Solution

Relation \(A\) is a function. Every input appears with exactly one output. The repeated output \(7\) is allowed.

Relation \(B\) is not a function because the input \(1\) is paired with both \(4\) and \(9\).

Exercise 2.1 Determine whether

\[ \{(-2,5),(0,1),(3,5),(6,-4)\} \]

defines a function.

Show answer

Answer: Yes. Every input is assigned exactly one output.


2.1.3 Function Notation and Evaluation

Function notation names both the function and its input. If

\[ f(x)=2x^2-3x+1, \]

then \(f(4)\) means substitute \(4\) for every occurrence of \(x\):

\[ f(4)=2(4)^2-3(4)+1. \]

The expression inside the parentheses does not need to be a single number. To find \(f(a+h)\), replace every \(x\) in the rule with \(a+h\).

Example 2.2 Evaluating a Function at Several Inputs

Let

\[ g(x)=x^2-4x+6. \]

Find \(g(-2)\), \(g(3)\), and \(g(t+1)\).

Solution

\[ g(-2)=(-2)^2-4(-2)+6=4+8+6=\boxed{18}. \]

\[ g(3)=3^2-4(3)+6=9-12+6=\boxed{3}. \]

For an algebraic input, use parentheses carefully:

\[ \begin{aligned} g(t+1) &=(t+1)^2-4(t+1)+6\\ &=t^2+2t+1-4t-4+6\\ &=\boxed{t^2-2t+3}. \end{aligned} \]

Exercise 2.2 For \(h(x)=3x^2+2x-5\), find \(h(-1)\).

Show answer

Answer:

\[ h(-1)=3(-1)^2+2(-1)-5=\boxed{-4}. \]


2.1.4 Piecewise-Defined Functions

A piecewise-defined function uses different formulas on different parts of its domain. The condition beside each formula tells you which rule to use.

For example,

\[ p(x)= \begin{cases} 2x+3, & x<1,\\ x^2, & x\ge 1. \end{cases} \]

To evaluate \(p(x)\), first determine which condition the input satisfies. Then use only the corresponding formula.

Example 2.3 Evaluating a Piecewise-Defined Function

Let

\[ q(x)= \begin{cases} -x+4, & x\le 0,\\ 2x^2-1, & x>0. \end{cases} \]

Find \(q(-3)\), \(q(0)\), and \(q(2)\).

Solution

Both \(-3\) and \(0\) satisfy \(x\le0\):

\[ q(-3)=-(-3)+4=\boxed{7}, \]

\[ q(0)=-(0)+4=\boxed{4}. \]

Since \(2>0\), use the second rule:

\[ q(2)=2(2)^2-1=\boxed{7}. \]

Exercise 2.3 For

\[ r(x)= \begin{cases} x+5, & x<2,\\ 3x-1, & x\ge2, \end{cases} \]

find \(r(2)\).

Show answer

Answer: Since \(2\ge2\), use the second rule:

\[ r(2)=3(2)-1=\boxed{5}. \]


2.1.5 Domain and Range

The domain contains every input for which a function is defined. Unless a context imposes additional restrictions, begin with all real numbers and remove inputs that cause problems.

Common restrictions include:

  • a denominator cannot equal zero;
  • an even root cannot have a negative radicand when working with real numbers; and
  • quantities in a model may have practical restrictions, such as time being nonnegative.

The range contains the outputs the function can produce. Finding a range may require algebraic reasoning, a graph, or both.

Example 2.4 Finding a Domain Algebraically

Find the domain of

\[ f(x)=\frac{\sqrt{x+2}}{x-5}. \]

Solution

The square root requires

\[ x+2\ge0\quad\Longrightarrow\quad x\ge-2. \]

The denominator requires \(x\ne5\). Therefore, the domain is

\[ \boxed{[-2,5)\cup(5,\infty)}. \]

Exercise 2.4 Find the domain of

\[ k(x)=\frac{1}{\sqrt{x-3}}. \]

Show answer

Answer: The radicand must be positive because the square root is in the denominator:

\[ x-3>0. \]

The domain is \(\boxed{(3,\infty)}\).


2.1.6 Representations of Functions

A function can be represented in several ways:

  • verbally, by describing how two quantities are related;
  • numerically, with a table of inputs and outputs;
  • algebraically, with a formula or equation; and
  • graphically, with points or a curve in the coordinate plane.

Each representation emphasizes different information. A formula is convenient for exact calculation, a table highlights selected values, and a graph reveals overall behaviour.

Example 2.5 Interpreting a Table of Values

The table shows the temperature \(T\), in degrees Celsius, of a liquid \(t\) minutes after it was placed in a refrigerator.

\(t\) 0 5 10 15
\(T(t)\) 24 18 14 11

Find \(T(10)\) and interpret its meaning.

Solution

\[ \boxed{T(10)=14}. \]

Ten minutes after the liquid was placed in the refrigerator, its temperature was \(14^\circ\text{C}\).

Exercise 2.5 Using the table above, find \(T(15)-T(5)\) and interpret the result.

Show answer

Answer:

\[ T(15)-T(5)=11-18=\boxed{-7}. \]

The temperature decreased by \(7^\circ\text{C}\) between 5 and 15 minutes.


2.1.7 Conceptual Takeaways

  • A function assigns exactly one output to each permitted input.
  • Different inputs may produce the same output.
  • Function notation identifies both a rule and the input to which it is applied.
  • A piecewise-defined function selects a rule according to the input.
  • Domain restrictions come from algebraic operations and from the context of a model.
  • Formulas, tables, graphs, and verbal descriptions are complementary representations of functions.

2.1.8 Skills You Should Be Able to Do

  • Decide whether a relation represents a function.
  • Evaluate functions at numerical and algebraic inputs.
  • Evaluate piecewise-defined functions.
  • Determine domains using algebraic restrictions.
  • Identify or describe ranges.
  • Interpret function notation in context.
  • Translate among verbal, numerical, algebraic, and graphical representations.

2.1.9 Practice Problems with Solutions

  1. Determine whether \(\{(0,3),(1,5),(2,5),(3,8)\}\) defines a function.

    Show Solution

    Each input occurs only once, so every input has exactly one output. The relation \(\boxed{\text{is a function}}\).

  2. Determine whether \(\{(-1,2),(0,4),(-1,6),(3,8)\}\) defines a function.

    Show Solution

    The input \(-1\) is assigned both \(2\) and \(6\). Therefore, the relation \(\boxed{\text{is not a function}}\).

  3. Let \(f(x)=4x^2-x-3\). Find \(f(-2)\).

    Show Solution

    \[ f(-2)=4(-2)^2-(-2)-3=16+2-3=\boxed{15}. \]

  4. Let \(g(x)=2x^2+5\). Simplify \(g(a-1)\).

    Show Solution

    \[ \begin{aligned} g(a-1) &=2(a-1)^2+5\\ &=2(a^2-2a+1)+5\\ &=\boxed{2a^2-4a+7}. \end{aligned} \]

  5. For

    \[ p(x)= \begin{cases} x^2+1, & x<0,\\ 3x-2, & x\ge0, \end{cases} \]

    find \(p(-2)\), \(p(0)\), and \(p(4)\).

    Show Solution

    Use \(x^2+1\) for the negative input:

    \[ p(-2)=(-2)^2+1=\boxed{5}. \]

    Use \(3x-2\) for \(0\) and \(4\):

    \[ p(0)=3(0)-2=\boxed{-2}, \]

    \[ p(4)=3(4)-2=\boxed{10}. \]

  6. Find the domain of

    \[ h(x)=\frac{x+1}{x^2-9}. \]

    Show Solution

    Factor the denominator:

    \[ x^2-9=(x-3)(x+3). \]

    Exclude \(x=3\) and \(x=-3\). The domain is

    \[ \boxed{(-\infty,-3)\cup(-3,3)\cup(3,\infty)}. \]

  7. Find the domain of \(r(x)=\sqrt{7-2x}\).

    Show Solution

    Require the radicand to be nonnegative:

    \[ 7-2x\ge0 \quad\Longrightarrow\quad x\le\frac72. \]

    The domain is

    \[ \boxed{(-\infty,7/2]}. \]

  8. A parking garage charges \(\$4\) for the first hour and \(\$2.50\) for each additional hour or part of an hour. Explain why the total cost is naturally represented by a piecewise or step function.

    Show Solution

    The rule changes after the first hour, and the cost increases in fixed jumps rather than continuously. Therefore, different time intervals require different rules, making a \(\boxed{\text{piecewise step function}}\) appropriate.