Intersection of two functions