What is the variational energy of two spinless bosons with given interaction potential? There was a question on my exam quantum mechanics that I wasn't able to solve and I am curious how it is done, I cannot find any reference in the section of pertubation theory that describes systems with more than one wavefunction.
The question was:

"Two spinless bosons inside a harmonic well interact with interaction potential $$g\delta \left ( x_{1}-x_{2} \right ),$$ give the Hamiltonian and calculate the variational energy for the wavefunction $$\Psi(x_1,x_2)\sim exp(-x^2_{1}/2a)exp(-x^2_{2}/2a),$$ with ($a>0$)."

My first thought was to use the general formula: $$E(a)=\frac{<\psi(a)|\hat H|\psi(a)>}{<\psi(a)|\psi(a)>},$$ with $a=(a_1,a_2,...,a_n),$
And then use: $E_g\le min[E(a)],$ to calculate the ground state.
I  know the Hamiltonian for a harmonic well is given by: $$H=\frac{P^2}{2m}+V(x)=\frac{P^2}{2m}+\frac{kx^2}{2}, $$
Which for two particles would be (not sure if it is correct): $$H=-\frac{\hbar^2}{2m}(\frac{d^2}{dx_1^2}+\frac{d^2}{dx_2^2})+g\delta \left ( x_{1}-x_{2} \right )+\frac{m}{2}(\omega_1^2x_1^2+\omega_2^2x_2^2).$$
Now I'm a bit stuck because I'm not sure if I have to calculate the ground state for each particle or if those particles' ground state energies are shared (what I mean is, do I have to calculate the kinetic and potential energies for both particles seperately or do I have to calculate them both at the same time and then fill it in in the variational energy to get the ground state?).
I can provide more details as there were more questions but I think I can solve them when this is done.
 A: For those that might be interested in the solution:
I have calculated the answer and I think this is the right answer:
Using the Hamiltonian from the question one can first calculate $\hat H|\psi>$:
For the kinetic part of the Hamiltonian:
$$<\psi|\hat H_T|\psi>=-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\frac{\hbar^2}{2m}\left( \frac{\partial^2}{\partial x_1^2}+\frac{\partial^2}{\partial x_2^2}\right)e^{-\frac{\left(x\space_1\space^2+x\space_2\space^2\right)}{a}}dx_1dx_2$$
$$<\psi|\hat H_T|\psi>=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\frac{\hbar^2}{2ma}\left( 2-(x_1^2+x_2^2)\right)e^{-\frac{\left(x\space_1\space^2+x\space_2\space^2\right)}{a}}dx_1dx_2$$
Solving this using Gaussian integrals gives:
$$<\psi|\hat H_T|\psi>=\frac{\hbar^2\pi}{m}$$
For the potential part of the Hamiltonian without interaction term:
$$<\psi|\hat H_V|\psi>=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\frac{1}{2}m\left( \omega_1^2x_1^2+\omega_2^2x_2^2\right)e^{-\frac{\left(x\space_1\space^2+x\space_2\space^2\right)}{a}}dx_1dx_2$$
Which gives:
$$<\psi|\hat H_V|\psi>=\frac{m\pi a^2}{4}\left( \omega_1^2+\omega_2^2\right)$$
The last term is the interaction term:
$$<\psi|\hat H_{V'}|\psi>=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}g\delta(x_1-x_2)e^{-\frac{\left(x\space_1\space^2+x\space_2\space^2\right)}{a}}dx_1dx_2$$
$$<\psi|\hat H_{V'}|\psi>=\int_{-\infty}^{+\infty}ge^{-2\frac{x\space_1\space^2}{a}}dx_1$$
(Note that I have used the delta function property for integrals).
Normalisation gives:
$$<\psi|\psi>=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}e^{-\frac{\left(x\space_1\space^2+x\space_2\space^2\right)}{a}}dx_1dx_2$$
$$<\psi|\psi>=\pi a$$
The variational energy E(a) then becomes:
$$E(a)=\frac{<\psi|\hat H|\psi>}{<\psi|\psi>}=\frac{\hbar^2}{ma}+g\frac{1}{\sqrt{2\pi a}}+\frac{ma}{4}\left( \omega_1^2+\omega_2^2\right)$$
The ground state energy can now be calculated by deriving E in respect to a: $\partial E/\partial a=0$ and filling in the given a back into the energy equation.
To check the validity one can take the limit from g to 0 and calculate the energy (thank you Hyperon for this):
$$E(a)=\frac{<\psi|\hat H|\psi>}{<\psi|\psi>}=\frac{\hbar^2}{ma}+\frac{ma}{4}\left( \omega_1^2+\omega_2^2\right)$$
$$\frac{\partial E(a)}{\partial a}=-\frac{\hbar^2}{ma^2}+\frac{m}{4}\left( \omega_1^2+\omega_2^2\right)=0$$
a then becomes:
$$a=\frac{2\hbar}{m}\frac{1}{\sqrt{\omega_1^2+\omega_2^2}}$$
Filling it back in E gives the ground state energy for two uncoupled particles in a harmonic well:
$$E_g=\frac{\hbar}{2}\sqrt{\omega_1^2+\omega_2^2}$$
