## Combine functions using algebraic operations

Function composition is only one way to combine existing functions. Another way is to carry out the usual algebraic operations on functions, such as addition, subtraction, multiplication and division. We do this by performing the operations with the function outputs, defining the result as the output of our new function.

Suppose we need to add two columns of numbers that represent a husband and wife’s separate annual incomes over a period of years, with the result being their total household income. We want to do this for every year, adding only that year’s incomes and then collecting all the data in a new column. If $w\left(y\right)$ is the wife’s income and $h\left(y\right)$ is the husband’s income in year $y$, and we want $T$ to represent the total income, then we can define a new function.

$T\left(y\right)=h\left(y\right)+w\left(y\right)$

If this holds true for every year, then we can focus on the relation between the functions without reference to a year and write

$T=h+w$

Just as for this sum of two functions, we can define difference, product, and ratio functions for any pair of functions that have the same kinds of inputs (not necessarily numbers) and also the same kinds of outputs (which do have to be numbers so that the usual operations of algebra can apply to them, and which also must have the same units or no units when we add and subtract). In this way, we can think of adding, subtracting, multiplying, and dividing functions.

For two functions $f\left(x\right)$ and $g\left(x\right)$ with real number outputs, we define new functions $f+g,f-g,fg$, and $\frac{f}{g}$ by the relations

$\begin{cases}\left(f+g\right)\left(x\right)=f\left(x\right)+g\left(x\right)\hfill \\ \left(f-g\right)\left(x\right)=f\left(x\right)-g\left(x\right)\hfill \\ \text{ }\left(fg\right)\left(x\right)=f\left(x\right)g\left(x\right)\hfill \\ \text{ }\left(\frac{f}{g}\right)\left(x\right)=\frac{f\left(x\right)}{g\left(x\right)}\hfill \end{cases}$

### Example 1: Performing Algebraic Operations on Functions

Find and simplify the functions $\left(g-f\right)\left(x\right)$ and $\left(\frac{g}{f}\right)\left(x\right)$, given $f\left(x\right)=x - 1$ and $g\left(x\right)={x}^{2}-1$. Are they the same function?

### Solution

Begin by writing the general form, and then substitute the given functions.

$\begin{cases}\left(g-f\right)\left(x\right)=g\left(x\right)-f\left(x\right) \\ \left(g-f\right)\left(x\right)={x}^{2}-1-\left(x - 1\right)\\ \text{ }={x}^{2}-x \\ \text{ }=x\left(x - 1\right) \\\end{cases}\\$ $\begin{cases}\text{ }\left(\frac{g}{f}\right)\left(x\right)=\frac{g\left(x\right)}{f\left(x\right)} \\ \text{ }\left(\frac{g}{f}\right)\left(x\right)=\frac{{x}^{2}-1}{x - 1}\\ \text{ }=\frac{\left(x+1\right)\left(x - 1\right)}{x - 1}\text{ where }x\ne 1 \\ \text{ }=x+1 \end{cases}$

No, the functions are not the same.

Note: For $\left(\frac{g}{f}\right)\left(x\right)\\$, the condition $x\ne 1$ is necessary because when $x=1$, the denominator is equal to 0, which makes the function undefined.

### Try It 1

Find and simplify the functions $\left(fg\right)\left(x\right)$ and $\left(f-g\right)\left(x\right)$.

$f\left(x\right)=x - 1\text{ and }g\left(x\right)={x}^{2}-1$

Are they the same function?

Solution