Uniform probability distributions I have a bit of a misunderstanding going on:
If we have a continuous random variable $x$ which is uniformly distributed between $0$ and $2$, then its probability density function is $P(x)=\frac{1}2$.
I would expect the mean value of $x$ to be $1$, because $x$ is uniformly distributed between $0$ and $2$ so should take the midpoint of this range - to check,
$<x>=\int_0^2 x P(x) dx = 1$
Now I would expect (wrongly) the mean of $x^2$ to be $2$, because all $x$ values between $0$ and $2$ are equally likely, and each of these $x$ values gives an $x^2$ value between $0$ and $4$. All of these $x^2$ values are equally likely, because their corresponding $x$ values were. Then we expect the mean of $x^2$ to be $2$ like the mean of $x$ was $1$ - to check (that my intuition is wrong),
$<x^2>=\int_0^2 x^2 P(x) dx = \frac{4}3$
So I am just wondering what is wrong with my logic in the second paragraph, and what would be the correct logic behind understanding the value of $<x^2>$? Thankyou :)
 A: The problem is the claim that all $x^2$ values between $0$ and $4$ are equally likely. That's just not true, except in the sense that each one of them has probability zero. But in any more reasonable sense, it fails. 
In particular, if all were equally likely, then the probability that the square was between 0 and 2 would be the same as the probability that the square was between 2 and 4. But the first corresponds to $x$ values between $0$ and $\sqrt{2} \approx 1.4$, while the second corresponds to an interval of length about $0.6$ (namely, $\sqrt{2}$ up to $2$). 
A: One reason that you should notice that every subinterval of equal length within support of $X^2$ is not equally likely is notice $P(0<X^2<1)=\frac{1}{2}$ and $P(1<X^2<4)=\frac{1}{2}$. The basic reasoning is that  $X^2$ is not a linear transformation so essentially regions when transformed aren't spread out by the same magnitude
A: 
all $x$ values between $0$ and $2$ are equally likely, and each of these $x$ values gives an $x^2$ value between $0$ and $4$. All of these $x^2$ values are equally likely, because their corresponding $x$ values were.

The reasoning is incorrect.
Consider what happens to a small neighborhood of $x$, say to values between $x$ and $x+\delta x$ (for small $\delta x$), when we look at the density of $X^2$.
Values between $x$ and $x+\delta x$ will be taken to between $x^2$ and approximately $x^2 + 2 x \,\delta x$ $-$ so the squared values spread over a range of $2x \,\delta x$. So near $x=\frac{1}{2}$ values in a range of $\delta x$ transform to values also spread over  $\delta x$ ... but when we look at values near $x=\frac{3}{2}$ they're spread over $3\,\delta x$ $-$ so they're more thinly spread $-$ i.e. less dense.
That is, elementary reasoning shows us that $x^2$ doesn't have a uniform distribution.
If $Y=X^2$ we can work out the actual density of it fairly readily - 
$P(Y\leq y) = P(X^2\leq y) = P(X\leq \sqrt{y}) = \frac{1}{2}\sqrt{y}$
Hence $f_Y(y) = \frac{d}{dy}\frac{1}{2}\sqrt{y}=\frac{1}{4}y^{-\frac{1}{2}}, \quad 0<y<4$
However, we could have discovered it wasn't uniform via the very simple expedient of simulation. Below is a histogram of the squares of $10^5$ uniform random numbers, with the density we just calculated marked in blue for comparison:

