https://en.wikipedia.org/wiki/Maxima_and_minima
http://mathonline.wikidot.com/convex-and-concave-functions