Expected Values of Operators in Quantum Mechanics I've recently started an introductory course in Quantum Mechanics and I'm having some trouble understanding what the expectation of an operator is. I understand how we get the formula for the expectation of position, if we assume that the complex function $\psi$ describes a particle, and $f=|\psi|^2$ is a probability density of finding the particle at varying x at time t.
$\langle x\rangle=\int^{\infty}_{-\infty} xf(x)dx=\int^{\infty}_{-\infty}x\psi^*(x) \psi(x)dx=\int^{\infty}_{-\infty}\psi^*(x)x \psi(x)dx$
But in my course the expectation of an operator (for example momentum $\hat{p}=-i\bar{h}\frac{\partial}{\partial x}$) is defined as
$\langle\hat{p}\rangle=\int^{\infty}_{-\infty}\psi^*(x)\hat{p} \psi(x)dx=\int^{\infty}_{-\infty}\psi^*(x)-i\bar{h}\frac{\partial}{\partial x} \psi(x)dx=-i\bar{h}\int^{\infty}_{-\infty}\psi^*(x)\frac{\partial}{\partial x} \psi(x)$
I don't understand what the expectation of an operator would mean. I can understand the phrase "we expect the momentum to be $p_0$" to mean "after doing this experiment a large number of times, the mean momentum recorded will be $p_0$." But I can't understand what the expectation of a derivative is, before it's even applied to anything!
What does this expected value of the momentum operation mean in QM? Does it relate to something in the real world? Did we just notice that the formula above just happens to look like the average result after a lot of experiments?
Anyway, any clarification would be well appreciated!

All of the previous answers are giving the expectation of the operator measuring a state/wave function/vector. That is a random variable and thus has an expectation. The operator itself is not a random variable. 
