The kinetic energy operator is
, or
in cartesian coordinates. So the kinetic energy integral over
general, uncontracted gaussian functions is
where we now define
as
Now we need to determine the action of the lagrangian (or any piece thereof) on a particular gaussian function. Sequentially applying the differential operator,
Clearly, this is just a sum of three gaussian functions related to the original by a shift of 0, 2, or -2 in the angular momentum portion, aside from some constants.