Concave and Convex functions
Concave functions are those that, for any two points on the curve, the points of the line connecting those two points will always be below (less in the y direction) than the corresponding points of the curve.
Convex functions are those that, for any two points on the curve, the points of the line connecting those two points will always be above (greater in the y direction) than the corresponding points of the curve.
In these two cases, we are talking about a secant line. From Wikipedia;
In geometry, a secant line of a curve is a line that (locally) intersects two points on the curve. A chord is an interval of a secant line, the portion of the line that lies within the curve.
So we are saying, for a concave curve, the chord is always below the curve and for a convex curve, the chord is always above the curve.
Here is an example of a concave curve from Wikipedia;
This shows one possible secant line on the concave curve.
Here is an example of a convex curve from Wikipedia;
The pink line is one possible secant line for this convex curve.
Some functions are neither concave nor convex. The line connecting two points on the curve may actually cross the function (so it intersects at more than two places and so is not a chord), indicating that section of the curve is both concave and convex. Or it may be a line, which has no curvature.
Curvature & Instantaneous Rate of Change
The first derivative is the instantaneous rate of change at a point on the curve. It is the slope of the line that is tangent to the curve at that point. From Wikipedia;
In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve.
NOTE: We use two points on the curve to create a secant line. If we begin choosing points that are closer together, as the points get closer and closer together, the distance between them approaches zero (they become infinitely close), and we approach the single point which is the tangent line. That is the geometric interpretation of the first derivative for the curve at a given point.
In the case of convex and concave functions, at the place where the curve changes slope, there is point where the instantaneous rate of change of the slope is zero. That is, there is a place where the tangent line is exactly horizontal. That place, where the first derivative is zero, is the maximum in the case of concave curves or the minimum in the case of convex functions.
Also worth noting, any place on a curve where the slope changes ‘sign’, either going from positive slope to negative slope or visa versa, is called an inflection point. So the maximum of a concave curve is an inflection point. To the ‘left’, where x values are less, it has positive slope. On the ‘right’ side of the maximum, where x values are greater, it has negative slope. At the maximum, the inflection point has zero slope.
NOTE: here is a cool animation from Wikipedia that shows how the tangent changes as we move along a ‘curvy’ curve that has many local maxima and minima. You can see that the top of local maximum the slope of the tangent is zero (the tangent is exactly horizontal) and the same at the bottom of local minima. This also hints at potential problems with the hill-climbing algorithm – with non-concave functions, we may only find a local maximum.