Minimizing the KL distance from a uniform distribution under a mean constraint I wish to solve the problem $$p^*=\arg\min_p D_{KL}(p||q),\;\;s.t.\;\;\mathbb{E}_{X\sim p}X=\mu,$$
where $q$ is the uniform distribution $q=\text{Unif}[0,\alpha]$.
I know that the general solution to these type of problems is exponential family, hence
$$ p^*(x) =q(x)e^{\eta x -a(\eta})= \frac{1}{\alpha}e^{\eta x -a(\eta})\mathbb{I}_{x\in[0.\alpha]}.$$
After I calculate $a(\eta)$ according to the normalization constraint I get 
$$ p^*(x) =\frac{\eta }{e^{\eta \alpha}-1}e^{\eta x}\mathbb{I}_{x\in[0.\alpha]}.$$
Now I want to look at interesting values of $\alpha$ (the support of the uniform distribution) and calculate the parameter $\eta$ to hold the mean constraint in these cases. Example for such cases: $\alpha \rightarrow \infty$, $\alpha \rightarrow 0$, $\alpha = \frac{b}{2}$.
However, except in the latter case, I didn't succeed in solving the equation. After calculating the mean I get
$$\mu = \frac{ \alpha}{e^{\eta \alpha}-1}+\alpha -\frac{1}{\eta}$$,
and I don't see how this can be solved, say for $\alpha\rightarrow \infty$.
 A: Let's do some variational calculus here:
First, let's suppose, that we are looking for the function p(x) with the same domain as q(x).
We want to solve constrained optimisation problem:
$
\left \{ \begin{array}{rcl}
\int\limits_{0}^{\alpha} p(x) \log \frac{p(x)}{q(x)} \ dx \to \min\limits_{p(x)} \\
\int\limits_{0}^{\alpha} p(x) \ dx = 1 \\
 \int\limits_{0}^{\alpha} xp(x) \ dx = \mu
\end{array} \right .
$
So we have $L(p) = \int\limits_{0}^{\alpha} \underbrace{p(x) \log \frac{p(x)}{q(x)} + \lambda_{1} \cdot p(x) + \lambda_{2} \cdot x p(x)}_{F(x, p, p^{\prime})} \ dx \to \min\limits_{p(x)}$.
It's known from variational calculus, that you need to solve $\frac{\delta L}{\delta p} = \frac{\partial F}{\partial p} - \frac{d}{dx} \cdot \frac{\partial F}{\partial p^{\prime}} = 0$ in order to minimize $L(p)$.
$\frac{\delta L}{\delta p} = \log p(x) - \log q(x) + 1 + \lambda_{1} + \lambda_{2}x = 0 \Rightarrow \log p(x) = \log q(x) - 1 -\lambda_{1} - \lambda_{2}x \Rightarrow p(x) = q(x) \cdot e^{-\lambda_{1} - 1 - \lambda_{2}x} = \frac{1}{\alpha} \cdot e^{-1 - \lambda_{1} - \lambda_{2}x}$.
Now we find parameters $\lambda_{1, 2}$ by solving the conditions:
1) $\int\limits_{0}^{\alpha} p(x) = 1 \Rightarrow \frac{1}{\alpha} e^{-1 - \lambda_{1}} \int\limits_{0}^{\alpha} e^{-\lambda_{2}x} \ dx = \frac{1}{\alpha} e^{-1 - \lambda_{1}} \cdot \left( \frac{e^{-\lambda_{2} \cdot \alpha}}{-\lambda_{2}}  + \frac{1}{\lambda_{2}} \right) = \boxed{\frac{e^{-1-\lambda_{1}} \cdot (1 - e^{- \lambda_{2} \alpha})}{\alpha \cdot \lambda_{2}} = 1}$
2) $\int\limits_{0}^{\alpha} x p(x) \ dx = \frac{1}{\alpha} e^{-1 - \lambda_{1}} \int\limits_{0}^{\alpha} x e^{-\lambda_{2}x} \ dx = \boxed{\frac{1}{\alpha} e^{-1 - \lambda_{1}} \cdot \frac{1 - (\alpha \lambda_{2} + 1) \cdot e^{-\lambda_{2} \alpha}}{\lambda_{2}^2} = \mu}$
