Actually, they do not 'remove' the integrals. They apply Gateaux differentiation and are left with linear functionals.

There are many good books (albeit too technical) in which you will find the details and, even, some sufficient conditions regarding the validity of this approach.

I recommend Struwe's "Variational Methods".