Implement algebraic methods to find the domain of a composite function.