This question is taken from Rice - Mathematical statistics.
A random rectangle is formed in the following way: The base, X, is chosen to be a uniform [0, 1] random variable and after having generated the base, the height is chosen to be uniform on [0, X]. Use the law of total expectation, Theorem A of Section 4.4.1, to find the expected circumference and area of the rectangle.
I have trouble understanding the answer for finding the expected area of rectangle.
Let H be the height of the rectangle. The area is XH, so
$E(XH) = E(E(XH|X)) = E(XE(H|X)) = 1/2 E(X^2)$
Can someone kindly explain how do you derive the 3rd part from the 2nd part of the equation ?