<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] In fact we do not need a mix of quotient and product rule. Applying the product rule once is sufficient.

We obtain
  \begin{align*}
\frac{d}{dx}&\frac{(x-1)^2(x+2)^2}{(x+1)^2}\\
&=\frac{d}{dx}\left[\color{blue}{(x^2+x-2)^2}\color{red}{(x+1)^{-2}}\right]\\
&=\color{blue}{2(x^2+x-2)(2x+1)}\color{red}{(x+1)^{-2}}+\color{blue}{(x^2+x-2)^2}\color{red}{(-2)(x+1)^{-3}}\\
&=\frac{2(x^2+x-2)}{(x+1)^3}\left[(2x+1)(x+1)-(x^2+x-2)\right]\\
&=\frac{2(x^2+x-2)(x^2+2x+3)}{(x+1)^3}
\end{align*}

</s>