Algebraic Combinations of Functions

Just as we combine numbers with arithmetic, we can combine functions by addition, subtraction, multiplication, and division. The resulting function's domain is determined by where all component functions are simultaneously defined.

Quick Reference

Operation Formula Domain
Sum $f + g$ $(f+g)(x) = f(x) + g(x)$ $\operatorname{Dom}(f) \cap \operatorname{Dom}(g)$
Difference $f - g$ $(f-g)(x) = f(x) - g(x)$ $\operatorname{Dom}(f) \cap \operatorname{Dom}(g)$
Product $f \cdot g$ $(f \cdot g)(x) = f(x) \cdot g(x)$ $\operatorname{Dom}(f) \cap \operatorname{Dom}(g)$
Quotient $f/g$ $(f/g)(x) = f(x)/g(x)$ $\operatorname{Dom}(f) \cap \operatorname{Dom}(g) \cap \{x \mid g(x) \neq 0\}$

Arithmetic of Functions

Given two functions $f$ and $g$, we define:

$ \begin{aligned} (f+g)(x) &= f(x) + g(x), \\ (f-g)(x) &= f(x) - g(x), \\ (f \cdot g)(x) &= f(x) \cdot g(x), \\ (f/g)(x) &= \frac{f(x)}{g(x)}. \end{aligned} $

The domains of $f+g$, $f-g$, and $f \cdot g$ are

$\operatorname{Dom}(f) \cap \operatorname{Dom}(g),$

the set of $x$-values where both $f(x)$ and $g(x)$ are defined simultaneously.

For $f/g$, we additionally exclude any $x$ where $g(x) = 0$:

$\operatorname{Dom}(f/g) = \operatorname{Dom}(f) \cap \operatorname{Dom}(g) \cap \{x \mid g(x) \neq 0\}.$

Let $f(x) = \dfrac{1}{x-3}$ and $g(x) = \sqrt{x-2}$. Find $f+g$, $f-g$, $f \cdot g$, $f/g$, and $g/f$, with their domains. Also evaluate each at $x = 5$.

Solution Domains of $f$ and $g$: $\operatorname{Dom}(f) = \mathbb{R} - \{3\}, \qquad \operatorname{Dom}(g) = [2, \infty).$ Intersection: $\{x \mid x \geq 2 \text{ and } x \neq 3\} = [2,3) \cup (3,\infty)$. Combined functions and their domains: $(f+g)(x) = \frac{1}{x-3} + \sqrt{x-2}, \quad \operatorname{Dom} = [2,3) \cup (3,\infty).$ $(f-g)(x) = \frac{1}{x-3} - \sqrt{x-2}, \quad \operatorname{Dom} = [2,3) \cup (3,\infty).$ $(f \cdot g)(x) = \frac{\sqrt{x-2}}{x-3}, \quad \operatorname{Dom} = [2,3) \cup (3,\infty).$ For $f/g$, also exclude $x = 2$ where $g(2) = 0$: $\left(\frac{f}{g}\right)(x) = \frac{1}{(x-3)\sqrt{x-2}}, \quad \operatorname{Dom} = (2,3) \cup (3,\infty).$ Since $f(x) = 1/(x-3) \neq 0$ for all $x$ in its domain: $\left(\frac{g}{f}\right)(x) = (x-3)\sqrt{x-2}, \quad \operatorname{Dom} = [2,3) \cup (3,\infty).$ Values at $x = 5$: $ \begin{aligned} (f+g)(5) &= \frac{1}{2} + \sqrt{3}, \\ (f-g)(5) &= \frac{1}{2} - \sqrt{3}, \\ (fg)(5) &= \frac{\sqrt{3}}{2}, \\ \left(\frac{f}{g}\right)(5) &= \frac{1}{2\sqrt{3}}, \\ \left(\frac{g}{f}\right)(5) &= 2\sqrt{3}. \end{aligned} $

A Subtle Domain Issue with Roots

Are the functions $h_1(x) = \sqrt{x-1}\,\sqrt{2-x}$ and $h_2(x) = \sqrt{(x-1)(2-x)}$ equal? What about $u_1(x) = \sqrt{x-1}\,\sqrt{x-2}$ and $u_2(x) = \sqrt{(x-1)(x-2)}$?

Solution (a) $h_1$ vs. $h_2$: $\operatorname{Dom}(h_1) = [1,\infty) \cap (-\infty,2] = [1,2]$. For $h_2$, we need $(x-1)(2-x) \geq 0$. A sign chart shows this holds on $[1,2]$. So $\operatorname{Dom}(h_1) = \operatorname{Dom}(h_2) = [1,2]$, and $h_1(x) = h_2(x)$ on $[1,2]$. They are equal.
Sign chart for (x-1)(2-x) with roots at x=1 and x=2.
Sign chart for $(x-1)(2-x)$: product is nonnegative on $[1,2]$.
(b) $u_1$ vs. $u_2$: $\operatorname{Dom}(u_1) = [1,\infty) \cap [2,\infty) = [2,\infty)$. For $u_2$, we need $(x-1)(x-2) \geq 0$. A sign chart shows this holds on $(-\infty,1] \cup [2,\infty)$. So $\operatorname{Dom}(u_1) = [2,\infty)$ but $\operatorname{Dom}(u_2) = (-\infty,1] \cup [2,\infty)$. The domains differ, so $u_1$ and $u_2$ are not equal.
Sign chart for (x-1)(x-2) with roots at x=1 and x=2.
Sign chart for $(x-1)(x-2)$: product is nonnegative on $(-\infty,1] \cup [2,\infty)$.

Graphs of Combined Functions

To graph $f + g$: for each $x$, add the $y$-coordinates of $f$ and $g$ geometrically.

The graphs of $f(x) = x$ and $g(x) = x^3 - 4x + 1$ are given. Sketch the graph of $h = f + g$ by graphical addition.

Solution $h(x) = f(x) + g(x) = x^3 - 3x + 1$. For each $x$, the height of $h$ equals the sum of the heights of $f$ and $g$:
Graphs of f(x) = x and g(x) = x³ - 4x + 1.
Graphs of $f$ and $g$.
At the points where $f$ and $g$ intersect (approximately $x \approx -2.3, 0.2, 2.1$), $h(x) = 2f(x) = 2g(x)$.
Resulting graph of h(x) = x³ - 3x + 1 by graphical addition.
Graph of $h(x) = x^3 - 3x + 1$ obtained by graphical addition.

Frequently Asked Questions

Why does the domain of f/g exclude points where g(x) = 0? Division by zero is undefined. Even if $x$ is in both $\operatorname{Dom}(f)$ and $\operatorname{Dom}(g)$, if $g(x) = 0$ at that point, the quotient $f(x)/g(x)$ does not exist. We must exclude those points from the domain of $f/g$.

Can the domain of f + g be larger than the domain of either f or g? No. The domain of $f + g$ is a subset of each individual domain. It is the intersection, which is at most as large as either factor and often smaller.

What does graphical addition mean? Graphical addition of $f$ and $g$ means: at each $x$-value in the common domain, stack the $y$-value of $f$ on top of the $y$-value of $g$ to get the $y$-value of $f + g$. This can be done visually with a ruler.

Is $\sqrt{a} \cdot \sqrt{b}$ always equal to $\sqrt{ab}$? Only when both $a \geq 0$ and $b \geq 0$. If one is negative, $\sqrt{a}$ or $\sqrt{b}$ is not real, but $\sqrt{ab}$ might be (when both are negative, their product is positive). This is why the domains of $\sqrt{f} \cdot \sqrt{g}$ and $\sqrt{fg}$ can differ.