<s>[INST] Derivative of a rational function I've found the following derivative in my Calculus book and I can't get my my head around the algebra involved. Can anybody help me?

Thanks.
 [/INST] \begin{align*}
\frac{d}{dx}\left(-\frac{x^2+1}{(x^2-1)^2}\right) &= -\frac{d}{dx}\left(\frac{x^2+1}{(x^2-1)^2} \right)&\quad&\mbox{(1)}\\
&= -\left(\frac{(x^2-1)^2(x^2+1)' - (x^2+1)\left((x^2-1)^2\right)'}{\left((x^2-1)^2\right)^2}\right)&&\mbox{(2)}\\
&= - \frac{(x^2-1)^2(2x) - (x^2+1)\left(2(x^2-1)(x^2-1)'\right)}{(x^2-1)^4}&&\mbox{(3)}\\
&= -\frac{2x(x^2-1)^2 - (x^2+1)(2(x^2-1)2x)}{(x^2-1)^4}&&\mbox{(4)}\\
&= -\frac{2x(x^2-1)^2 - 4x(x^2+1)(x^2-1)}{(x^2-1)^4}&&\mbox{(5)}\\
&= - \frac{2x(x^2-1)\left((x^2-1) - 2(x^2+1)\right)}{(x^2-1)^4}&&\mbox{(6)}\\
&= - \frac{2x(x^2-1)\left(x^2-1-2x^2-2\right)}{(x^2-1)^4}&&\mbox{(7)}\\
&= - \frac{2x(x^2-1)(-x^2-3)}{(x^2-1)^4}&&\mbox{(8)}\\
&= - \frac{2x(-x^2-3)}{(x^2-1)^3}&&\mbox{(9)}\\
&= -\frac{-2x(x^2+3)}{(x^2-1)^3}&&\mbox{(10)}\\
&= -(-2)\frac{x(x^2+3)}{(x^2-1)^3}&&\mbox{(11)}\\
&= 2\frac{x(x^2+3)}{(x^2-1)^3}.&&\mbox{(12)}
\end{align*}
Notes.


*

*Pull out the minus sign fromt he derivative.

*Use the Quotient Rule.

*Do the derivatives in the numerator, using the Chain Rule for $(x^2-1)^2$.

*Finish the derivative.

*Do some of the algebra in the numerator. Notice that both summands in the numerator have a factor of $2x(x^2-1)$.

*Factor out $2x(x^2-1)$ from both summands in the numerator.

*Do the operations in the other factor.

*Do the algebra in the numerator.

*Cancel the $x^2-1$ in the numerator with one in the denominator.

*Pull out the minus sign from $(-x^2-3)$.

*Pull out the $-2$ from the fraction.

*Simplify $-(-2)$ to $2$, and rejoice for your answer matches the one in the book.

</s>