Given a joint probability density function of N real random variables, fx j g N jD1, obtained from the eigenvector-eigenvalue decomposition of N N random matrices, one constructs a random variable, the linear statistics, defined by the sum of smooth functions evaluated at the eigenvalues or singular values of the random matrix, namely, P N jD1 F.x j /. For the joint PDFs obtained from the Gaussian and Laguerre ensembles, we compute, in this paper, the moment-generating function Eˇ.exp. P j F.x j ///, where Eˇdenotes expectation value over the orthogonal (ˇD 1) and symplectic (ˇD 4) ensembles, in the form one plus a Schwartz function, none vanishing over R for the Gaussian ensembles and R C for the Laguerre ensembles. These are ultimately expressed in the form of the determinants of identity plus a scalar operator, from which we obtained the large N asymptotic of the linear statistics from suitably scaled F. /.