Prove that $\int \sec x \, dx = \ln \left\vert\frac{1+\sin x}{1-\sin x}\right\vert^\frac{1}{2}+C = \ln \vert \sec x+\tan x\vert + C$ When our teachers give the rule 
$$\int \sec x \, dx = \ln \vert \sec x+\tan x\vert + C$$
We ignore the other solution when we say 
$$\sec x = \frac{1}{\cos x} = \frac{\cos x}{\cos^2 x} = \frac{\cos x}{1-\sin^2x} $$
 and multiply it by $2$ then integrate it we get this equation: 
$$\ln \left\lvert\frac{(1+\sin x)}{1-\sin x}\right\rvert^\frac{1}{2}+C$$
$$\int \sec x \, dx = \ln \left\lvert\frac{1+\sin x}{1-\sin x}\right\rvert^\frac{1}{2}+C = \ln \left\lvert \sec x+ \tan x\right\rvert + C$$
How that is possible? I don't know much about mathematics please keep it range of calculus 1-1.5.

You can also show they are the same using trigonometry:
$$\begin{aligned}\ln|\sec x+\tan x|
&=\ln\left\lvert\frac{1+\sin x}{\cos x}\right\rvert\\
&=\ln\left\lvert\frac{1+\sin x}{\sqrt{1-\sin^2x}}\right\rvert\\
&=\ln\left\lvert\frac{\sqrt{1+\sin x}}{\sqrt{1-\sin x}}\right\rvert\\
&=\ln\left\lvert\frac{1+\sin x}{1-\sin x}\right\rvert^{1/2}
\end{aligned}$$
