Terzan 5 is a complex stellar system in the Galactic bulge, harboring stellar populations with very different iron content ({Delta}[Fe/H] ~1 dex) and with ages differing by several Gyrs. Here we present an investigation of its variable stars. We report on the discovery and characterization of three RR Lyrae stars. For these newly discovered RR Lyrae and for six Miras of known periods we provide radial velocity and chemical abundances from spectra acquired with X-SHOOTER at the VLT. We find that the three RR Lyrae and the three short period Miras (P<300 d) have radial velocity consistent with being Terzan 5 members. They have sub-solar iron abundances and enhanced [{alpha}/Fe], well matching the age and abundance patterns of the 12 Gyr metal-poor stellar populations of Terzan 5. Only one, out of the three long period (P>300 d) Miras analyzed in this study, has a radial velocity consistent with being Terzan 5 member. Its super-solar iron abundance and solar-scaled [{alpha}/Fe] nicely match the chemical properties of the metal rich stellar population of Terzan 5 and its derived mass nicely agrees with being several Gyrs younger than the short period Miras. This young variable is an additional proof of the surprising young sub-population discovered in Terzan 5.