$X$ is a random variable that is sampled from the mixture of uniform distributions. In other words: $$X \sim \sum_{i=1}^N w_i \cdot \mathbb{U}(x_i, x_{i+1}),$$ where $\mathbb{U}(x_i, x_{i+1})$ denotes a random variable that follows a uniform distribution in $[x_i, x_{i+1}]$. For feasibility, we need $w \geq 0, \ \sum_{i=1}^N w_i = 1$.
In an optimization problem my variables are $w_i$ for $i=1,\ldots,N$, and I would like to upper bound the variance of $X$. According to Wikipedia, the variance of $X$ is: $$\mathrm{Var}(X) = \sum_{i=1}^N w_i(\sigma_i^2+ \mu_i^2 - \mu^2) $$ where $\sigma_i^2$ and $\mu_i$ are the variance and mean of $\mathbb{U}(x_i, x_{i+1})$, respectively (which are parameters), and $\mu$ is the mean of the mixture, which is $$\mu = \sum_{i=1}^N w_i \frac{x_i + x_{i+1}}{2}.$$
Thus, if my derivation is not wrong: $$ \mathrm{Var}(X) = \sum_{i=1}^N w_i\left(\sigma_i^2+ \mu_i^2 - \left(\sum_{j=1}^N w_j \frac{x_j + x_{j+1}}{2}\right)^2\right) $$ which is very ugly and appears to be non-convex to upper bound this function (edit: I want to constrain $\mathrm{Var}(X) \leq \mathrm{constant}$).
My question is, is there any trick, or any other convex approximation of such a variance, such that I can include an upper bound on the variance constraint?