Maxima minima of not everywhere continuous functions

continuityderivativesmaxima-minimamultivariable-calculus

I'm starting to study Multivariable Calculus. I was learning about maxima and minima of a function. I know that we can use the method of equating the gradient to be $0$ and then finding the critical points and plugging in the values in are original function. My question is– what if my function $f(x,y)$ is such, that it has, say, a point $a$ where the function is indeterminate. When I find my gradient and equate it to $0$, then I get a few points to be my critical points, one of which is also $a$, the point where the function is indeterminate. At $a$, my function does not satisfy the assumption of being continuous or differentiable. Does this mean I can just drop it and assume that my other points are my maxima or minima? Can I even apply this method to begin with, if my function is not continuous and differentiable only at finitely many points? And what about if my function is not along a line?

Best Answer

Nope. You can't 'just drop it' because you might drop a valid solution.

The absolute value function $x\mapsto|x|$ is continuous but not differentiable at $x=0$, anyway it has a minimum there.

A modified step function $x\mapsto\begin{cases}0&x<0\\1&x\ge 0\end{cases}$ is semi-differentiable but not continuous at $x=0$, anyway it has a maximum there.

Similarly, a single-point characteristic function $x\mapsto\begin{cases}1&x=0\\0&\text{otherwise}\end{cases}$ is neither differentiable nor continuous at $x=0$ but it has a maximum there.