<s>[INST] Evaluating $ \int \frac{1}{\sin x} dx $ Verify the identity
$$\sin x = \frac {2 \tan\frac{x}{2}}{1 + \tan^2\frac{x}{2}}$$
Use this identity and the substitution $t = \tan\frac{x}{2}$ to evaluate the integral of $$ \int \frac{1}{\sin x} dx $$
My answer:
$$ A = \frac{x}{2} \Rightarrow \sin 2A= \frac{2\tan A}{1+\tan^2 A} = \frac{2\tan A}{\sec^2 A} = 2 \tan A\cos^2 A = 2 \sin A \cos A = \sin 2A $$
Since $x=A/2$, $\sin 2A = \sin x$
Let $t=\tan \frac{x}{2}$
$$ \int \frac{1}{\sin x} dx = \int \frac{2t}{1+t^2} dt $$ 
Let $u= 1+t^2$, $ du = 2t\,dt$
$$\int \frac{2t}{1+t^2} dt = \int \frac{2t}{u}\cdot\frac{1}{2t} du = \int \frac{1}{u} \,du = \ln u + C \\ = \ln(1+t^2) + C = \ln\left(1+\tan^2 \frac{x}{2} \right) + C $$
Then what do I do?
How do I show this is equal to $-\cos x + C$ ? 
 [/INST] Since $t=\tan \frac{x}{2}, \tan^{-1}t=\frac{x}{2}, x=2\tan^{-1}t$, and $dx=\frac{2}{1+t^2}dt$.
Then $\displaystyle\int\frac{1}{\sin x} dx=\int\frac{1+t^2}{2t}\cdot\frac{2}{1+t^2}dt=\int\frac{1}{t}dt=\ln|t|+C=\ln\left|\tan\frac{x}{2}\right|+C$
</s>