I was looking up expectation value of energy for a free particle on the following webpage:
http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/expect.html
It says that $E=\frac{p^2}{2m}$ and therefore $\langle E\rangle=\frac{\langle p^2\rangle}{2m}$
This leads to $$\langle E\rangle=\int\limits_{-\infty}^{+\infty}\Psi^*\frac{-\hbar^2}{2m}\frac{\partial^2}{\partial x^2}\Psi\,dx$$
However, it also has on the bottom of the page: "In general, the expectation value for any observable quantity is found by putting the quantum mechanical operator for that observable in the integral of the wavefunction over space".
Now, I know that the operator for $E$ is $i\hbar\frac{\partial}{\partial t}$. So shouldn't $\langle E\rangle$ be: $$\langle E\rangle=\int\limits_{-\infty}^{+\infty}\Psi^*(i\hbar)\frac{\partial}{\partial t}\Psi\,dx$$
Best Answer
First things first: the operator which corresponds to the energy is the Hamiltonian, typically written as $H$. So when you want to get the expectation value of the energy, you evaluate $\langle H\rangle$.
Now, there are multiple ways to do this. One way is to use the Schroedinger equation to get
$$\langle H\rangle = \left\langle i\hbar\frac{\partial}{\partial t}\right\rangle = \int\Psi^*(x,t) i\hbar\frac{\partial}{\partial t}\Psi(x,t)\,\mathrm{d}x\tag{1}$$
That calculation is completely general, i.e. it is valid in any situation for which the Schroedinger equation applies.
Another way to get $\langle H\rangle$ is to use the definition of the Hamiltonian operator, which in nonrelativistic QM is
$$H = \frac{p^2}{2m} + V(x,t) = -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} + V(x,t)$$
That gives you
$$\begin{align}\langle H\rangle &= \biggl\langle -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} + V(x,t)\biggr\rangle \\ &= \int\Psi^*(x,t)\biggl(-\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} + V(x,t)\biggr)\Psi(x,t)\,\mathrm{d}x\tag{2}\end{align}$$
Either (1) or (2) works in general.
For a free particle only, the potential $V(x,t)$ is zero, and you get
$$\langle H\rangle = \int\Psi^*(x,t)\biggl(-\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2}\biggr)\Psi(x,t)\,\mathrm{d}x$$
which is the expression you saw on that web page.