# Given f(x) = 4x + 5 and g(x) = 3x - 8 how do you find g(f(x))?

Aug 27, 2016

color(green)(f(g(x))=12x-27

#### Explanation:

Given
$\textcolor{w h i t e}{\text{XXX}} f \left(x\right) = 4 x + 5$
and
$\textcolor{w h i t e}{\text{XXX}} g \left(x\right) = 3 x - 8$

The problem here usually occurs because $x$ appears in both function definitions. But $x$ is just an arbitrary place holder; we can replace it with any other variable.

Let's replace $x$ in the definition of $f \left(x\right)$ with $w$ (another arbitrary variable). Then we have:
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{red}{w}\right) = 4 \textcolor{red}{w} + 5$

Now $\textcolor{red}{w}$ could be replaced with anything.
In particular we could replace it with $\textcolor{b l u e}{g \left(x\right)}$.

That is
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{b l u e}{g \left(x\right)}\right) = 4 \textcolor{b l u e}{g \left(x\right)} + 5$

But since $\textcolor{b l u e}{g \left(x\right)} = \textcolor{b l u e}{3 x - 8}$
we have
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{b l u e}{g \left(x\right)}\right) = 4 \textcolor{b l u e}{\left(3 x - 8\right)} + 5$

Simplifying
$\textcolor{w h i t e}{\text{XXX}} f \left(g \left(x\right)\right) = \left(12 x - 32\right) + 5$

$\textcolor{w h i t e}{\text{XXX}} f \left(g \left(x\right)\right) = 12 x - 27$