Function to extract coeffcient for a given term
Basic solving rational expression exercise