<s>[INST] Can we split a function while doing differentiation? I have a silly question here. Assume a function $$f(x)= \frac{x}{(x-1)^2} \cdot (x+2)$$
Can I write
$$\frac{d}{dx} f(x) = \frac{d}{dx} x \cdot \frac{d}{dx} (x-1)^{-2} \cdot \frac{d}{dx} (x+2)^{-1}$$ 
If not, then why?
 [/INST] \begin{align}
f(x) &= \frac{x}{(x-1)^2} \cdot (x+2)\\
&= \frac{x^2+2x}{(x-1)^2}\\
&= \frac{x^2}{(x-1)^2} + \frac{2x}{(x-1)^2}\\
\end{align}
Now 
\begin{align}
f^\prime(x) &= \frac{x^2}{(x-1)^2}\,\frac{d}{dx} + \frac{2x}{(x-1)^2}\,\frac{d}{dx}\\
&= -\frac{2x}{(x-1)^3}\ - \frac{2(x+1)}{(x-1)^3}\\
&= -2\left(\frac{x}{(x-1)^3} + \frac{(x+1)}{(x-1)^3}\right)\\
\end{align}

$$f^\prime(x)= -2\frac{2x + 1}{(x-1)^3}$$

</s>