Chemical analysis of polymers