Variables

Variables[expr]
gives a list of the variables that appear in the polynomial expr.