Showing that $\int_0^{\pi/3}\frac{1}{1-\sin x}\,\mathrm dx=1+\sqrt{3}$ 
Show that $$\int_0^{\pi/3}\frac{1}{1-\sin x}\,\mathrm dx=1+\sqrt{3}$$

Using the substitution $t=\tan\frac{1}{2}x$
$\frac{\mathrm dt}{\mathrm dx}=\frac{1}{2}\sec^2\frac{1}{2}x$
$\mathrm dx=2\cos^2\frac{1}{2}x\,\mathrm dt$
$=(2-2\sin^2\frac{1}{2}x)\,\mathrm dt$ 
How do you get this in the form of $t$ instead of $x$ using $\sin A=\dfrac{2t}{1+t^2}$ ?
$$=\int_0^{1/\sqrt3}\frac{2-2\sin^2\frac{1}{2}x}{1-\frac{2t}{1+t^2}}\mathrm dt\,??$$
 A: I think you mean
$$\int_0^{\pi/3} \frac{dx}{1-\sin{x}}$$
which may be accomplished using the substitution $t=\tan{\frac{x}{2}}$.  Then
$$dt = \frac12 \sec^2{\frac{x}{2}} dx= \frac12 (1+\tan^2{\frac{x}{2}}) dx = \frac12(1+t^2) dx$$
so that $dx = 2 dt/(1+t^2)$  Also
$$t^2=\frac{1-\cos{x}}{1+\cos{x}} \implies \cos{x} = \frac{1-t^2}{1+t^2} \implies \sin{x} = \frac{2 t}{1+t^2} $$
so that
$$1-\sin{x} = \frac{1+t^2-2 t}{1+t^2} = \frac{(1-t)^2}{1+t^2}$$
Then the integral is
$$2 \int_0^{1/\sqrt{3}} \frac{dt}{1+t^2} \frac{1+t^2}{(1-t)^2} = 2 \left [ \frac{1}{1-t}\right]_0^{1/\sqrt{3}} = 1+\sqrt{3} $$
A: I'd just use the identity $\dfrac 1{1-\sin x}=\dfrac{1+\sin x}{1-\sin^2x}=\dfrac{1+\sin x}{\cos^2x}=\sec^2x+\sec x\tan x$.
A: The Weierstrass substitution sets $t = \tan \frac{x}{2}$ and it's possible that's what you mean to do. In that case, $$\frac{\mathrm{d}t}{\mathrm{d}x} = \frac{1}{2} \mathrm{sec}^2 \frac{x}{2} = \frac{1}{2} (1 + \tan^2 \frac{x}{2}) = \frac{1 + t^2}{2}$$ which gives you $$\mathrm{d}x = \frac{2}{1+t^2} \mathrm{d}t.$$
