Skip to main content

Section 4.1 Inputs and Outputs

Definition 4.1.1. Function.

A function is a relation between two variables \(x\) (the input) and \(y\) (the output) where each input is related to only one output (the variables \(x\) and \(y\) are generic, different letters may be used).

Because this is an algebra course, most such relations will be defined by an algebraic equation with \(y\) alone on one side and some algebraic expression involving \(x\) on the other. We use letters to name functions; often \(f\) is used if we are giving a name to a function when \(f\) isn't already in use elsewhere in the problem. If \(y\) is related to \(x\) by the function \(f\) we write

\begin{equation*} y = f(x). \end{equation*}

We read this as “\(y\) equals \(f\) of \(x\)”.

Subsection 4.1.1 Evaluating Functions and Using Function Notation

For most people, more needs to be said about how to think about functions and how to use function notation than was given above. Suppose we are given the definition of a function as

\begin{equation*} y = f(x) = \text{some expression involving } x. \end{equation*}

From a symbolic point of view we may think of \(f\) as a certain type of shorthand.

Remark 4.1.3.

Not all functions are defined using algebraic expressions. For instance trigonometric functions can only be defined using geometry and/or concepts from calculus. However, for our purposes right now, this is an effective way to think about functions.

Because we can think of algebraic expressions as processes carried out on variables, we may also think of a function as a process performed on \(x\text{,}\) resulting in \(y\text{.}\) Equipped with the idea of equivalence of algebraic expressions, we may think of a function \(f\) in a more conceptual way. We can think of \(f\) as a factory that takes \(x\)'s as raw ingredients and makes specific \(y\)'s. Equivalence of the defining expressions for \(f\) can be thought of as rearranging the factory, but ultimately leaving the product being produced unchanged.

In applications, we usually think of the input as a variable we control and the output as one that results from a process. For this reason we call the input the independent variable and the output the dependent variable.

Given a function, you evaluate by plugging in the input for \(x\text{.}\) The result is the value of \(y\) corresponding to that \(x\)-value.

Define the function \(f\) by \(y = f(x) = 3x^2-1\text{.}\) Evaluate the following:
  1. \(\displaystyle f(2)\)

  2. \(\displaystyle f(x+1)\)

  3. \(\displaystyle 2f(x) -1\)

Solution.
  1. The function \(f\) tells us to take any input \(x\) and do the following:

    S1:
    square the input \(x\)
    S2:
    multiply S1 by \(3\)
    S3:
    subtract \(1\) from S2.

    If \(x=2\text{,}\) we will get: \(2^2 = 4\text{;}\) then multiply by \(3\) to get \(12\text{;}\) then subtract \(1\) to get \(11\text{.}\) So \(f(2) = 3\cdot 2^2 -1 = 11\text{.}\) The output of \(f\) when \(x=2\) is \(y = 11\text{.}\)

  2. This time, we think of \(x+1\) as our input, a quantity that must be evaluated before \(f\) is applied, so we enclose it in parentheses in the evaluation. Then we apply the steps and simplify by expanding and collecting like terms.

    \begin{align*} f(x+1) \amp = \amp 3(x+1)^2 - 1\\ \amp = \amp 3(x^2+2x+1) - 1 \amp \text{ square } (x+1) \\ \amp = \amp 3x^2+6x +3 - 1 \amp \text{ multiply by } 3 \\ \amp = \amp 3x^2+6x + 2. \amp \text{ subtract } 1 \end{align*}

    Note that \(y=f(x+1)\) does not define the same function as \(y=f(x)\text{;}\) for any \(x\)-value, \(y=f(x+1)\) says that we add \(1\) to \(x\) and then apply all the steps of \(f\text{.}\) This can be used to define another function, say \(y = g(x) = f(x+1)\text{.}\)

  3. In this part we first apply \(f\) to \(x\text{,}\) and then do two additional steps: multiply by \(2\) and then subtract \(1\text{.}\)

    S4:
    multiply \(f(x)\) by \(2.\)
    S5:
    subtract \(1\) from S4.

    Here we think of \(f(x)\) as being enclosed in parentheses and simplify:

    \begin{align*} 2f(x) - 1 \amp = \amp 2(3x^2-1) -1 \\ \amp = \amp 6x^2-2-1 \\ \amp = \amp 6x^2-3. \end{align*}

Let \(f(x) = \frac{1}{2} x^2\text{.}\) Find simplified expressions for each of the following, and describe the steps they represent.

  1. \(f(3x+2)\)

  2. \(3f(x) + 2\)

Let \(f(x) = x^2-4x+5\) and \(g(x) = x^2+1\text{.}\) Define another function \(h(x)\) by saying \(h(x) = g(x-2)\text{.}\) Use algebra to show that \(h(x)\) is actually the same function as \(f(x)\text{.}\)

One important question about any given function is, "What are its allowable inputs?" Using the factory analogy, what raw ingredients can that factory work with? This collection of inputs has a name, the domain.

Definition 4.1.8. The Domain of a Function.

The domain of a function \(f\) is the set of all possible inputs for which a defined output is produced.

One of the primary goals of Calculus is to investigate how functions behave at inputs “at the boundary” of the domain, hence we must be able to determine the domain. In order to determine the domain of a function, it is good to read it as a sequence of procedures, then decide if anything is not allowed at any point in that process. Those values of \(x\) that force us into an operation that is not allowed with normal arithmetic are the values of \(x\) that are not in the domain. For functions defined algebraically, the main things that are not allowed are:

  • division by zero, and

  • even roots of negative numbers.

Find the domain of the function defined by \(y= f(x) = \sqrt{x-2}\text{.}\)
Solution.
We break the function down into a sequence of steps and analyze whether any inputs must be excluded based on each step.
S1:
First we subtract \(2\) from \(x\text{.}\) There is no value of \(x\) that cannot have \(2\) subtracted from it, so we have no restictions yet.
S2:
Now take the square root of of the result of S1. We cannot put a negative value under the square root sign; thus \(x-2\) (the result of S1 must be nonnegative. Set \(x-2 \geq 0\text{,}\) we can solve this to find \(x \geq 2\text{.}\) Thus the domain is \([2, \infty)\text{.}\)
Thus the domain is \([2, \infty)\text{.}\) (See 4.1.12 to review interval notation.)
Find the domain of the function defined by
\begin{equation*} y=f(x) = \frac{\sqrt{x^2-1}}{2x+3}. \end{equation*}
Solution.
This function has two main parts, the numerator and denominator. Breaking down to steps for each, we have the following:
Numerator
S1:
Square \(x\text{.}\)
S2:
Subtract \(1\) from S1.
S3:
Take the square root of S2.
Denominator
S4:
Multiply \(x\) by 2.
S5:
Add \(3\) to S4.
Divide Numerator by Denominator

We can look at each part separately to determine the domain. For Numerator, we can certainly square any \(x\text{,}\) and subtract \(1\text{.}\) It is the square root that will be a problem. We need to have \(x^2-1 \geq 0\text{.}\) If \(x\) is between \(-1\) and \(1\text{,}\) then \(x^2\) is less than \(1\text{,}\) so \(x^2-1\) is negative. So \(-1<x<1\) must be excluded from the domain since these values would force us to take the square root of a negative number. For Denominator, we are not allowed to divide by zero. We will find where \(2x+3\) is zero and exclude it: \(x=-\frac{3}{2}\text{.}\) Thus the domain is all \(x\) with \(x\leq -1\) or \(x\geq 1\text{,}\) except for \(x=-\frac{3}{2}\text{.}\) In interval notation, this would be written as

\begin{equation*} \left(-\infty,-\frac{3}{2}\right)\bigcup \left(-\frac{3}{2},-1\right] \bigcup \left[1,\infty\right). \end{equation*}

Find the domain of each of the following functions. Carefully explain how you found it, as illustrated in the previous example. Express your answer using inequalities and words, as well as using interval notation.

  1. \(f(x) = \sqrt{3x + 1-x}\)

  2. \(g(x) = \dfrac{1}{x^2-x-6}\)

  3. \(h(x) = \dfrac{1}{\sqrt{x^2-x-6}}\)

  4. \(k(x) = f(x+1)\text{,}\) where \(f\) is the function defined in part (1) of this problem.

Table 4.1.12. Interval Notation and Inequalities
Verbal Description Inequalities Describing \(x\) Interval(s) Containing \(x\)
\(x\) is greater than \(a\) \(x>a\) \((a,\infty)\)
\(x\) is greater than or equal to \(a\) \(x\geq a\) \([a,\infty)\)
\(x\) is less than \(a\) \(x<a\) \((-\infty,a)\)
\(x\) is less than or equal to \(a\) \(x\leq a\) \((-\infty,a]\)
\(x\) is greater than (or equal to) \(a\) and
less than (or equal to) \(b\)
\(a<(\leq) x <(\leq) b\) \((a,b),(a,b],[a,b)\text{,}\) or \([a,b]\text{,}\) depending on strictness
\(x\) is greater than (or equal to) \(b\) or less
than (or equal to) \(a\)
\(x>(\geq) b\) or \(x<(\leq) a\) \((-\infty,a)\bigcup(b,\infty)\text{,}\)
with \((,),[,\) or \(]\) used at \(a\) and \(b\text{,}\) depending on strictness.

Sometimes the context of a problem restricts the domain of a function when the algebra may not. For instance, suppose a farmer wants to fence off a rectangular area with three sides of a rectangle, using a river as the fourth side. He has 100 yards of fence to use. Let \(x\) denote the length of the side of the rectangle parallel to the river. Find a formula for the function \(A(x)\) that gives the area as a function of \(x\text{.}\) What is the domain of this function based on the formula and what is it based on the context of the problem?

Subsection 4.1.2 Solving Equations Involving Functions

In solving algebraic equations, perhaps the most straightforward ones to solve are of the form

\begin{equation*} (\text{algebraic expression}) = \text{a number}, \end{equation*}

where the algebraic expression on the left represents a process applied to a variable that we may reverse to solve for \(x\text{.}\) Equipped with the idea of functions, we now can simply think of these in the form

\begin{equation*} f(x) = \mbox{a number}. \end{equation*}

More complicated equations typically have the form

\begin{equation*} f(x) = g(x), \end{equation*}

where \(f\) and \(g\) are different functions. When we think of function notation as shorthand for specified algebraic expressions, solving equations involving functions is not different than solving equations as we have before now.

Let \(f(x) = x^2-3x\) and \(g(x) = 2x-4\text{.}\) Solve the following equations.

  1. \(\displaystyle g(x) = 8\)

  2. \(\displaystyle f(x) = g(x)\)

  3. \(\displaystyle f(x+1) = g(x)\)

Solution.
  1. For (a) we use the fact that \(g(x) = 2x-4\text{,}\) so we get the following:

    \begin{align*} 2x-4 \amp = \amp 8\\ \amp \updownarrow \amp\\ 2x\amp = \amp 12\\ \amp \updownarrow \amp\\ x\amp =\amp 6. \end{align*}
  2. For (b), we use \(f(x) = x^2-3x\) and \(g(x) = 2x+4\text{.}\) Then we factor to solve:

    \begin{align*} x^2 - 3x \amp = \amp 2x-4\\ \amp \updownarrow \amp \\ x^2-5x+4 \amp = \amp 0\\ \amp \updownarrow \amp \\ (x-4)(x-1) \amp = \amp 0\\ \amp \updownarrow \amp \\ x=4 \amp \mbox{or} \amp x=1. \end{align*}
  3. For (c), we need to figure out what \(f(x+1)\) means. Now \(f\) is the function that takes any input, squares it, then multiplies a new copy of it by three, then finds the difference. In this case, our input is the quantity \((x+1)\text{.}\) So we to is substitute \((x+1)\) each time we see and \(x\) in the expression for \(f(x)\) and set it equal to \(g(x)\text{:}\)

    \begin{align*} (x+1)^2 - 3(x+1) \amp = \amp 2x-4\\ \amp \updownarrow \amp \mbox{expand, group like terms on one side}\\ x^2-3x+2 \amp = \amp 0\\ \amp \updownarrow \amp \\ (x-1)(x-2) \amp = \amp 0\\ \amp \updownarrow \amp \\ x=1 \amp \mbox{or} \amp x=2. \end{align*}

Let \(f(x) = x-1\text{,}\) and \(g(x) = (x-3)^2\text{.}\) Solve each of the following equations:

  1. \(f(x) = 2\)

  2. \(f(x) = 2x-6\)

  3. \(f(x) = g(x)\)

Let \(f(x) = \dfrac{x}{3x+7}\text{.}\) Solve the following equations, if possible. If it is impossible to solve, explain why.

  1. \(f(x) = 1\)

  2. \(f(x) = x\)

  3. \(f(x) = \frac{1}{3}\)

As seen in part (c) of the last question, some numbers may not appear as outputs of a given function. The set of numbers that do appear as outputs of a given function is called the range of the function. Another way to say what the range of \(f\) is, is that it is the set of \(y\) such that there is a solution to the equation \(y=f(x)\text{.}\) Finding the range of a function is generally a more difficult task than finding its domain; being able to find the maximum and/or minimum possible outputs of a given function is one of the main achievements of Calculus. However, in many cases we can determine the range of an algebraically defined function by some combination of the following:

  • Determine what arithmetic operations the function applies to its input, and think about what the possible results could be.

  • Solve the general equation \(y=f(x)\) for \(x\text{,}\) if possible. The result will be an expression involving \(y\text{;}\) the range of \(f\) will be the \(y\)-values that can be substituted into this expression.

Find the range of the following functions:

  1. \(\displaystyle f(x) = \dfrac{x}{3x+7}\)

  2. \(\displaystyle g(x) = -(x-3)^2 + 4\)

  3. \(\displaystyle h(x) = 2x+1\)

  4. \(\displaystyle k(x) = 2x+1 + \sqrt{x-1}\)

  1. This is the function from Question 4.10. If we solve the equation

    \begin{equation*} y = \frac{x}{3x+7} \end{equation*}

    for \(x\text{,}\) we have the general solution

    \begin{equation*} x = \frac{7y}{1-3y}. \end{equation*}

    The only \(y\)-value that cannot be substituted into this is \(y=\frac{1}{3}\text{.}\) Thus, the range of \(f\) is all real numbers except \(\frac{1}{3}\text{.}\) Using inequalities, we would write \(y<\frac{1}{3}\) or \(y>\frac{1}{3}\text{.}\) In interval notation, it would be written as \(\left(-\infty,\frac{1}{3}\right)\bigcup\left(\frac{1}{3},\infty\right)\text{.}\)

    Remark: For problems involving domain and range, using inequalities to describe the domain and range may be preferable to interval notation. This is because inequalities make explicit which variables are elements of the domain (the input variable) and the range (the output variable).

  2. For this problem, we can use our understanding of the defining expression to find the range. The function \(g\) takes \(x\) and subtracts three from it, squares the result, multiplies that by \(-1\text{,}\) and finally adds four. Noting that squares are never negative, \(-(x-3)^2\) will never be positive. This means no positive number is ever added to four. A little thought shows that any number less than or equal to four is an output of this function. So the range is \(y\leq 4\text{.}\)

  3. Algebraically solving \(y=h(x)\) for \(x\) yields \(x = \frac{y-1}{2}\text{.}\) No values of \(y\) make the right-hand side of this equation undefined, so the range is \(-\infty < y < \infty\text{.}\)

  4. For this problem, we must note the domain of the function before determining the range. Because of the inclusion of the \(\sqrt{x-1}\) term, the domain of \(k\) is \(x\geq 1\text{.}\) Possible outputs of \(2x+1\) over this domain are all numbers greater than or equal to three. Putting this together with the possible outputs of the expression \(\sqrt{x-1}\text{,}\) we see the range of \(k\) is \(y\geq 3\text{.}\)

Determine the domain and range of the following functions. Explain your answers carefully as in the last example.

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

  2. \(g(x) = \dfrac{1}{\sqrt{x-4}}\)