Recall that cos^2(y)=1-sin^2(y) by the Pythagorean identity sin^2(y) + cos^2(y) =1. Then using the formula a^2-b^2=(a-b)(a+b), we have 1-sin^2(y)=1^2-sin^2(y)=(1-sin(y))(1+sin(y)). Therefore
cos^2(y)/(1-sin(y)) = (1-sin(y))(1+sin(y))/(1-sin(y)) = 1+sin(y).
As a result, int(cos^2(y)/(1-sin(y)) = int(1+sin(y)) = int(1) + int(sin(y)) = y-cos(y) +C.