Virial theorem and variational method: an exercise (re-edited) I have a hydrogen atom, knowing that its Hamiltonian has been modified turning the standard potential 
$$
V_{0}(r) = -\frac{Z}{r} 
$$
into
$$
V(r) = -\frac{g}{r^{\frac{3}{2}}} 
$$
with $g$ a positive constant.
An upper bound to the ground-state energy is to be determined.
I thought of using the variational method, with a trial function
$$
\psi(\xi)  = A\cdot e^{-\xi r}
$$
$A = \frac{\xi^3}{\pi}$ (normalization condition). The idea for such a wave-function comes from having regarded $V(r)$ as a standard hydrogenic potential with a "space-dependent atomic number", $Z(r) = g\cdot r^{-5/2}$. 
FIRST QUESTION: Is this a good choice for the trial function? If not, why?
So, just like in a usual hydrogenic atom, 
$$
\langle T\rangle = \langle\psi(\xi)|-\frac{\nabla^2}{2}|\psi(\xi)\rangle = \frac{\xi^2}{2}
$$

I thought of using the virial theorem (being $V(r)$ spherically
  symmetric and $\propto r^{-3/2}$) to calculate the part $\langle
  V\rangle$: $$ \langle V\rangle = -\frac{4}{3}\langle T\rangle $$ But I
  wasn't able to apply it without obtaining something illogical!

Calculating $\langle V\rangle$ explicitly I found
$$
\langle V\rangle = \langle \psi(\xi)|-\frac{g}{r^{-3/2}}|\psi(\xi)\rangle = 4\pi A^2 \int_0^{\infty} \! r^2 e^{-2\xi r}(-\frac{g}{r^{3/2}}) \, \mathrm{d}r = 
$$
$$
-4g\xi^3\int_0^{\infty} \! r^{1/2} e^{-2\xi r}\, \mathrm{d}r \xrightarrow[{d}r \rightarrow 2t{d}t]{r \rightarrow t^2} -8g\xi^3\int_0^{\infty} \! t^2 e^{-2\xi t^2}\, \mathrm{d}t =
$$
$$
-8g\xi^3\frac{1}{4{(2\xi)}^{3/2}}\sqrt{\pi} = -\sqrt{\frac{\pi}{2}}g\xi^{3/2}
$$
So, going on applying the variational method, I have to minimize
$$
E(\xi) = \langle\psi(\xi)|H|\psi(\xi)\rangle = \langle\psi(\xi)|-\frac{\nabla^2}{2}-\frac{g}{r^{-3/2}}|\psi(\xi)\rangle  =
$$
$$
\langle T\rangle + \langle V\rangle = \frac{\xi^2}{2} -\sqrt{\frac{\pi}{2}}g\xi^{3/2}
$$
calculating
$$
\frac{{d}E(\xi)}{{d}\xi} = \xi - \frac{3}{2}\sqrt{\frac{\pi}{2}}g\xi^{1/2} = 0 \Rightarrow \begin{cases} \xi = 0 \\ \xi = \frac{9\pi}{8}g^2 = \bar{\xi} \end{cases}
$$
The only acceptable solution is the positive one, $\bar{\xi}$, so that an upper bound to the ground-state energy is
$$
E(\bar{\xi}) = \frac{\bar{\xi}^2}{2} -\sqrt{\frac{\pi}{2}}g\bar{\xi}^{3/2}
$$
SECOND QUESTION: How can I properly use the virial theorem?
I asked something like this before and I thought I understood it but - obviously - I have not. Please make this clear to me; thank you in advance!
 A: To address your first question: Whether this is a good choice depends on what you consider "good". It is clearly a simple choice and simplicity might be good, moreover it is an ansatz that minimizes the similar problem of the hydrogen atom. If you define "good" as giving you an accurate upper bound very close to the true ground state energy, you can not know unless you improve your ansatz or calculate the exact ground state energy. By improving your ansatz, which will lead a more complicated expression, or trying a new one you can compare the energies and see how good the initial one was.
To address your second question: As said in the thread you asked a similar question in, the virial theorem only holds if (and only if) the considered wave function is an energy eigenstate of system. So in order to use the virial theorem you have to show that $$\hat H\,\psi(r,\xi)=\epsilon(\xi) \,\psi(r,\xi),$$ which should nearly never be true. Therefore you should actually never use the virial theorem within the variational method.
