Expectation is a measure of the location/mean of the random variable (in the units of the random variable). The expected value of a discrete random variable is
Any real-valued function is also a random variable, , say, and, by the same line of argument, its expectation is
This is sometimes referred to as The Law of the Unconscious Statistician.
The expected value of a continuous random variable is
Similarly for a real-valued function of a continuous random variable the expected value is
A proof of the above Law of the Unconscious Statistician for continuous random variables is given in Appendix B. As an example application e.g.: