So I'm already aware of the quantum mechanical operator for momentum and how to derive the kinetic energy operator from this: $$\hat T=\frac{\hat p^2}{2m}=\frac{-\hbar^2}{2m}\frac{\partial^2}{\partial x^2}$$ But I'm wondering how to derive the kinetic energy operator solely from the statistical definition of an expectation value.
I've successfully derived the momentum expectation value this way to find: $$\lt p\gt =-i\hbar \int_{-\infty}^{\infty} \psi ^\star \frac{\partial \psi}{\partial x} dx = \int_{-\infty}^{\infty} \biggl(\psi ^\star \biggl(\frac{\hbar}{i}\frac{\partial}{\partial x}\biggr) \psi \biggr)dx = \int_{-\infty}^{\infty} \biggl(\psi ^\star\hat p \psi\biggr) dx $$
It seems to follow the same derivation as before, namely: $$\lt T \gt = \frac{\lt p \gt^2}{2m} =\frac{-\hbar^2}{2m} \biggl( \int_{-\infty}^{\infty} \psi ^\star \frac{\partial \psi}{\partial x} dx \biggr)^2 $$ But I dont see how to manipulate this such that $\biggl( \int_{-\infty}^{\infty} \psi ^\star \frac{\partial \psi}{\partial x} dx \biggr)^2 = \frac{\partial^2}{\partial x^2}$
Any help clarifying this issue would be greatly appreciated.