complex analysis can be used to find residues