Differentiating the trial wave function to find the local energy in closed form.