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}$$
 A: 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.
A: \begin{align*}\displaystyle \frac{\mathrm d}{\mathrm dx} \frac{(x-1)^2(x+2)^2}{(x+1)^2}&=\displaystyle \frac{\mathrm d}{\mathrm dx} \left(\frac{(x-1)(x+2)}{x+1}\right)^2\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \left( \frac{\mathrm d}{\mathrm dx} \frac{(x-1)(x+2)}{x+1} \right)\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \frac{\mathrm d}{\mathrm dx} \left( \frac{x^2+x-2}{x+1} \right)\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \frac{\mathrm d}{\mathrm dx} \left( \frac{(x+1)x-2}{x+1} \right)\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \frac{\mathrm d}{\mathrm dx} \left(x - \frac{2}{x+1} \right)\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \left(1 + \frac{2}{(x+1)^2} \right)\\
&=\displaystyle \frac{2(x-1)(x+2)}{x+1} \cdot \frac{x^2+2x+3}{(x+1)^2}\\
&=\displaystyle \frac{2(x-1)(x+2)(x^2+2x+3)}{(x+1)^3}.
\end{align*}
A: Use this way for a short-cut :
Let :
$$f(x) = \dfrac{(x-1)^2(x+2)^2}{(x+1)^2}$$
$$\ln {f(x)} = \ln (x-1)^2 +\ln(x+2)^2-\ln(x+1)^2 $$ 
$$\dfrac{f'(x)}{f(x)} = \frac{2(x-1)}{(x-1)^2}+\frac{2(x+2)}{(x+2)^2}-\frac{2(x+1)}{(x+1)^2} $$
$$f'(x) =  \dfrac{(x-1)^2(x+2)^2}{(x+1)^2} \Bigg(\frac{2}{(x-1)}+\frac{2}{(x+2)}-\frac{2}{(x+1)} \Bigg)$$
A: $$f(x):=\left(\dfrac{g(x)}{h(x)}\right)^n\implies{}f'(x)=n\ \dfrac{g(x)^{n-1}}{h(x)^{n+1}}\left(g'(x)\,h(x)-g(x)\,h'(x)\right)$$
In your case, $n=2$ as well as 
$g(x)=(x-1)\cdot(x+2)\ \ \ $ and $\ \ \ h(x)=x+1$, 
leading to derivatives $g'$ and $h'$ that are linear in $x$.
You'll be okay.
A: 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*}

