# Optimization with disjoint regions

I will try to describe the challenge I’m having as follows:
Say I’m finding the value of \textbf{x} that minimizes a function tr(\textbf{A.X}) with \textbf{X=xx^{T}}. Suppose \textbf{x} can lie in disjoint regions such that $\textbf{x_1\leq x\leq x_2} and \textbf{x_3\leq x\leq x_4}; \textbf{x_3>x_2}. CVX does not seem to look for solutions in the second region: \textbf{x_3\leq x\leq x_4}$. How can this be corrected?

The specified constraint region is not convex, since for instance, 0.5x2+0.5x3, which is a convex combination of feasible points x2 and x3, is not feasible.

Perhaps a mixed integer formulation would be possible in CVX? The formulation is left as an exercise to the reader.

Is A positive semidefinite? If not, then there is no convex formulation here, or even a mixed-integer convex formulation using Mark’s trick below (which would work).