Are there some functions that cannot be optimized using calculus? I've been working on a project to maximize a functions output using a genetic algorithm. However, from the limited calculus I know I thought there were methods to find the maximum of a mathematical function using calculus? I'd assume the reason genetic algorithms are sometimes used to maximize functions is because there are functions where the mathematical methods don't work. If I'm correct, what are those conditions? I'd guess that maybe it's because the function is not continuous or differentiable?
 A: Calculus methods are useful for functions which are differentiable. For functions which are not differentiable calculus won't help much. For instance the data set could be discrete. Some examples of this include:


*

*A set of binary variables like a set of yes/no decisions. Which set of filters and parameters shall we use for this image to get best image quality?

*Which order to visit cities will minimize cost? Or which vehicles to transport which goods to minimize time and/or required resources?

*Which set of coins will minimize time to pay a beer in cash?

A: First off, the calculus techniques for determining the optimum value of a function are used, however analytic techniques sometimes fall short. Classic examples are if the function isn't continuous, but it's also possible you are optimizing against an extremely large function (logistic regression, where you are minimizing the function which has 1 coefficient per input, and say a few million inputs. Genetic algorithms are often applied in a similar place, where analytic techniques can't resolve an answer and iterative methods (such as newton's method, although that's not actually used), have to be applied.
