Why is Hestenes-Powell-Rockafellar penalty function differentiable?

28 Views Asked by At

They say the penalty function $f:\mathbb{R}^n\rightarrow \mathbb{R}$ given by $$f(x) = \frac{\rho}{2}\displaystyle \sum_{j=1}^n \left(\max\{0,\mu_j + \rho x_j\}\right)^2$$ is differentiable and even give a formula for the gradient $$ \nabla f(x) = -\displaystyle \sum_{j=1}^n \max\{0,\mu_j + \rho x_j\}e_j,$$ for the context you can consider $\mu=(\mu_j)$ and $ \rho>0$ as constants. I can kinda see how the derivative would become something like that if the function $\max\{0,\mu_j + \rho x_j\}$ was differentiable, but why is it? There is a maximum. Shoulnd't it be non-differentiable on the places where the scalar functions $0$ and $\mu_j + \rho x_j$ meet?