Discontinuous and optimal control