I am interested in maximizing the variance of a random variable $X$ supported on $[0,1]$.  Formally, 

$$\max_{P_X: X \in [0,1]} {\rm  Var}(X),$$

where $P_X$ is a distribution of $X$. This question is well-studied on this webpage. For example, see this [question][1]. The solution to this question is given by $P_X(0) = P_X(1) = \frac 12$.  

My question is about a specific approach to solving this.  Concretely, I am interested in applying the convex optimization method to this problem.  

Here is the outline of the proof/method:

 1. Note that space of distribution over $[0,1]$ $$\mathcal{P} = \left\{  P_X : X \in [0,1] \right\}$$ is  convex and compact in weak-topology.
 
 2. $P_X \to {\rm  Var}(X)$ is concave.  

 3. Combining 1) and 2)  we conclude that this is a well-defined convex optimization problem.

 4. Find the KKT conditions by using the directional derivative. These are given by the following: $P_X$ is an optimizer if and only if 

\begin{align}
&(x-E_{P_X}[X])^2  \le {\rm  Var}_{P_X}(X), x\in [0,1]\\
&(x-E_{P_X}[X])^2  = {\rm  Var}_{P_X}(X), x \in \text{ support of $P_X$}\\
\end{align} 


**My question:** How to solve the above equations and produce the optimal $P_X$? 

Of course, at this point, we can just plug-in our distribution and check it. However, this would be cheating.  I would like to solve for the optimal distribution starting with the above equations with no extra help.    For example, at this point, we don't even know that the distribution is discrete. 

**Why is this interesting:**  Since variance is one of the simplest concave operators over the space of distributions, solving it via convex optimization method serves as an interesting example. 








  [1]: https://stats.stackexchange.com/questions/45588/variance-of-a-bounded-random-variable