Verify $\int\sec x\ dx=\frac12 \ln \left\lvert\frac{1+\sin x}{1-\sin x}\right\rvert + C$ Question says it all, how can I verify the following? 
$$\int\sec x\ dx=\frac12 \ln \left|\frac{1+\sin x}{1-\sin x}\right| + C$$

You can verify this by integrating $\sec (x)$ and applying some trig identities: 
\begin{align}
\displaystyle
LHS &=
\int \sec(x) \; \mathrm{d}x \\
&= \int \sec(x) \left ( \frac{\sec (x) + \tan (x)}{\sec (x) + \tan (x)} \right ) \; \mathrm{d}x \\
&= \int  \frac{\sec^2 (x) + \sec (x) \tan (x)}{\sec (x) + \tan (x)} \; \mathrm{d}x \\
&= \int \frac{1}{u} \; \mathrm{d}u \tag{using $u=\sec (x) + \tan (x)$ as substitution} \\
&= \ln \left \lvert u \right \rvert + C \\
&= \ln \left \lvert \sec (x) + \tan (x) \right \rvert + C \\
&= \ln \left \lvert \frac{1+\sin (x)}{\cos (x)} \right \rvert + C \\
&= \ln \left \lvert \left ( \frac{\left (1+\sin (x) \right )^2}{\cos^2 (x)} \right )^{\frac{1}{2}}\right \rvert + C \\
&= \frac{1}{2} \ln \left \lvert \frac{\left (1+\sin (x) \right )^2}{\cos^2 (x)} \right \rvert + C \\
&= \frac{1}{2} \ln \left \lvert \frac{\left (1+\sin (x) \right )^2}{ 1- \sin^2 (x)} \right \rvert + C \\
&= \frac{1}{2} \ln \left \lvert \frac{\left (1+\sin (x) \right )^2}{\left ( 1- \sin (x) \right ) \left ( 1 + \sin (x) \right )} \right \rvert + C \\
&= \frac{1}{2} \ln \left \lvert \frac{1+\sin (x)}{ 1- \sin (x) } \right \rvert + C = RHS \tag*{Q.E.D.}
\end{align}
