Consider a particle of mass $m$ in one dimension inside a potential well ($-a<x<a$) with infinitely high walls and the WF $\psi(x)=A(x^2-a^2)$ for $|x|<a$.
Show that the expected value of its energy is $(10-\pi^2)/\pi^2$ above the ground state energy.
My question: It obviously suffices to show that $$\frac{\langle E\rangle}{E_0}=\frac{10}{\pi^2}$$ Since $\psi(x)$ must be normalized, we have $A=\frac{1}{4}\sqrt\frac{15}{a^5}$ and it is easy to see that $$\langle E\rangle=\int_{-a}^a\psi(x)\cdot\frac{p^2}{2m}\psi^\dagger(x)dx=\frac{5\hbar^2}{4ma^2}$$
This means that $E_0=\frac{\hbar^2\pi^2}{8ma^2}$. But how do I get the ground state energy without reverse engineering? My initial thought was just $E\psi=\frac{p^2}{2m}\psi=-\frac{\hbar^2}{2m}\partial_x^2\psi(x)=-\frac{\hbar^2 A}{m}=-\frac{1}{4}\sqrt\frac{15}{a^5}\cdot\frac{\hbar^2}{m}$ which obviously doesn't work. Where is my error in this thought and how do I correct it?