The First Derivative
The first derivative is the slop of the tangent line to the function at point x. It tells if the function is increasing or decreasing.
For example:
$f(x) = 3x^3 - 6x^2 + 2x -1$
$\frac{df}{dx} = 9x^2 - 12x + 2$
$x=0$, $\frac{df}{dx}(0) = 2$, so the function is increasing at x = 0.
$x = 1$, $\frac{df}{dx}(1) = 9 - 12 + 2 = -1$, so the function is decreasing at x = 1.
The Second Derivative
The second derivative is the derivative of the derivative of the function. It tells if the function’s derivative is increasing or decreasing.
positive —> the first derivative is increasing —> the slope of the tangent line to the function is increasing as x increase. (concave up)
negative —> the first derivative is decreasing —> the slope of the tangent line to the function is decreasing as x increases. (concave down)
same example:
$f''(x) = 18x -12$
$f''(0) = 0 -12 = -12$ —> negative —> concave down at x = 0.
$f''(1) = 18 -12 = 6$ —> positive —> concave up at x = 1
Critical Point
If derivative is 0 or doesn’t exist, x is the critical point.
The function might be increasing/decreasing/local maximum/local minimum if the 1st derivative is 0.
However, when x is a critical point, and the 2nd derivative is:
positive —> the slope is 0, the derivative of $f(x)$ is increasing at x, concave up —> local minimum
negative —> the slope is 0, the derivative of $f(x)$ is decreasing at x, concave down —> local maximum.
0 —> the graph is changing from concave up to down or down to up, but we don’t which one.
zero-crossing detect the edge in edge detection.