4.1 Addition and Subtraction of Functions

Photo by Pexels Photo by Pexels

Introduction

Not too long ago, mobile phones were only used for making phone calls, nothing else was possible. Today's smart phones, however, combine the functionality of several different devices into one convenient package.

In a similar way, mathematical functions can be combined together to create new functions. In this section we will focus on combining two or more functions through the algebraic operations of addition and subtraction.

Combining Functions by Addition

We begin by summing the outputs of two functions. This is done with normal addition since the outputs of a function are real numbers. For instance, if $\color{red}{f(}1\color{red}{) = -5}$ and $\color{blue}{g(}1\color{blue}{) = 19}$, then

[ \color{red}{f(}1\color{red}{)} + \color{blue}{g(}1\color{blue}{)} = \color{red}{-5} + \color{blue}{19} = 14 ]

In the table below, use the given values of $\color{red}{f(}x\color{red}{)}$ and $\color{blue}{g(}x\color{blue}{)}$ to find values for $(f+g)(x)$.

$x$$\color{red}{f(}x\color{red}{)}$$\color{blue}{g(}x\color{blue}{)}$$\color{red}{f(}x\color{red}{)} + \color{blue}{g(}x\color{blue}{)}$
$1$$\color{red}{-5}$$\color{blue}{19}$$\color{red}{-5} + \color{blue}{19}=14$
$2$$\color{red}{13}$$\color{blue}{-7}$
Answer
$\color{red}{13} \color{blue}{-7}=6$
$3$$\color{red}{21}$$\color{blue}{4}$
Answer
$\color{red}{21} + \color{blue}{4}=25$
$4$$\color{red}{8}$$\color{blue}{0}$
Answer
$\color{red}{8} + \color{blue}{0}=8$
$5$$\color{red}{-2}$$\color{blue}{32}$
Answer
$\color{red}{-2} + \color{blue}{32}=30$

Taking a closer look at these results you might notice that each $\color{black}{x}$ creates a single $\color{red}{f(}x\color{red}{)} + \color{blue}{g(}x\color{blue}{)}$ value.

In other words, the values of $\color{red}{f(}x\color{red}{)} + \color{blue}{g(}x\color{blue}{)}$ are a function of $\color{black}{x}$. This is only natural since $\color{red}{f}$ and $\color{blue}{g}$ are both functions of $\color{black}{x}$.

Adding Functions Graphically

Now let's take a look at what happens when you add the outputs of two functions graphically.

As you chanage $x$ in the interactive figure below the value of $\color{red}{f(}x\color{red}{)} + \color{blue}{g(}x\color{blue}{)}$ will be recorded, forming a new graph. Is this new graph a function? Does it look familiar? Make a note of your observations before continuing.

To use the interactive figure visit   https://www.geogebra.org/m/dPa7vBG3

There are two things you should notice about the resulting graph (shown here in gray).

First, it passes the vertical line test, which confirms our earlier conclusion that $\color{red}{f} + \color{blue}{g}$ is a new function of $x$. To emphasize this, from now on we will use the following notation

[ (f+g)(x) = f(x) + g(x) ]

when referring to the sum of two functions.

Second, the graph of $(f+g)(x)$ retains some of the properties of both $f(x)$ and $g(x)$. It has dips and bumps like $g(x)$, but it also has the upward trend of $f(x)$.

Adding two functions always creates a new function that blends together the behaviors of the two original functions.

The Domain of $(f+g)(x)$

Let's now suppose that both $f(x)$ and $g(x)$ are undefined over some regions, as in the figure below. How does this affect $(f+g)(x)$ ?

To use the interactive figure visit   https://www.geogebra.org/m/FOsUyxCc

In working with the interactive figure above you probably realized that $(f+g)(x)$ is only defined if both $f(x)$ and $g(x)$ are defined. If either is undefined, then $(f+g)(x)$ is undefined as well.

In this particular example, $f$ is defined on the intervals $[1, 5]$ and $[6, 8]$ while $g$ is defined on $[1,2]$ and $[3,8]$. The function $f+g$ is only defined in the regions where those intervals overlap.

The domain of $f+g$ is always the intersection of the domain of $f$ and the domain of $g$.

QUICK CHECK

  1. Suppose the domain of $f$ is {1, 2, 3, 4, 5} and the domain of $g$ is {2, 4, 6, 8, 10}. What is the domain of $f+g$?

    Answer
    The domain of $f+g$ is {2, 4}, since those are the only values that are found in both the domain of $f$ and the domain of $g$.

  2. If the domains of the functions $p$ and $q$ are $x<2$ and $x\geq-10$, respectively, what is the domain of $p+q$?

    Answer
    The domain consists of the $x$ that are in both domains. In this case, only $-10\leq x < 2$ are allowable.

Equations of $(f+g)(x)$

If the functions $f$ and $g$ are defined by equations, then the combined function $f+g$ is the sum of those two equations. Of course, this rule only makes sense when $f$ and $g$ are both defined.

As an example, consider the two functions $f(x)=\sqrt{x}$ and $g(x)=2x$. The equation for their sum is

[ (f+g)(x)=\sqrt{x} + 2x ]

Since the square root is not defined for negative values, the domain of $f+g$ must be $x\geq0$.

With an equation we evaluate $f+g$ by simply replacing $x$ with the appropriate value.

If we want to evaluate $(f+g)(9)$ for the function above, for example, we replace $x$ with $9$ and simplify.

[ \begin{align} (f+g)(9) &= \sqrt{9} + 2(9) \newline &= 3+18 \newline &= 21 \end{align} ]

On the other hand, we cannot evaluate $(f+g)(-4)$ since $x=-4$ is not in the domain of this particular function.

QUICK CHECK

Suppose $f(x)=x^{3}$ and $g(x)=\frac{1}{x}$.

  1. Find the equation for $f+g$.

    Answer
    [(f+g)(x)=f(x)+g(x)=x^{3}+\frac{1}{x}].

  2. What is the domain of the function $f+g$?

    Answer
    The domain is all real numbers except for $x=0$ since $f(x)=x^{3}$ is defined for all real numbers but $g(x)=\frac{1}{x}$ is undefined when $x=0$.

  3. What is the value of $(f+g)(2)$?

    Answer
    [(f+g)(2)=(2)^{3}+\frac{1}{2}=8+\frac{1}{2}=8.5]

Combining Functions by Subtraction

Up to this point we have focused on adding functions. Predictably, subtracting functions yields similar results.

Below values for two functions $\color{red}{f(}x\color{red}{)}$ and $\color{blue}{g(}x\color{blue}{)}$ are given. Use subtraction to complete the table values for $(f-g)(x)$.

$x$$\color{red}{f(}x\color{red}{)}$$\color{blue}{g(}x\color{blue}{)}$$\color{red}{f(}x\color{red}{)} - \color{blue}{g(}x\color{blue}{)}$
$1$$\color{red}{2}$$\color{blue}{8}$$\color{red}{2} - \color{blue}{8}=-6$
$2$$\color{red}{29}$$\color{blue}{-1}$
Answer
$\color{red}{29} - \color{blue}{-1}=30$
$3$$\color{red}{13}$$\color{blue}{-22}$
Answer
$\color{red}{13} - \color{blue}{-22}=35$
$4$$\color{red}{-1}$$\color{blue}{9}$
Answer
$\color{red}{-1} - \color{blue}{9}=-10$
$5$$\color{red}{0}$$\color{blue}{7}$
Answer
$\color{red}{0} - \color{blue}{7}=-7$

As with addition, the essential observation here is that if $f$ and $g$ are both functions of $x$, then their difference $f - g$ is also a function of $x$. Furthermore, $(f-g)(x)$ is evaluated by

[ (f-g)(x)=f(x)-g(x) ]

and its domain is the intersection of the domains of $f$ and $g$.

Take, for instance, the functions $f(x)=\frac{1}{x+6}$ and $g(x)=x+1$. Their difference is the new function

[ \begin{align} (f-g)(x) &=\frac{1}{x+6}-(x+1) \newline &=\frac{1}{x+6}-x-1 \end{align} ]

Since the domain of $f(x)=\frac{1}{x+6}$ does not include $x=-6$, we cannot include $x=-6$ in the domain of $(f-g)(x)$.

QUICK CHECK

Suppose $f(x)=\log(x)$, which has a domain of $x>0$, and $g(x)=x^{3}$, which is defined for all real numbers.

  1. Determine the equation for $(f-g)(x)$ and its domain.

    Answer
    $(f-g)(x)=\log(x)-x^{3}$. The domain is all $x>0$.

  2. Evaluate $(f-g)(2)$

    Answer
    $(f-g)(2)=\log(2) - 8\approx-7.7$

  3. Evaluate $(f-g)(-2)$

    Answer
    This is not defined, since $-2$ is not in the domain.

Symmetry

As we saw earlier, the function $f+g$ blends together the behaviors of $f$ and $g$. However, since $f$ and $g$ can have very different maximums, minimums, intercepts, etc., predicting the exact behavior of $f+g$ is difficult.

One behavior that we can usually predict is the symmetry of $f+g$. If $f$ and $g$ are both even functions (ie. symmetric across the y-axis), then so is $f+g$. Likewise, if $f$ and $g$ are odd functions (ie. symmetric around the origin), then $f+g$ is also an odd function.

You may wish to verify this with the interactive figure below. The graphs of two even functions $\color{red}{f(x)=3-x^2}$ and $\color{blue}{g(x)=x^{2/3}}$ are shown. Changing $x$ and/or pressing Play will draw the graph of $f+g$.

You are free to enter any equations you want for $\color{red}{f}$ and $\color{blue}{g}$. You might want to also try two odd functions, like $x^{3}$ and $x^{1/3}$, or some other combinations before continuing.

To use the interactive figure visit   https://www.geogebra.org/m/ghdHeX19

The same symmetry rules apply for $f-g$. If $f$ and $g$ are both even functions (ie. symmetric across the y-axis), then so is $f-g$. Likewise, if $f$ and $g$ are odd functions (ie. symmetric around the origin), then $f-g$ is also odd.

QUICK CHECK

Without graphing, decide if the following functions have even or odd symmetry.

  1. $f(x)= x^{4} - x^{2}$

    Answer
    Since both $x^{4}$ and $x^{2}$ are even, this function will have even symmetry.

  2. $g(x)=x^{3} + \ln(x)$

    Answer
    $x^{3}$ is odd but $\ln (x)$ is neither even nor odd, so this function does not have any symmetry.

  3. $h(x)=x + \frac{1}{x}$

    Answer
    Since both $x$ and $\frac{1}{x}$ are odd, this function is also odd.

Applications

It is impossible to cover every possible application of adding and subtracting functions, but we'll look at a few just to illustrate the variety.

Calculating Profit and Deductions

Photo by Hanh Nguyen on Unsplash Photo by Hanh Nguyen on Unsplash

Imagine that one day you brought a homemade cupcake to work and a friend offered to buy it from you for $\$2.50$. If the ingredients cost $\$1.00$, then you earned a profit of $\$1.50$.

Recognizing that made-from-scratch-daily cupcakes could be a commercial success, you throw caution to the wind and open your own bakery.

After several days and nights of baking, you discover that the ingredient cost for $x$ cupcakes is given by the function $\color{#E69F00}{C(x)=0.65 x + \frac{0.85}{x}}$. And since you are charging $\$2.50$ per cupcake, your revenue is given by $\color{#56B4E9}{R(x)=2.5x}$.

Your profit is the difference of these two functions. That is to say, $P(x)=(\color{#56B4E9}{R} - \color{#E69F00}{C})(x)$.

QUICK CHECK

What is the profit if you sell 500 cupcakes?
Answer
[ \begin{align} P(500) &=(\color{#56B4E9}{R} - \color{#E69F00}{C})(500) \newline &=\color{#56B4E9}{R(500)} - \color{#E69F00}{C(500)} \newline &=\color{#56B4E9}{1250} - \color{#E69F00}{325} \newline &=925 \end{align} ] So the profit on 500 cupcakes would be $925.

Now that you are running a business and earning a profit, you need to calculate how much of your weekly profits $P$ should be sent to the federal government for income tax and Social Security. Since different income levels pay different tax rates, federal income tax is a piecewise function. Let's assume that

[ \color{#009E73}{T(P)=\begin{cases} 0 & $0\leq P \leq $42 \newline 0.1(P-42) & $42 \leq P \leq $214 \newline 17.2+0.15(P-214) & $214 \leq P \leq $739 \newline 95.95+0.25(P-739) & $739 \leq P \leq $1732 \end{cases} } ]

for single taxpayers.

The Social Security deduction is fixed percent so it is a simpler function. We'll say that for self-employed individuals it is $\color{#CC79A7}{S(P)=0.153P}$, or $15.3%$ of your weekly profit.

If your weekly profit was $P=600$ dollars, then your total federal deductions are

[ \begin{align} \color{#009E73}{T(600)}+\color{#CC79A7}{S(600)} &= \color{#009E73}{17.2+0.15(600-214)}+\color{#CC79A7}{0.153(600)} \newline &= \color{#009E73}{71.5}+\color{#CC79A7}{91.80} \newline &= $166.90 \end{align} ]

QUICK CHECK

Suppose your weekly profit doubles from $P=600$ to $P=1200$. How much are your new federal deductions?
Answer
[ \begin{align} \color{#009E73}{T(1200)}+\color{#CC79A7}{S(1200)} &= \color{#009E73}{95.95+0.25(1200-739)}+\color{#CC79A7}{0.153(1200)} \newline &= \color{#009E73}{211.20}+\color{#CC79A7}{183.60} \newline &= $394.80 \end{align} ]

Catenary Curves

Another useful, but less taxing, application comes from adding an exponential growth function, like $f(x)=e^{x}$, with an exponential decay function such as $g(x)=e^{-x}$. What would the graph of such a function look like?

The figure below lets you discover the answer. Change $x$ and watch as the graph of $(f+g)(x)$ is drawn. How would you describe its shape?

To use the interactive figure visit   https://www.geogebra.org/m/e6hPPmqS

While this shape looks like a parabola, it is actually a different curve known as a catenary.

A catenary is the shape formed by any chain hanging freely under its own weight whose ends are held in place. If you have ever held a necklace or a string loosely between your hands, then you have made a catenary curve.

Upside down, or "inverted" catenary curves are frequently used in the construction of bridges and arches because of the way they distribute the load. The Gateway Arch Photo by Cecil W. Stoughton in St. Louis, Missouri is a famous example of an inverted catenary arch.

Polynomials

Perhaps the most important consequence of adding and subtracting functions is the creation of a new category of functions known as polynomials.

A polynomial is a function that can be written as a sum or difference of power functions whose powers are non-negative integers such as $0, 1, 2, 3, \dotsc$.

For example, the polynomial $p(x)=\color{red}{5x^{3}}+\color{black}{7x^{2}}\color{orange}{-4x}+\color{green}{8}$ is a sum of the four power functions $\color{red}{5x^{3}}$,   $\color{black}{7x^{2}}$,   $\color{orange}{-4x}$   and   $\color{green}{8}$.

Each power function is called a term of the polynomial. The highest power is called the degree of the polynomial, and the coefficient of that term is called the leading coefficient. The term without an $x$ is referred to as the constant term.

Polynomials cannot contain terms like $x^{5/2}$ or $x^{1.28}$ or $x^{-3}$, since the powers $5/2$ and $1.28$ are not integers and $-3$ is negative. Neither can a polynomial include any exponential or logarithmic terms like $2^{x}$, $e^{x}$ and $\ln x$.

QUICK CHECK

Decide if the following are polynomials or not. If it not, explain why not. If it is a polynomial, state its degree.

  1. $f(x)=x^{2}+1$

    Answer
    Yes, this is a polynomial. The degree is $2$.

  2. $g(x)=2^{x}+3^{x}-7$

    Answer
    No, this is not a polynomial because $2^{x}$ and $3^{x}$ are exponential functions.

  3. $h(x)=4x^{3.5}+2x^{-3/4}+6x$

    Answer
    No, this is not a polynomial because the powers $3.5$ and $-3/4$ are not non-negative integers.

  4. $p(x)=x^{12}-x^{5}+9x-23$

    Answer
    Yes, this is a $12-"th"$ degree polynomial.

  5. $q(x)=(x+3)^{2}$

    Answer
    Yes, since this can be written as $q(x)=x^{2}+6x+9$, it is a polynomial. The degree is $2$.

  6. $r(x)=\frac{1}{x-5}$

    Answer
    No, this is not a polynomial because it cannot be written as a sum of non-negative integer powers of $x$.

  7. $s(x)=\sqrt{x+4}$

    Answer
    No, this is not a polynomial because it cannot be written as a sum of non-negative integer powers of $x$.

Graphs of Polynomials

The graphs of polynomials are very reminiscent of roller coasters. We will explore their graphs is greater detail in Chapter 5. For now, use the interactive figure below to familiarize yourself with some of the possible shapes. You are free to show or hide the individual power functions and to change their coefficients.

To use the interactive figure visit   https://www.geogebra.org/m/IzqmS4xo

Looking Ahead

In this section we have seen how combining a few simple functions through the operations of function addition and subtraction can create new functions that display a wide variety of behaviors.

Polynomial functions, in particular, are prized for both the simplicity of their equations and the complexity of their behavior. That duality makes them attractive models for data and processes that change from increasing to decreasing multiple times.

Since we've just covered function addition and subtraction, you can probably guess what is coming next: multiplication and division.

Creative Commons LicenseThis work copyrighted by Nolan Mitchell under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Source files are available at https://github.com/duragauge/duragauge.github.io.

You can also download a PDF copy of the entire book here. The PDF was last updated on January 21, 2024, and may not reflect changes to the online content made after that date.