The derivatives are not a method for integer variables.
But using the graph and a bit of brute force is easy to find the maxima and minima.
If the local extremum exists , then one of the ineger parts like floor(x) or ceil(x) will be the point of extremum for integers , if the integers are in the domain .
Also knowing whether the function is increasing or decreasing in interval we want .
I'm confused. First you agree that derivatives should not be used for integer optimization, but then you say it works. To address your claims specifically:
1. "The derivatives are not a method for integer variables."
I agree
2. "But using the graph and a bit of brute force is easy to find the maxima and minima."
I'm not sure how the graph helps here. The graph of what function? How is determining the graph easier than determining where max/min values are? I agree that for this problem the "correct" answer is to brute force search the integers in the domain.
3. "If the local extremum exists , then one of the ineger parts like floor(x) or ceil(x) will be the point of extremum for integers , if the integers are in the domain ."
This is false which was my entire point. I have provided a counterexample above. What is worse is that this isn't even "usually" true in practice. Hence the reason for point (1). You shouldn't use calculus to optimize over integers.
4. "Also knowing whether the function is increasing or decreasing in interval we want ."
Determining where a function is increasing/decreasing is no easier than optimizing it. In fact, they are equivalent at best since obviously if you know whether the function is increasing/decreasing at every point, then you must know where it attains max/min values. But typically this question is even harder. Moreover, you would still need to know where it takes integral values which is even harder than that.