Analytical solutions to rotating functionally graded hollow and solid long cylinders are developed. Young's modulus and material density of the cylinder are assumed to vary exponentially in the radial direction, and Poisson's ratio is assumed to be constant. A unified governing equation is derived from the equilibrium equations, compatibility equation, deformation theory of elasticity and the stress-strain relationship. The governing second-order differential equation is solved in terms of a hypergeometric function for the elastic deformation of rotating functionally graded cylinders. Dependence of stresses in the cylinder on the inhomogeneous parameters, geometry and boundary conditions is examined and discussed. The proposed solution is validated by comparing the results for rotating functionally graded hollow and solid cylinders with the results for rotating homogeneous isotropic cylinders. In addition, a viscoelastic solution to the rotating viscoelastic cylinder is presented, and dependence of stresses in hollow and solid cylinders on the time parameter is examined.