Did I Solve This Composite Function Correctly or Not? Find the composition $(g\circ f)(x)$
$$f(x)= x + \frac{1}{x}\;\; ;\;\; g(x)= \frac{x+1}{x+2}$$
The function $f$ is applied first, and the function $g$ is applied second.
When I initially set up the entire expression, I multiplied the top and bottom by $x$. Is that wrong? Although I got the answer right. I just saw someone solve the composite $(g\circ f)(x)$ differently. Using the fraction $x/x$. Is that the correct way? I thought all one needed to do with fractions within fractions is to rid them of their denominators? 
 A: $$g(f(x)=\frac{f(x)+1}{f(x)+2}=\frac{x+\frac{1}{x}+1}{x+\frac{1}{x}+2}$$
A: $(g\circ f)(x)$, or $g(f(x))$ (which is the way I like to write it) basically means, "There are two functions, $f(x)$ and $g(x)$. In the function $g(x)$, $f(x)$ is the input." So you should input whatever $f(x)$ is into $g(x)$ to find out what $g(f(x))$ equals. Think of it like this: 
$$\large{\color{green}{f(x)=\text{something}}}$$
$$\large{\color{blue}{g(}\color{orange}{\underbrace{\color{green}{f(x)}}_{\text{input}}}\color{blue})=\color{blue}{g(}{\color{green}{\text{something}\color{blue} )}}}$$
Now, $f(x)=x+\frac 1x$, and $g(x)=\frac{x+1}{x+2}$. The input to $g(x)$ is $x+\frac 1x$, so:
$$g(f(x))=g\left(x+\frac 1x\right)=\frac{x+\frac 1x+1}{x+\frac 1x+2}$$
Although you may be tempted to multiply by $\frac xx$ (i.e. multiply both numerator and denominator by $x$) to get rid of the $\frac 1x$ in the answer, the end result will make the function defined for $x=0$, which is not true. If you do decide to simplify it, you will get $g(f(x))=\frac{x^2+x+1}{x^2+2x+1}$.
$g(f(x))=\frac{x+\frac 1x+1}{x+\frac 1x+2}$ and $g(f(x))=\frac{x^2+x+1}{x^2+2x+1}$ are different functions! Their graphs are not the same; their domains and ranges are not the same. The former function is not defined for $x=0$, while the latter function is! On the other hand, the latter function is not defined for $x=-1$, but the former is!
I hope this helped you.
