Partial derivatives and maximum/minimum