# Given if f(x)=x^2-4 and g(x)=sqrt(x-3) how do you find f(g(x)) and g(f(x))?

Dec 5, 2016

The answers are $f \left(g \left(x\right)\right) = x - 7$
and $g \left(f \left(x\right)\right) = \sqrt{{x}^{2} - 7}$

#### Explanation:

This is a composition of functions.

$f \left(x\right) = {x}^{2} - 4$

$g \left(x\right) = \sqrt{x - 3}$

$f o g \left(x\right) = f \left(g \left(x\right)\right) = f \left(\sqrt{x - 3}\right) = {\left(\sqrt{x - 3}\right)}^{2} - 4$

$= x - 3 - 4 = x - 7$

And

$g o f \left(x\right) = g \left(f \left(x\right)\right) = g \left({x}^{2} - 4\right) = \sqrt{\left({x}^{2} - 4\right) - 3}$

$= \sqrt{{x}^{2} - 4 - 3} = \sqrt{{x}^{2} - 7}$

You can see that

$f \left(g \left(x\right)\right) \ne$g(f(x))

Dec 5, 2016

$f \left(g \left(x\right)\right) = x - 7$

$g \left(f \left(x\right)\right) = \sqrt{{x}^{2} - 7}$

#### Explanation:

Put $g$ inside $f$ to find $f \left(g \left(x\right)\right)$

$f \left(x\right) = {\textcolor{red}{x}}^{2} - 4$

$g \left(x\right) = \textcolor{red}{\sqrt{x - 3}}$

$f \left(g \left(x\right)\right) = {\left(\textcolor{red}{\sqrt{x - 3}}\right)}^{2} - 4$

$\textcolor{w h i t e}{f \left(g \left(x\right)\right)} = x - 3 - 4$

$\textcolor{w h i t e}{f \left(g \left(x\right)\right)} = x - 7$

Put $f$ inside $g$ to find $g \left(f \left(x\right)\right)$

$g \left(x\right) = \sqrt{\textcolor{red}{x} - 3}$

$f \left(x\right) = \textcolor{red}{{x}^{2} - 4}$

$g \left(f \left(x\right)\right) = \sqrt{\textcolor{red}{{x}^{2} - 4} - 3}$

$\textcolor{w h i t e}{g \left(f \left(x\right)\right)} = \sqrt{{x}^{2} - 7}$