<s>[INST] Strategy to calculate $ \frac{d}{dx} \left(\frac{x^2-6x-9}{2x^2(x+3)^2}\right) $. I am asked to calculate the following: $$ \frac{d}{dx} \left(\frac{x^2-6x-9}{2x^2(x+3)^2}\right). $$
I simplify this a little bit, by moving the constant multiplicator out of the derivative:
$$ \left(\frac{1}{2}\right) \frac{d}{dx} \left(\frac{x^2-6x-9}{x^2(x+3)^2}\right) $$
But, using the quotient-rule, the resulting expressions really get unwieldy:
$$ \frac{1}{2} \frac{(2x-6)(x^2(x+3)^2) -(x^2-6x-9)(2x(2x^2+9x+9))}{(x^2(x+3)^2)^2} $$
I came up with two approaches (3 maybe):


*

*Split the terms up like this: $$ \frac{1}{2}\left( \frac{(2x-6)(x^2(x+3)^2)}{(x^2(x+3)^2)^2} - \frac{(x^2-6x-9)(2x(2x^2+9x+9))}{(x^2(x+3)^2)^2} \right) $$
so that I can simplify the left term to $$ \frac{2x-6}{x^2(x+3)^2}. $$
Taking this approach the right term still doesn't simplify nicely, and I struggle to combine the two terms into one fraction at the end.

*The brute-force-method. Just expand all the expressions in numerator and denominator, and add/subtract monomials of the same order. This definitely works, but i feel like a stupid robot doing this.

*The unofficial third-method. Grab a calculator, or computer-algebra-program and let it do the hard work.
Is there any strategy apart from my mentioned ones? Am I missing something in my first approach which would make the process go more smoothly?
I am looking for general tips to tackle polynomial fractions such as this one, not a plain answer to this specific problem.
 [/INST] Logarithmic differentiation can also be used to avoid long quotient rules. Take the natural logarithm of both sides of the equation then differentiate:
$$\frac{y'}{y}=2\left(\frac{1}{x-3}-\frac{1}{x}-\frac{1}{x+3}\right)$$
$$\frac{y'}{y}=-\frac{2\left(x^2-6x-9\right)}{x(x+3)(x-3)}$$
Then multiply both sides by $y$:
$$y'=-\frac{{\left(x-3\right)}^3}{x^3{\left(x+3\right)}^3}$$
</s>