Suppose I have utility function like this: $u(x_1,x_2,x_3)=min\{x_1,a-x_1\}\times min\{x_2,b-x_2\}+x_3$ where a and b are real numbers and $x_1\in [0, a]$ and $x_2\in [0,b]$. What will be a procedure of finding, for example, Marshallian demand $x(p,w)$?
My confusion: In case of more simple function without minimum or maximum structures I would simply use Lagrangian to define the demand. However, given function is not differentiable.
My question: can I apply Lagrangian here and, if so, how can I do it? If it is impossible to use Lagrangian in this case, what else sholud I do?