I do your homework just because I would like you to see how to use MathJax.
EDITED:
To answer your question asked in a comment below:
Reason (a): You said so: " 0 < x, y < 1." What else is that supposed to mean?
Reason (b): Also, the double integral over the domain of the joint distribution has to equal $1$. It does:
$$\iint_{[0,1]\times[0,1]} (2-x-y)\ dy\ dx=\int_0^1\left[\int_0^1(2-x-y)\ dy \right]dx=\int_0^1(2-x-\frac{1}{2})\ dx=\left[2x-\frac{1}{2}x^2-\frac{1}{2}x\right]_0^1=2-\frac{1}{2}-\frac{1}{2}=1.$$
Reason (c): I did not want to guess, I used what I was told and looked reasonable...
The original answer:
The joint density is defined as follows:
$$f_{X,Y}(x,y)=\begin{cases}2-x-y,&\text{ if }0\le x\le 1 \text{ and }0\le y\le 1\\
0,& \text{ otherwise.} \end{cases}$$
So, there is no $\infty$ anywhere.
For the marginal density of $X$ we have, for $0\le x\le 1$,
$$f_X(x)=\int_0^1f_{X,Y}(x,y)dy=\int_0^1(2-x-y)dy=\left[2y-xy-\frac{1}{2}y^2 \right]_0^1=2-x-\frac{1}{2},$$
and $0$ otherwise.
Now, the expectation of $X$ and of $X^2$ are, by definition,
$$E[X]=\int_0^1 xf_X(x)=\int_0^1 2x-x^2-\frac{1}{2}xdx=\left[x^2-\frac{1}{3}x^3-\frac{1}{4}x^2\right]_0^1=\frac{5}{12},$$
$$E[X^2]=\int_0^1 x^2f_X(x)=\int_0^12x^2-x^3-\frac{1}{2}x^2 dx=\left[\frac{2}{3}x^3-\frac{1}{4}x^4-\frac{1}{6}x^3\right]_0^1=\frac{1}{4}.$$
The variance is then
$$\sigma^2=E[X^2]-E[X]^2=\frac{1}{9}.$$
Best Answer
Yes, if the marginal density function for this continuous random variable does exists then:
$$\begin{align}\mathsf E(Y^n) &= \iint_{\Bbb R^2} y^n f_{\small X,Y}(x,y)\,\mathrm d(x,y)\\&=\int_\Bbb R y^n \int_\Bbb R f_{\small X,Y}(x,y)\,\mathrm d x\,\mathrm d y\\&=\int_\Bbb R y^n f_{\small Y}(y)\,\mathrm d y\\[3ex]\mathsf E(Y)&=\int_\Bbb R yf_{\small Y}(y)\,\mathrm d y\\[3ex]\mathsf E(Y^2)&=\int_\Bbb R y^2f_{\small Y}(y)\,\mathrm d y\end{align}$$