the IF has simply to do with not making the fraction undefined, that'd happen if it its denominator ever becomes 0, we can always check that with say y + 2 = 0, y = -2.
so that results holds true only IF "y" is never -2, because if "y" becomes -2, we'd have a denominator of (-2) + 2 = 0 and the fraction will become undefined, which you can write y ≠ -2, or -2 < y < -2.