<s>[INST] Help differentiating $\frac{(x-1)^2(x+2)^2}{(x+1)^2}$ I need help differentiating this expression below. I know you can use a mix of the product rule and quotient rule, but that is tedious and long. Is there a shorter method?
$$\dfrac{(x-1)^2(x+2)^2}{(x+1)^2}$$
 [/INST] Another approach:
Let $$y=\frac{(x-1)^2(x+2)^2}{(x+1)^2}$$
Then,
\begin{align*}
\ln y&=2\ln (x-1)+2\ln(x+2)-2\ln(x+1)\\
\qquad \frac{y'}{y}&=\frac2{x-1}+\frac2{x+2}-\frac2{x+1}\\
\qquad y'&=\left(\frac2{x-1}+\frac2{x+2}-\frac2{x+1}\right)\frac{(x-1)^2(x+2)^2}{(x+1)^2}\\
\end{align*}
Although we have suppose that $x-1,\;x+2$ and $x+1$ are positive the obtained derivative holds whenever $x\neq \pm1,-2.$

Generally speaking, whenever you want to differentiate some sort of fraction with degrees $>1$, it is usually best to take the $\ln$ of both sides, and then this will clean up your original function a lot.
</s>