# Why do I have to do this during integration

I have an expression $$\int_0^\frac\pi2 \frac1{\sin x} dx$$ = $$\int_0^\frac\pi2 \frac{\sin x}{1-cos^2x} dx = |subs: t=cos x; dt = -sinx dx| = \int_1^0 \frac{-1}{1-t^2} dt = \int_0^1 \frac{\frac12}{1-t} + \frac{\frac12}{1+t}$$ why do I have to take -1 out of (1-t) and do $$\frac12[\ln\frac{1+t}{t-1}]_0^1$$ instead of $$\frac12[\ln(1-t^2)]_0^1$$ ?

-
It is very hard to read and understand what happens, can you please re-format it? (try to use \frac for fractions and \sin, \cos) – Dennis Gulko Nov 23 '12 at 15:49
Your integral does not converge. – Peter Phipps Nov 23 '12 at 16:01
I tried to format it all with \frac, but I wasn't able to do it all right. For example \frac1\sinx 'x' or 'inx' always fly somewhere else – user50222 Nov 23 '12 at 16:03
If you want to get $\frac{1}{\sin x+\ln x}$ you should type \frac{1}{\sin x+\ln x} – Dennis Gulko Nov 23 '12 at 17:05

If I understand correctly, then you ask why $\int\frac{1}{1-t}=-\ln(t-1)$ and not $\ln(1-t)$. This happens because if try to differentiate $\ln(1-t)$, you will get $\frac{-1}{1-t}$, since, in general $\ln(f)'=\frac{f'}{f}$.