# If f(x) = 1/(x+1) and g(x) = 2/(2x-1) how do you find g(f(x)) and its domain and range?

Sep 20, 2015

$f \left(g \left(x\right)\right) = \frac{2 x - 1}{2 x + 1}$
with Domain of $\mathbb{R} - \left\{- \frac{1}{2}\right\}$ and Range of $\mathbb{R} - \left\{1\right\}$

#### Explanation:

It might help if we replace the variable $x$ in $f \left(x\right)$ with a different variable than the one used in $g \left(x\right)$. (We can do this because $x$ is just an arbitrary place holder). Suppose for example we write:
$\textcolor{w h i t e}{\text{XXX}} f \left(\textcolor{red}{w}\right) = \frac{1}{\textcolor{red}{w} + 1}$

Then it might be easier to see how we can replace
$\textcolor{w h i t e}{\text{XXX")color(red)(w)color(white)("XXX}}$ with $\textcolor{w h i t e}{\text{XXX}} \textcolor{b l u e}{g \left(x\right)}$

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

$\textcolor{w h i t e}{\text{XXXXXXX}} = \frac{1}{\textcolor{b l u e}{\frac{2}{2 x - 1}} + 1}$

$\textcolor{w h i t e}{\text{XXXXXXX}} = \frac{1}{\frac{2 + 2 x - 1}{2 x - 1}}$

$\textcolor{w h i t e}{\text{XXXXXXX}} = \frac{2 x - 1}{2 x + 1}$

The $f \left(g \left(x\right)\right)$is defined for all Real values of $x$ for which
$\textcolor{w h i t e}{\text{XXX}} 2 x + 1 \ne 0$
$\textcolor{w h i t e}{\text{XXX}} x \ne - \frac{1}{2}$
That is, the Domain of $f \left(g \left(x\right)\right)$ is $\mathbb{R} - \left\{- \frac{1}{2}\right\}$
$\textcolor{w h i t e}{\text{XXX}}$(or, if you prefer) $\left(- \infty , - \frac{1}{2}\right) \cup \left(- \frac{1}{2} , + \infty\right)$

One way to determine the range is to ask: "Is there any value, $c$ for which $\frac{2 x - 1}{2 x + 1} = c$ is impossible?"

$\textcolor{w h i t e}{\text{XXX}} 2 x - 1 = c \left(2 x + 1\right)$

$\textcolor{w h i t e}{\text{XXX}} 2 x - 2 c x = c + 1$

$\textcolor{w h i t e}{\text{XXX}} x = \frac{c + 1}{2 \left(c - 1\right)}$

This equation is clearly undefined if $c = 1$
Therefore the Range of $f \left(g \left(x\right)\right)$ is
$\textcolor{w h i t e}{\text{XXX}} \mathbb{R} - \left\{1\right\}$
$\textcolor{w h i t e}{\text{XXX XX}}$ (...or, $\left(- \infty , 1\right) \cup \left(1 , + \infty\right)$)

This can also be seen from the graph of $\frac{2 x + 1}{2 x - 1}$
graph{(2x-1)/(2x+1) [-5.546, 5.55, -2.773, 2.774]}