Skip to main content
Mathematics LibreTexts

5.1: Introduction to functions

  • Page ID
    45052
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    A great way to visualize the definition of a function is to look at the graphs of a few relationships.

    Vertical Line Test

    Definition: Vertical Line Test

    A given graph is a function if and only if every vertical line intersects the graph at most once, i.e., for every possible drawn vertical line through the graph, the line only intersects the graph at most one time. This test is called the vertical line test.

    Example 5.1.1

    Determine which of the following graphs represents a function.

    clipboard_ef217a1776729da99b8d1444039e119df.png
    Figure 5.1.1

    Solution

    First, we draw vertical lines through each of these graphs. Then we determine the number of times the lines intersect the graph for each graph. If the vertical lines only intersect each graph at most once, then the graph is a function per the vertical line test.

    clipboard_ec67668facf4cb05a37a2030602bea0a6.png
    Figure 5.1.2

    We can see for all graphs, except for B., pass the vertical line test. Notice on graphs A., C., and D., all vertical lines pass through the graphs only once. However, in B., we see the line intersects the graph two times. Even though the far left line touches the circle only once, the vertical line test fails for the other lines. Hence, the vertical line test fails for B. and B. is not a function, where graphs A., C., and D. represent functions.

    Independent and Dependent Variables

    Definition: Dependent & Independent Variables

    We call \(f(x)\) or \(y\) the dependent variable and \(x\) the independent variable. Hence, the independent variable is also known as the input and the dependent variable is also known as the output.

    Example 5.1.2

    What is the independent and dependent variable?

    1. \(f(x)=\dfrac{3}{2}x+1\)
    2. \(g(r)=r^3\)
    3. \(h(t)=\dfrac{t}{t^2-25}\)
    4. \(y=\sqrt{n-16}\)

    Solution

    1. Since the variable inside the parenthesis of \(f(x)\) is \(x\), then the independent variable is \(x\), and \(f(x)\) is the dependent variable.
    2. Since the variable inside the parenthesis of \(g(r)\) is \(r\), then the independent variable is \(r\), and \(g(r)\) is the dependent variable.
    3. Since the variable inside the parenthesis of \(h(t)\) is \(t\), then the independent variable is \(t\), and \(h(t)\) is the dependent variable.
    4. Since the variable on the right side is \(n\), then the independent variable is \(n\), and \(y\) is the dependent variable. Note, we could rewrite \(y\) so that it is clear that \(n\) is the independent variable by writing \(y(n)\). This is good example of the reasons we like function notation- to make the independent and dependent variables more obvious.
    Example 5.1.3

    What is the independent and dependent variable? What does each variable represent?

    1. The cost \(C(x)\), where \(x\) is the number of miles driven, of renting a car for a day is \(C(x) = 1.46x + 25\).
    2. A rocket is launched at \(t = 0\) seconds. Its height, in feet, above sea-level, as a function of time, \(t\), is given by \(h(t) = −16t^2 + 96t + 256\).
    3. The profit for a certain commodity, \(n\), where \(n\) is in units, is given by the function \(P(n) = −25n^2 + 425n + 1500\).
    4. The revenue, \(R(x)\), of producing and selling \(x\) Awesome Hearing Aids is modeled by the function \(R(x) = −6x^2 + 67x\).

    Solution

    1. Since the variable inside the parenthesis of \(C(x)\) is \(x\), then the independent variable is \(x\), where \(x\) represents the number of miles driven, and \(C(x)\) is the dependent variable, where \(C(x)\) represents the cost of renting a car.
    2. Since the variable inside the parenthesis of \(h(t)\) is \(t\), then the independent variable is \(t\), where \(t\) is the number of seconds, and \(h(t)\) is the dependent variable, where \(h(t)\) represents the height in feet after \(t\) seconds.
    3. Since the variable inside the parenthesis of \(P(n)\) is \(n\), then the independent variable is \(n\), where \(n\) is the number of units, and \(P(n)\) is the dependent variable, where \(P(n)\) represents the profit for selling \(n\) units of a commodity.
    4. Since the variable inside the parenthesis of \(R(x)\) is \(x\), then the independent variable is \(x\), where \(x\) is the number of hearing aids, and \(R(x)\) is the dependent variable, where \(R(x)\) represents the revenue after selling \(x\) hearing aids.
    Note

    The concept of a function was first introduced by Arab mathematician Sharaf al-Din al-Tusi in the late \(12^{\text{th}}\) century.

    Domains of Functions

    Once we know a relationship is a function, we may be interested in all the values that we can plug-n-chug into the function. The set of all values we are allowed to plug-n-chug into a function is called the domain.

    Definition: Domain & Range

    The domain of a function is the set of all inputs of the relation, i.e., all that \(x\) can be. The range of a function is the set of all outputs of the relation, i.e., all that \(y\) can be.

    Note

    When finding the domain, it is more efficient to consider the values that should be excluded from the domain and then exclude those values from the set.

    Example 5.1.4

    Find the domain: \(f(x)=\dfrac{3x-1}{x^2+x-6}\)

    Solution

    Taking the above note into consideration, let’s try to find the \(x\) values that should be excluded from the domain. We know, with fractions, that the denominator cannot be zero. Hence, we know we should exclude any values for \(x\) that make the denominator zero. Let’s find these \(x\) values by setting the denominator to zero and solve.

    \[\begin{array}{rl}x^2+x-6=0&\text{Solve by factoring} \\ (x+3)(x-2)=0&\text{Set each factor equal to zero} \\ x+3=0\quad\text{or}\quad x-2=0&\text{Solve each equation} \\ x=-3\quad\text{or}\quad x=2&x\text{ values that should be excluded from the domain}\end{array}\nonumber\]

    This means that \(x\) can be any value except for \(−3\) and \(2\). If \(x\) were one of these two values, the function would be undefined. Thus, the domain for \(f(x)\) is \(\{x|x\neq −3, 2\}\) or, in interval notation, \((−∞, −3) ∪ (−3, 2) ∪ (2, ∞)\).

    Example 5.1.5

    Find the domain: \(g(x)=3x^2-x\)

    Solution

    Since there are no obvious characteristics of \(g(x)\) such that \(g(x)\) would contain any excluded values, then we say \(g(x)\) has domain of all real numbers or, in interval notation, \((−∞, ∞)\). In a future section, we will look at the graphs of functions, which may help us in finding the domain, too.

    Example 5.1.6

    Find the domain: \(x(t)=\sqrt{2t-3}\)

    Solution

    Taking the above note into consideration, let’s try to find the \(t\) values that should be excluded from the domain. We know, with square roots, that the radicand cannot be less than zero. Hence, we know we should exclude any values for \(t\) that make the radicand less than zero. Let’s find these \(t\) values by setting the radicand to less than zero.

    \[\begin{array}{rl}2t-3<0&\text{Solve for the inequality} \\ 2t<3&\text{Divide by the coefficient of }t \\ t<\dfrac{3}{2}&t\text{ values that should be excluded from the domain}\end{array}\nonumber\]

    This means that \(t\) can be any value except for any numbers less than \(\dfrac{3}{2}\). If t were a value less than \(\dfrac{3}{2}\), then the function would be undefined. Thus, the domain for \(x(t)\) is \(\left\{ t\left| t\geq\dfrac{3}{2}\right.\right\}\) or, in interval notation, \(\left(\dfrac{3}{2},\infty\right)\).

    Function Notation

    Let’s take functions further by one step. Since functions are relationships between input and output values, and are represented by graphs, then we certainly can evaluate functions for certain input and output values.

    Example 5.1.7

    Evaluate \(f(x)=3x^2-4x\) for \(x=-2\). What is the ordered-pair?

    Solution

    \[\begin{array}{rl}f(x)=3x^2-4x&\text{Substitute }-2\text{ for every }x\text{ in the function} \\ f(\color{blue}{-2}\color{black}{})=3(\color{blue}{-2}\color{black}{})^2-4(\color{blue}{-2}\color{black}{})&\text{Simplify} \\ f(-2)=20&\text{When the input is }-2\text{, the output is }20\end{array}\nonumber\]

    Hence, \(f(-2)=20\). Thus, the ordered-pair, \((x,y)\), is \((-2,20)\).

    Example 5.1.8

    Given \(h(x) = 3^{2x−6}\), find \(h(4)\). What is the ordered-pair?

    Solution

    \[\begin{array}{rl}h(x)=3^{2x-6}&\text{Substitute }4\text{ for every }x\text{ in the function} \\ h(\color{blue}{4}\color{black}{})=3^{2(\color{blue}{4}\color{black}{})-6}&\text{Simplify} \\ h(4)=3^{8-6}&\text{Subtract in the exponent} \\ h(4)=3^2&\text{Evaluate} \\ h(4)=9&\text{When the input is }4\text{, the output is }9\end{array}\nonumber\]

    Hence, \(h(4) = 9\). Thus, the ordered-pair, \((x, y)\), is \((4, 9)\).

    Example 5.1.9

    Given \(k(a) = 2|a + 4|\), find \(k(−7)\). What is the ordered-pair?

    Solution

    \[\begin{array}{rl}k(a)=2|a+4|&\text{Substitute }-7\text{ for every }a\text{ in the function} \\ k(\color{blue}{-7}\color{black}{})=2|\color{blue}{-7}\color{black}{}+4|&\text{Simplify} \\ k(-7)=6&\text{When the input is }-7\text{, the output is }6\end{array}\nonumber\]

    Hence, \(k(−7) = 6\). Thus, the ordered-pair, \((x, y)\), is \((−7, 6)\).

    Evaluate Functions with Expressions

    As the above examples show, the function can take many different forms, but the method to evaluate the function never changes, just the problems do. This leads into substituting expressions into functions using the same process.

    Example 5.1.10

    Given \(g(x)=x^4+1\), find \(g(3x)\).

    Solution

    First, recall the method for evaluating functions never changes, just the problems. Hence, we will substitute \(3x\) for every \(x\) in \(g\), as usual.

    \[\begin{array}{rl}g(x)=x^4+1&\text{Substitute }3x\text{ for every }x\text{ in the function} \\ g(\color{blue}{3x}\color{black}{})=(\color{blue}{3x}\color{black}{})^4+1&\text{Simplify} \\ g(3x)=81x^4+1&\text{When the input is }3x\text{, the output is }81x^4+1\end{array}\nonumber\]

    Example 5.1.11

    Given \(p(t) = t^2 − t\), find \(p(t + 1)\).

    Solution

    First, recall the method for evaluating functions never changes, just the problems. Hence, we will substitute \(t + 1\) for every \(t\) in \(p\), as usual.

    \[\begin{array}{rl}p(t)=t^2-t&\text{Substitute }t+1\text{ for every }t\text{ in the function} \\ p(\color{blue}{t+1}\color{black}{})=(\color{blue}{t+1}\color{black}{})^2-(\color{blue}{t+1}\color{black}{})&\text{Simplify by squaring the first term} \\ p(t+1)=t^2+2t+1-(t+1)&\text{Distribute the negative} \\ p(t+1)=t^2+2t+1-t-1&\text{Simplify} \\ p(t+1)=t^2+t&\text{When the input is }t+1\text{, the output is }t^2+t\end{array}\nonumber\]

    Note

    In these last examples, essentially we are substituting a function into another function. The interesting part about these examples is when we substitute an expression into a function, we are creating an entirely new function. How awesome, right?

    Introduction to Functions Homework

    Determine whether the given ordered pair(s) is a solution to the system.

    Exercise 5.1.1

    Determine which of the following are functions. If not, explain.

    clipboard_e4328b28e4d079bfc67bd7b30d20ef61c.png
    Figure 5.1.1

    Specify the domain of each following function. List the independent and dependent variables, and their units.

    Exercise 5.1.2

    \(f(x)=-5x+1\)

    Exercise 5.1.3

    \(s(t)=\dfrac{1}{t^2}\)

    Exercise 5.1.4

    \(s(t)=\dfrac{1}{t^2+1}\)

    Exercise 5.1.5

    \(f(x)=\dfrac{-2}{x^2-3x-4}\)

    Exercise 5.1.6

    \(y(x)=\dfrac{x}{x^2-25}\)

    Exercise 5.1.7

    \(f(x)=\sqrt{5-4x}\)

    Exercise 5.1.8

    \(f(x)=x^2-3x-4\)

    Exercise 5.1.9

    \(f(x)=\sqrt{x-16}\)

    Exercise 5.1.10

    \(h(x)=\dfrac{\sqrt{3x-12}}{x^2-25}\)

    Exercise 5.1.11

    A rocket is launched at \(t = 0\) seconds. Its height, in meters above sea-level, as a function of time is given by \(h(t) = −4.9t^2 + 190t + 423\).

    Exercise 5.1.12

    The profit (in dollars), \(P\), for a certain commodity, \(n\), where \(n\) is in units, is given by the function \(P(n) = −25n^2 + 375n + 850\).

    Exercise 5.1.13

    The revenue in dollars, \(R(x)\), of producing and selling \(x\) Awesome Hearing Aids is modeled by the function \(R(x) = x^2 + 55x\).

    Exercise 5.1.14

    The cost in dollars \(C(x)\), where \(x\) is the number of miles driven, of renting a car for a day is \(C(x) = 1.25x + 33\).

    For each given function, evaluate the function at the value or expression. What is the ordered-pair?

    Exercise 5.1.15

    \(g(x) = 4x − 4; g(0)\)

    Exercise 5.1.16

    \(f(x) = |3x + 1| + 1; f(0)\)

    Exercise 5.1.17

    \(f(n) = −2| − n − 2| + 1; f(−6)\)

    Exercise 5.1.18

    \(f(t) = 3^t − 2; f(−2)\)

    Exercise 5.1.19

    \(f(t) = |t + 3|; f(10)\)

    Exercise 5.1.20

    \(w(n) = 4n + 3; w(2)\)

    Exercise 5.1.21

    \(w(n) = 2^n + 2; w(−2)\)

    Exercise 5.1.22

    \(p(n) = −3|n|; p(7)\)

    Exercise 5.1.23

    \(p(t) = −t^3 + t; p(4)\)

    Exercise 5.1.24

    \(k(n) = |n − 1|; k(3)\)

    Exercise 5.1.25

    \(g(n) = −3 · 5^{−n}; g(2)\)

    Exercise 5.1.26

    \(f(x) = x^2 + 4; f(−9)\)

    Exercise 5.1.27

    \(f(n) = n − 3; f(10)\)

    Exercise 5.1.28

    \(f(a) = 3^{a−1} − 3; f(2)\)

    Exercise 5.1.29

    \(w(x) = x^2 + 4x; w(−5)\)

    Exercise 5.1.30

    \(w(x) = −4x + 3; w(6)\)

    Exercise 5.1.31

    \(p(x) = −|x| + 1; p(5)\)

    Exercise 5.1.32

    \(k(a) = a + 3; k(−1)\)

    Exercise 5.1.33

    \(k(x) = −2 · 4^{2x−2}; k(2)\)

    Exercise 5.1.34

    \(p(t) = −2 · 4^{2t+1} + 1; p(−2)\)

    For each given function, evaluate the function at the value or expression and simplify.

    Exercise 5.1.35

    \(h(x) = x^3 + 2; h(−4x)\)

    Exercise 5.1.36

    \(h(x) = 3x + 2; h(−1 + x)\)

    Exercise 5.1.37

    \(h(t) = 2| − 3t − 1| + 2; h(t^2)\)

    Exercise 5.1.38

    \(g(x) = x + 1; g(3x)\)

    Exercise 5.1.39

    \(g(x) = 5^x; g(−3 − x)\)

    Exercise 5.1.40

    \(h(n) = 4n + 2; h(n + 2)\)

    Exercise 5.1.41

    \(h(a) = −3 · 2^{a+3}; h\left(\dfrac{a}{4}\right)\)

    Exercise 5.1.42

    \(h(x) = x^2 + 1; h\left(\dfrac{x}{4}\right)\)

    Exercise 5.1.43

    \(h(t) = t^2 + t; h(t^2)\)

    Exercise 5.1.44

    \(h(n) = 5^{n−1} + 1; h\left(\dfrac{n}{2}\right)\)


    This page titled 5.1: Introduction to functions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Darlene Diaz (ASCCC Open Educational Resources Initiative) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.