Why doesn't this property work on the following composite function? Given $f(x),g(x)$ find $(f \circ g)(x)$.
$$f(x) = x + \frac 1x \\g(x) = \frac{x+1}{x+2}\\(fog)(x) = \frac{x+1}{x+2}+\frac{1}{\frac{x+1}{x+2}} = \frac{x+1}{x+2}+\frac{x+2}{x+1}$$
Using the property $\frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}$ I now get: $$\frac{(x+1)^2+(x+2)^2}{(x+2)(x+1)} =(x+1)(x+2)$$
But that is incorrect. The correct answer is: $$\frac{2x^2+6x+5}{(x+2)(x+1)}$$ I understand how this was reached, but I'd like to know what was wrong with the application of that property? Thank you for your help.

The property works.
$$\frac{(x+1)^2+(x+2)^2}{(x+1)(x+2)}=\frac{x^2+2x+1+x^2+4x+4}{(x+1)(x+2)}=\frac{2x^2+6x+5}{(x+1)(x+2)}$$
I believe your careless mistake is $(x+1)^2+(x+2)^2 \neq (x+1)^2(x+2)^2$
