Basically, I want to find a probability distribution which maximizes a convex objective function and satisfies two moment constraints. For given $\bar x$, $m_{n-1}$, $m_n$ $$ \max_{f(x)} \int_{x=0}^\bar{x} f(x)\sum_{i=n+1}^\infty \frac{x^i}{i!} dx $$ such that $$ \int_{x=0}^\bar{x}f(x)dx = 1\\ \int_{x=0}^\bar{x}x^{n-1}f(x)dx = m_{n-1}\\ \int_{x=0}^\bar{x}x^{n}f(x)dx = m_{n}\\ f(x)\geq 0 $$ Some numerical examples suggest that if a solution exists, the optimal $f^*(x)$ is nonzero at only two distinct points, $\bar x$ and a second point. How can I prove this?
What I tried: Lagrange optimization with the three constraints gives at most three nonzero points. Namely, for each $x\in[0,\bar x]$ $$ f(x)\left( \sum_{i=n+1}^\infty \frac{x^i}{i!} dx - \lambda_1 - \lambda_2 x^{n-1} - \lambda_3 x^{n}\right) = 0 $$ This system of equations may have three distinct nonzero $f(x)$ because there are three unknowns $\lambda_1$, $\lambda_2$ and $\lambda_3$. How to exclude the third nonzero?