In this paper we present the theory and implementation of analytic derivatives of time-dependent density functional theory (TDDFT) excited states energies, both in vacuo and including solvent effects by means of the polarizable continuum model. The method is applied to two case studies: p-nitroaniline and 4-(dimethyl)aminobenzonitrile. For both molecules PCM-TDDFT is shown to be successful in supporting the analysis of experimental data with useful insights for a better understanding of photophysical and photochemical pathways in solution.