I recommend this as a starting place: https://www.mathsisfun.com/algebra/functions-maxima-minima.h...