# Two ways to find the derivative, which is correct?

I was asked to do this problem $\displaystyle \frac{d}{dx} |3x-x^2|=\frac{d}{dx} y$

I used the fact that $\displaystyle \frac{d}{dx} |x|= \frac{|x|}{x}$ so,

$\displaystyle \frac{|3x-x^2|(3-2x)}{3x-x^2}= \frac{dy}{dx}$

but my study mate did this; he squared both sides to get rid of the absolute value.

$9x^2-6x^3+x^4=y^2$ then he takes the derivative implicitly.

$\displaystyle \frac{9x-9x^2+2x^3}{y}=\frac{dy}{dx}$

I have tried some values and these both work reasonably, but I cant understand if they are the same?

-
Your notation seems a bit off. Are you trying to simplify $y = \frac{d}{dx} |3x - x^2|$, or are you given $y = |3x - x^2|$ and are asked to find $\frac{dy}{dx}$? –  JavaMan May 23 '11 at 16:14

They are both the same. The easiest way to see this is to plug $y=|3x-x^2|$ into the second equation, factor the numerator into $(3x-x^2)(3-2x)$, and then use the fact that ${a\over|a|} = {|a|\over a}$ (both are equal to $sgn(a)$), with $a=3x-x^2$.
In short, they are both the same. You need only note that $|x|/x = x/|x|$.