Im finding local Min and max of x^2/x-2

I know I take the derivative of the first one but how do i derive this one. And the second one especially don't know how to do.

Use the quotient rule to differentiate (not derive):

if y = f/g
y' = (f'g - fg')/g^2

so, we have

y = x^2/(x-2)
y' = [(2x)(x-2) - x^2(1)]/(x-2)^2
= x(x-4)/(x-2)^2

Or, you can divide first
y = x+2 + 4/(x-2)
y' = 1 - 4/(x-2)^2

anyway, min/max is where y'=0, so x=0 or 4. (This is easiest to see looking at the first form of the solution.)

which is min, which is max?
y'' = 8/(x-2)^3
y''(0) = -1, so y is concave down (max)
y''(4) = +1, so y is concave up (min)