I am currently working on an integral that I finally found the answer to after approaching differently, but I would like to know why my first approach failed -- it led to undefined trig functions and/or ln 0. As far as I can tell, by math logic is okay, unless I'm missing something.

$\displaystyle

\int_{0}^{\pi/2}\frac{cost}{1 + sint} dt

$

My initial approach was to multiply by $\displaystyle \frac{1 - sin t}{1 - sin t}$ leading to $\displaystyle \int\frac{cost(1 - sin t)}{1 - sin^2 t}$ and then to $\displaystyle \int\frac{cost(1 - sin t)}{cos^2 t}$ and then to $\displaystyle \int\frac{1 - sin t}{cos t}$. Rewriting, $\displaystyle \int_{0}^{\pi/2}\frac{1}{cos t} dt - \int_{0}^{\pi/2}tan t dt$. This leads to $\displaystyle \int_{0}^{\pi/2}sec t dt - \int_{0}^{\pi/2}tan t dt$. But when I attempted to integrate, it failed. Simple u-subst. works u = 1 + sint,

du = cost dt, but why does the other approach fail?