The expected value of a function $g(X)$ of a random variable $X$ is given by the integral of $g(x)f_X(x)$ over the range of $X$, where $f_X(x)$ is the probability density function of $X$. In this case, $g(X) = 1/X$ and $f_X(x) = 1$ for $x$ in the interval $[1,2]$
Show more…