How to find the corresponding energy given the wave function? So I was struggling doing the following question:
Given the wave function $\psi(x) = A\, \mathrm{e}^{-ax^2} $ with potential $V = \frac12 kx^2$, find the corresponding total energy in terms of $k$ and $m$.
I did the calculation for $\left<x^2\right>$ and $\left<p^2\right>$ but it turns out to be expressions including $a$. How can I express $a$ in terms of $k$ and $m$?
 A: The energy of a state is the eigenvalues of the Hamiltonian. So calculate the expectation value of it for that state.
A: Since $\hat H\psi(x)=E\psi(x)$ just act on $\psi(x)$ using $\hat H$ and presumably the result is a multiple of $\psi(x)$.
Alternatively, to build on your calculation, if $\psi(x)$ is suitably normalized (and your expression is not):
$$
\langle H\rangle=\frac{1}{2m}\langle p^2\rangle+ \frac{1}{2}k\langle x^2\rangle
$$
and express $a$ in terms of $m,k,\hbar$ using the normalization of  $\psi(x)$.
A: If you're told that $\psi(x)$ is an energy eigenstate, then it must be the case that
$$
- \frac{\hbar^2}{2m} \frac{d^2 \psi}{d x^2} + \frac{1}{2} k x^2 \psi = E \psi
$$
for some value of $E$.  But if you actually take the derivatives on the left-hand side, you'll find that there is one particular value of $a$ for which this is actually true;  it will be the value of $a$ that ensures that the right-hand side is just a multiple of $\psi$ itself.  This requirement determines $a$ in terms of $k$ and $m$ (and other constants.)
However, if you don't know that $\psi(x)$ is an energy eigenstate, then it's not possible to determine $a$.  Any wavefunction $\psi(x)$ can be written as a superposition of the energy eigenstates of the system, including $e^{-ax^2}$ for an arbitrary value of $a$.  You can still calculate the expectation value for the Hamiltonian in this state, $\langle \psi | H | \psi \rangle$; but the result will be a function of $a$.
