Ok so you have to use the first principle of derivates
After this step everything cancels out and the derivative is equal to zero....but I don't think it's suppose to be equal to zero
Hmmm... Not clear enough.
The rate of change of a horizontal line is zero. If you work through the definition (without errors) and get a result that is different from zero, something is very wrong with the world.
You would not be the first with an expectation that a solid definition corrected.
However, you have either propagated that mistake or do not know how to calculate f(x+h). With f(x)= 5, a constant, then f(x+ h)= 5.
Now you have me really confused! Your incorrect , not 0!After this step everything cancels out and the derivative is equal to zero....but I don't think it's suppose to be equal to zero
What you should have had does give 0.
However, I would consider the real "first principle" of the derivative to be "the derivative of a function, at a point, measures how fast that function is increasing at that point". A constant function is not changing at all- its "rate of change" and so it derivative, is 0.
Even more fundamental: the derivative of a linear function, f(x)= mx+ b, is its slope, m. Of course, a constant function, f(x)= b, has m= 0.