Now taking variational operator inside the square bracket, we get
On integrating by parts with respect to x and t the first and second terms respectively, we get