# Gradient for the max function

• Oct 8th 2009, 01:10 AM
noschemer
Gradient for the max function
Suppose $f(\vec{x})=\max_ix_i$. What is the gradient $\bigtriangledown f(\vec{x})=?$

Any help appreciated.
• Oct 8th 2009, 05:15 AM
HallsofIvy
I don't believe that is a differentiable function.
• Oct 8th 2009, 11:48 PM
noschemer
THanks for ur reply. Can u provide a brief explanation for the non-differentiability of this function?? My major is electrical engineering, and background in analysis is not good.
• Oct 9th 2009, 07:21 AM
HallsofIvy
If you were to graph max(x,y) on, say $-1\le x\le 1$, $-1\le y\le 1$ you would see sharp corners along the lines y= x and y= -x. Generally speaking, only "smooth" functions have derivatives.