Integral representations of L-functions and spectral identities