The Waring problem for Lie groups and Chevalley groups