Given constants $m\_0,\ldots m\_n$ and a measure $\mu$ on $\mathbb{R}$, how can I "recover" the integrals $\int f x^n d\mu$ of the maximum entropy distribution $f\in L^2(\mathbb{R})$ which satisfies $\int f^2 x^n d\mu=m\_n$ ? 



minimum information distribution given moments of its square
Let us consider the special case when $\mu$ is the Lebesgue measure on $\mathbb{R}$. The derivation then should be extendable to the general case without much effort.


We need to find the distribution $f$ that solves the following problem: $$\max\_{f\in \mathcal{B}}-\int\_\mathbb{R}f(x)\ln f(x) dx\\\Leftrightarrow\min\_{f\in \mathcal{B}}\int\_\mathbb{R}f(x)\ln f(x) dx\\\mathrm{s.t.}\quad \int\_\mathbb{R}f(x) dx=1,\ \int\_\mathbb{R}f^2(x) x^kdx=m\_k,\ k=0,1,\cdots,\ n$$ where $\mathcal{B}$ is the set of Borel measurable functions on $\mathbb{R}$. The corresponding Lagrangian is $$\mathcal{L}\left(f(x),\{\lambda\_k\}\_{k=0}^n\right)=\int\_\mathbb{R}f(x)\ln f(x) dx-\lambda\_0\int\_\mathbb{R}f(x) dx-\sum\_{k=1}^n \lambda\_k \int\_\mathbb{R}f^2(x) x^kdx$$ The maximizing distribution is obtained by equating the derivative of the Lagrangian to $0$ $$\frac{\partial \mathcal{L}}{\partial f}=1+\ln f(x)-\lambda\_0-2\sum\_{k=1}^n\lambda\_k f(x) x^k=0\\\implies \ln f(x)=\lambda\_0-1+2f(x)\sum\_{k=1}^n \lambda\_k x^k\\\implies f(x)=a\exp\left(bf(x)\right)\\\implies f(x)=-\frac{W(-ab)}{b}$$ where $W$ is the [Lambert's W function](https://en.wikipedia.org/wiki/Lambert_W_function), $a=e^{\lambda\_0-1},\ b=2\sum\_{k=1}^n \lambda\_k x^k$ Thus, we can express the integral $\int\_\mathbb{R} f(x) x^k dx$ as below: $$\int\_\mathbb{R} f(x) x^k dx=-\int\_\mathbb{R}\frac{W\left(-2a\sum\_{j=1}^n \lambda\_j x^j\right)}{2\sum\_{j=1}^n \lambda\_j x^j}x^k dx$$ Beyond this point, the integral seems to be formidable, and probably a numerical approach is required, but in principle, this derivation produces some form of the maximizing distribution $f$, which one can then work with.


