How do I differentiate these functions? I was told I am suppose to multiply the exponent by the variable, then subtract one from the exponent, is this correct? Even if it is correct I am not sure what I am doing wrong.

y = 3x + 2 The answer I got was 5

y = x^2 - 2 Answer I got is 2x - 2

y = x^3 - 2x Answer I got is 3x^2 - 2

Can anyone give me helpful hints as to what I am doing wrong?