Gamma distribution of maximal variance by Lagrange multiplier
Solution 1:
Your problem is not a single variate case. You have two variables, $\alpha$ and $\beta$. The lagrange function is
$$\mathcal L=\frac{\alpha}{\beta^2}+\lambda \cdot (1-\beta+\alpha)$$
The corresponding conditions are
$\frac{\partial \mathcal L}{\partial \alpha}=\frac1{\beta^2}+\lambda =0$
$\frac{\partial \mathcal L}{\partial \beta}=-2\frac{\alpha}{\beta^3}-\lambda =0$
$\frac{\partial \mathcal L}{\partial \lambda}=1-\beta+\alpha =0$
Solve the equation system to obtain $\lambda^*,\alpha^*, \beta^*$
Then use the $\texttt{bordered Hessian}$ to evaluate if the stationary point is a (local) maximum or (local) minimum.
$$\tilde H=\left( \begin{array}{} 0 & \frac{\partial^2 \mathcal L}{\partial \lambda\partial \alpha}& \frac{\partial^2 \mathcal L}{\partial \lambda\partial \beta} \\ \frac{\partial^2 \mathcal L}{\partial \lambda\partial \alpha} & \frac{\partial^2 \mathcal L}{\partial \alpha\partial \alpha} & \frac{\partial^2 \mathcal L}{\partial \alpha\partial \beta} \\ \frac{\partial^2 \mathcal L}{\partial \lambda\partial \beta} & \frac{\partial^2 \mathcal L}{\partial \alpha\partial \beta} & \frac{\partial^2 \mathcal L}{\partial \beta\partial \beta} \end{array}\right)$$
If $det \ \tilde H(\lambda^*,\alpha^*, \beta^*) >0 \Rightarrow \texttt{it´s a (local) maximum}$
If $det \ \tilde H(\lambda^*,\alpha^*, \beta^*) <0 \Rightarrow \texttt{it´s a (local) minimum}$