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 forum. For example, see this question. 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:
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.
$P_X \to {\rm Var}(X)$ is concave.
Combining 1) and 2) we conclude that this is a well-defined convex optimization problem.
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 < {\rm Var}_{P_X}(X), x\in [0,1] \setminus {\rm supp}(P_X)\\ &(x-E_{P_X}[X])^2 = {\rm Var}_{P_X}(X), x \in {\rm supp}(P_X)\\ \end{align}
My question: How to solve the above equations and produce an 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.