Solving $\int \frac1{\cos x}\mathrm dx$ I'm trying to solve the following integral:

$$\int \frac1{\cos x}\mathrm dx$$

I know that $\int \cos x\mathrm dx$ = sin x, but I don't know how to proceed with $\frac1{\cos x}$.

Utilizing the given hint from greelious we get the following
$$I=\int \frac{\mathrm dx}{\cos x}=\int \frac{\cos x}{\cos^2 x}\mathrm dx=\int \frac{\cos x}{1-\sin^2 x}\mathrm dx$$
Now by the substitution $y=\sin x$ we further get
$$I=\int \frac{\cos x}{1-\sin^2 x}\mathrm dx\stackrel{y=\sin x}{=}\int \frac{\mathrm dy}{1-y^2}$$
This on can be done via partial fraction decomposition which gives us
$$I=\int \frac{\mathrm dy}{1-y^2}=\frac12\int \left(\frac1{1+y}+\frac1{1-y}\right)\mathrm dy=\frac12\log\left(\frac{1+y}{1-y}\right)+c$$
And now resubstitute $y=\sin(x)$ gives us
$$I=\frac12\log\left(\frac{1+y}{1-y}\right)+c=\frac12\log\left(\frac{1+\sin x}{1-\sin x}\right)+c$$

$$\therefore~I=\int\frac{\mathrm dx}{\cos x}=\frac12\log\left(\frac{1+\sin x}{1-\sin x}\right)+c$$

Moreover we can show that this solution equals the elegant one given by Rhys Hughes
$$\begin{align*}
&\color{red}{\frac12\log\left(\frac{1+\sin x}{1-\sin x}\right)}=\log\left(\sqrt{\frac{1+\cos \left(x-\frac\pi2\right)}{1-\cos\left(x-\frac\pi2\right)}}\right)=\log\left(\cot\left(\frac{x-\frac\pi2}{2}\right)\right)\\&=\log\left(\cot\left(\frac x2-\frac\pi4\right)\right)
=\log\left(\frac{1+\cot\frac x2}{1-\cot \frac x2}\right)=\log\left(\frac{\left(\cos\frac x2+\sin\frac x2\right)^2}{\cos^2 \frac x2-\sin^2\frac x2}\right)\\&=\log\left(\frac{1+2\sin\frac x2\cos\frac x2}{\cos x}\right)=\log\left(\frac{1+\sin x}{\cos x}\right)=\color{red}{\log(\sec x+\tan x)}
\end{align*}$$
