If I have a continuous function $f(x) = -(x-0.5)^2+5$, the maximum can be obtained if derive the function and set it to 0. So, $f'(x) = -2x+1 = 0$ and $x=0.5$ is the value where $f(x)$ reaches its maximum.
On the other hand, if I had the same function but discretized, so $f[x]$, would have the following values from $x=0$ to $x=5$ with an increment of 1:
$f[0] = 4.75 \\ f[1] = 4.75 \\ f[2] = 2.75 \\ f[3] = -1.25 \\ f[4] = -7.25 \\ f[5] = -15.75 \\$
Is there any way to get the $x$ that produces the maximum (in this case 0 or 1) using discrete derivatives (differences between two values) over the vector $[4.75,4.75,2.75,-1.75,-15.75]$?.
My solution using derivatives would be to first compute the derivative vector of the previous values which is $[0, -1, -3, -5 , -7, -8]$ and then find the value which is the closest to 0 (in this case that is the first one) and the index of that value would be the maximum. But, is that correct? and is there a more formal way to express this mathematically?
I ask this question because in the original paper of SIFT, the author finds the shift (a fraction) that a certain pixel needs to reach the true maximum. This is done by approximating the function using a Taylor expansion and then setting the that Taylor expansion to 0 to get the shift that pixel needs to reach the maximum (SIFT Taylor Expansion).