I understand the formula to find derivatives, but for some reason I can't seem to get the right answer when applying said formula most of the time. Here's an example, maybe someone could walk me through step by step?

3x^2-x^3

Now I used an online derivative calculator and got the answer, but I still can't even come to that answer when I try to apply the lim (h--0) f(x+h)-f(x) over H formula. I keep getting -3x^2+2x and the correct answer is 6x-3x^2