How do you compute the gradient of a function that involves a maximum? For example, I have the function: $$ f(\vec{t}) = v(1-\exp(-\lambda\cdot \max(t_0,t_1)))$$ With $v$ and $\lambda$ constant, for which values of $t$ is this funciton at a maximum.
I know I can use the chain rule to compute the partial derivatives, but I'm not sure how to deal with something like $\nabla_t \max(\vec{t}) $
If analytical solutions are difficult, is there a numerical way to approximate this?