= Solution
Choose $M<\infty$ such that $|X|,|Y|\leq M$ almost surely. Equality of the positive moments, together with equality of the zeroth moments $\mathbb E[1]=1$, gives
$$
\mathbb E[p(X)]=\mathbb E[p(Y)]
$$
for every <polynomial> $p$. By the <Weierstrass approximation theorem>, every continuous function on $[-M,M]$ is a uniform limit of polynomials. Expectations preserve this limit, so $X$ and $Y$ have equal expectations for every continuous function on their common compact support. The <moment determinacy on a compact interval> therefore gives equality of their laws.
Back to article page