By Math Original No comments
##### Combining Functions

Combining Functions means performing basic arithmetic operations like addition, subtraction, multiplication and division with functions.

Given two functions $\displaystyle f(x)$ and $\displaystyle g(x)$ we define:

1. The sum of two functions

$\displaystyle (f+g)(x)=f(x)+g(x)$

2. The difference of two functions

$\displaystyle (f-g)(x)=f(x)-g(x)$

3. The product of two functions

$\displaystyle (f\times g)(x)=f(x)\times g(x)$

4. The quotient of two functions

$\displaystyle \left( {\frac{f}{g}} \right)(x)=\frac{{f(x)}}{{g(x)}}$

When we combine two functions we create a new function

For example: We have $\displaystyle f(x)=2x+3$ and $\displaystyle g(x)=x+1$

If we add this two functions we make a new one $\displaystyle h(x)$,where

$\displaystyle h(x)=f(x)+g(x)$

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

$\displaystyle h(x)=3x+4$

Remember! What does it mean to evaluate a function?

To evaluate a function is to replace its variable with a given number or expression.

Example 1: Evaluate the function f(x)=x+2 for x=3

We just need to replace the variable x with 3.

f(3)=3+2=5

So f(3)=5

Example 2: If $\displaystyle f(x)=2x+1$ and $\displaystyle g(x)={{x}^{2}}+2$ evaluate $\displaystyle (f+g)(2)$?

Method 1Firstly we find the new function:

$\displaystyle h(x)=f(x)+g(x)$

$\displaystyle h(x)=(2x+1)+({{x}^{2}}+2)$

$\displaystyle h(x)={{x}^{2}}+2x+3$

Then we substitute the value 2 at our new function

$\displaystyle \text{h}(2)={{(2)}^{2}}+2\cdot 2+3$

$\displaystyle h(2)=4+4+3=11$

Method 2:
Since $\displaystyle (f+g)(x)=f(x)+g(x)$, then $\displaystyle (f+g)(2)=f(2)+g(2)$

All we have to do is evaluate each function separately and add the result.
$\displaystyle f(x)=2x+1$
$\displaystyle f(2)=2\cdot 2+1=5$

$\displaystyle g(x)={{x}^{2}}+2$
$\displaystyle \text{g}(2)={{(2)}^{2}}+2$
$\displaystyle \text{g}(2)=4+2=6$
$\displaystyle (f+g)(2)=f(2)+g(2)$
$\displaystyle (f+g)(2)=5+6$
$\displaystyle (f+g)(2)=11$

Be careful!

Sometimes you will find those combinations of functions without the notion (x). Don´t get confused because it’s the same thing.

Example 3: If $\displaystyle f(x)={{x}^{2}}-4$ and $\displaystyle g(x)=x+2$ then find:

a) $\displaystyle \left( {f+g} \right)\left( x \right)$

$\displaystyle (f+g)(x)=f(x)+g(x)$

$\displaystyle ={{x}^{2}}-4+x+2$

$\displaystyle (f+g)(x)={{x}^{2}}+x-2$

b) $\displaystyle \left( {f-g} \right)\left( x \right)$

$\displaystyle (f-g)(x)=f(x)-g(x)$

$\displaystyle (f-g)(x)=({{x}^{2}}-4)-(x+2)$

$\displaystyle (f-g)(x)={{x}^{2}}-4-x-2$

$\displaystyle (f-g)(x)={{x}^{2}}-x-6$

c) $\displaystyle f\cdot g\left( x \right)$

$\displaystyle =({{x}^{2}}-4)\cdot (x+2)$

$\displaystyle (f\cdot g)(x)=({{x}^{2}}-4)\cdot (x+2)$

$\displaystyle =({{x}^{2}})\cdot x+2\cdot {{x}^{2}}-4\cdot x-4\cdot 2$

$\displaystyle ={{x}^{3}}+2{{x}^{2}}-4x-8$

d) $\displaystyle \frac{f}{g}\left( x \right)$

$\displaystyle \left( {\frac{f}{g}} \right)(x)=\frac{{f(x)}}{{g(x)}}$

$\displaystyle \left( {\frac{f}{g}} \right)(x)=\frac{{{{x}^{2}}-4}}{{x+2}}$

$\displaystyle \left( {\frac{f}{g}} \right)(x)=\frac{{(x-2)(x+2)}}{{x+2}}$

$\displaystyle \left( {\frac{f}{g}} \right)(x)=x-2$

Note! When we find the quotient of two functions we should be careful because of its domain.The quotient f/g is not defined at values of x where g is equal to 0.

In our example above the domain of f/g is the set of all real numbers expect -2, because the denominator of the fraction can’t be 0. We write x+2≠0 and x≠-2 because g(-2)=0.
We usually write the domain of a set: $\displaystyle D=\left\{ {x\in R/x\ne -2} \right\}$

Example 4: If $\displaystyle f(x)=2{{x}^{3}}+2x$ and $\displaystyle g(x)=4{{x}^{2}}$ then evaluate:

a) $\displaystyle (f+g)(0)$

$\displaystyle (f+g)(0)=f(0)+g(0)$

$\displaystyle =\left[ 2 \right.\cdot {{(0)}^{3}}+2\cdot \left. {(0)} \right]+\left[ {4\cdot {{{(0)}}^{2}}} \right]$

= 0 + 0 = 0

b) $\displaystyle (f-g)(1)$

$\displaystyle (f-g)(1)=f(1)-g(1)$

$\displaystyle =\left[ 2 \right.\cdot {{(1)}^{3}}+2\cdot \left. {(1)} \right]-\left[ {4\cdot {{{(1)}}^{2}}} \right]$

$\displaystyle =(2+2)-4$

$\displaystyle =4-4=0$

c) $\displaystyle (f\cdot g)(-1)$

$\displaystyle (f\cdot g)(-1)=f(-1)\cdot g(-1)$

$\displaystyle =\left[ {{{{(-1)}}^{2}}-4} \right]\left[ {(-1)+2} \right]$$\displaystyle (f\cdot g)(-1)=(-3)\cdot 1$

$\displaystyle (f\cdot g)(-1)=(-3)\cdot 1$

d) $\displaystyle \left( {\frac{f}{g}} \right)(2)$

$\displaystyle \left( {\frac{f}{g}} \right)(2)=\frac{{f(2)}}{{g(2)}}$

$\displaystyle g(x)=4{{x}^{2}}$

$\displaystyle \left( {\frac{f}{g}} \right)(2)=\frac{{(2\cdot 8)+4}}{{4\cdot 4}}$

$\displaystyle \left( {\frac{f}{g}} \right)(2)=\frac{{16+4}}{{16}}$

$\displaystyle \left( {\frac{f}{g}} \right)(2)=\frac{{20}}{{16}}=\frac{5}{4}$

*We should specify the domain which is not all real numbers in this case:* $\displaystyle D=\left\{ {x\in R/x\ne 0} \right\}$.

There is a new method to combine functions and is called “Function Composition”.

Given two functions $\displaystyle f(x)$ and $\displaystyle g(x)$ we define:
The composition of $\displaystyle f(x)$ and $\displaystyle g(x)$ is $\displaystyle (f\circ g)(x)=f\left[ {g(x)} \right]$
The composition of  $\displaystyle g(x)$ and $\displaystyle f(x)$ is:$\displaystyle (g\circ f)(x)=g\left[ {f(x)} \right]$

Note!
1. The symbol is not the symbol of multiplication. $\displaystyle (f\circ g)(x)\ne (f\cdot g)(x)$

2. It does not satisfy the commutative axiom so the order is very important. $\displaystyle (f\circ g)(x)\ne (g\circ f)(x)$ but there are some cases when $\displaystyle (f\circ g)(x)=(g\circ f)(x)$

For example: If $\displaystyle f(x)={{x}^{2}}$ and $\displaystyle g(x)=x$ then: $\displaystyle (f\circ g)(x)=f\left[ {g(x)} \right]=f\left[ x \right]={{x}^{2}}$

$\displaystyle (g\circ f)(x)=g\left[ {f(x)} \right]=g\left[ {{{x}^{2}}} \right]=x$

Then $\displaystyle (g\circ f)(x)=(f\circ g)(x)={{x}^{2}}$

Example 5: If $\displaystyle f(x)=3{{x}^{2}}+x+7$ and $\displaystyle g(x)=5x+2$ find:

a) $\displaystyle (f\circ g)(x)$

We know that  $\displaystyle (f\circ f)(x)=f\left[ {g(x)} \right]$So all we have to do is put the second function into the first function

$\displaystyle (f\circ g)(x)\ne (f\cdot g)(x)$

$\displaystyle =f\left[ {5x+2} \right]$

$\displaystyle =3{{(5x+2)}^{2}}+x+7$

$\displaystyle =3(25{{x}^{2}}+20x+4)+x+7$

$\displaystyle =75{{x}^{2}}+60x+12+x+7$

$\displaystyle =75{{x}^{2}}+61x+19$

b) $\displaystyle (g\circ f)(x)$

We know that $\displaystyle (g\circ f)(x)=g\left[ {f(x)} \right]$

So all we have to do is put the first function into the second function

$\displaystyle (g\circ f)(x)=g\left[ {f(x)} \right]$

$\displaystyle =g\left[ {3{{x}^{2}}+x+7} \right]$

$\displaystyle =5(3{{x}^{2}}+x+7)+2$

$\displaystyle =15{{x}^{2}}+5x+35+2$

$\displaystyle =15{{x}^{2}}+5x+37$

c) $\displaystyle (g\circ g)(x)$

When the two functions are the same we still proceed in the same way.
$\displaystyle (g\circ g)(x)=g\left[ {g(x)} \right]$

$\displaystyle =g\left[ {5x+2} \right]$

$\displaystyle =5(5x+2)+2$

$\displaystyle =25x+10+2$

$\displaystyle =25x+12$

Example 6: If $\displaystyle f(x)=\frac{{x+1}}{2}$ and $\displaystyle g(x)=2x$ find:

a) $\displaystyle (f\circ g)(-1)$

$\displaystyle (f\circ g)(-1)=f\left[ {g(-1)} \right]$

$\displaystyle (f\circ g)(-1)=f\left[ {2(-1)} \right]$

$\displaystyle (f\circ g)(-1)=f\left[ {-2} \right]$

$\displaystyle (f\circ g)(-1)=\frac{{-2+1}}{2}$

$\displaystyle (f\circ g)(-1)=-\frac{1}{2}$

b) $\displaystyle (g\circ f)(1)$

$\displaystyle (g\circ f)(1)=g\left[ {f(1)} \right]$

$\displaystyle (g\circ f)(1)=g\left[ {\frac{{1+1}}{2}} \right]$

$\displaystyle (g\circ f)(1)=g\left[ 1 \right]$

$\displaystyle (g\circ f)(1)=2\cdot 1=2$