# How do you find (fog)(n) given f(n)=2n and g(n)=-n-4?

Oct 4, 2016

$\left(f o g\right) \left(n\right) = - 2 n - 8$

#### Explanation:

It is sometimes easier to thing of $\left(f o g\right) \left(n\right)$ as $f \left(g \left(n\right)\right)$

It might also help to replace $n$ in the definition of $f \left(n\right)$ with some other variable; since $n$ is just a variable placeholder there is no problem doing this.

So $f \left(n\right) = 2 n$ could equally validly written as
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{red}{k}\right) = 2 \textcolor{red}{k}$

Now, if we want to evaluate $f \left(\textcolor{b l u e}{g \left(n\right)}\right)$
we simply replace $\textcolor{red}{k}$ with $\textcolor{b l u e}{g \left(n\right)}$

$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{b l u e}{g \left(n\right)}\right) = 2 \textcolor{b l u e}{g \left(n\right)}$

and since $\textcolor{b l u e}{g \left(n\right)} \textcolor{b l a c k}{=} - n - 4$
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{b l u e}{g \left(n\right)}\right) = 2 \left(\textcolor{b l u e}{- n - 4}\right) = - 2 n - 8$