Recall the definition of expected value: if f ( x ) {\displaystyle f(x)} is the probability density function of a random variable X {\displaystyle X} , its expected value is defined as the integral E ( X ) = ∫ − ∞ ∞ x f ( x ) d x {\displaystyle E(X)=\int _{-\infty }^{\infty }xf(x)\,dx} .