Question: Let X and Y be positive independent random variables, and
$$W=\max(X,Y)$$
Define the CDFs of X and Y as $F(x)$ and $G(y)$, respectively.
$$\Pr(W\le w)=\Pr(X\le w)\Pr(Y\le w)=F(w)G(w)$$

$$E[W]=\int\_0^{\infty}wF(w)g(w)dw+\int\_0^{\infty}wf(w)G(w)dw$$

In an [earlier post](https://math.stackexchange.com/questions/1087107/how-to-express-e-maxx-y-as-an-integral) the second answer says that "if X and Y are independent with uniform distribution on $(0,1)$, then $E[W]=2/3$." I am having trouble seeing how this is so. Please spell it out for me.

In particular, I am having trouble seeing how an integral like $$\int\_0^{\infty}wF(w)g(w)dw$$ can be evaluated since $F(w)$ is itself an integral. If $F(w)$ is the normal CDF, for example, it is already intractable. So it seems to me that integrating something with $F(w)$ in it must be super duper intractable.

Answer: 
One example of where integrating a CDF isn't "intractable" - if $X$ is a continuous random variable, then with Tonelli's theorem we can show that
$$ \mathbb E[F(X)] = \int\_{-\infty}^\infty F(x)f(x)\mathsf dx = \left[\frac12F(x)^2\right]\_{-\infty}^\infty=\frac12.$$
For your particular example, where $X,Y\stackrel{\mathrm{i.i.d.}}\sim U(0,1)$, we can evaluate $\mathbb E[W]$ where $W=\max\{X,Y\}$ from the result in the previous question by a straightforward computation:
\begin{align}
\mathbb E[W] &= \int\_{\mathbb R} w(f\_X(w)F\_Y(w) +F\_x(w)f\_y(w))\mathsf dw\\
&= \int\_0^1 w(1\cdot w + 1\cdot w)\mathsf dw\\
&= \int\_0^1 2w^2 \mathsf dw\\
&= \frac23.
\end{align}
A uniform random variable has a density function $f(w) = 1$ for $w \in [0, 1]$ and distribution:
 $$F(w) = P(X \leq w) = w$$

So plugging these into
$$E[W]=\int\_0^{\infty}wF(w)g(w)dw+\int\_0^{\infty}wf(w)G(w)dw$$

we have:
\begin{eqnarray\*}
E[W] &=& \int\_0^{1}w^2dw+\int\_0^1w^2dw \\
&=& 2 \frac{w^3}{3}|\_0^1 \\
&=& 2/3
\end{eqnarray\*}