Answer
The formula
$$\sec x = \frac{\sin x}{\cos x}+\frac{\cos x}{1+\sin x}$$
is indeed true.
It is used to calculate that
$$\int \sec x dx =\ln|\sec x+\tan x|+c.$$
Work Step by Step
First, we will derive this rule. It is easier to start from the right side and show that it is equal to the left side
$$RS=\frac{\sin x}{\cos x}+\frac{\cos x}{1+\sin x} = \frac{\sin x(1+\sin x)}{\cos x (1+\sin x)}+ \frac{\cos^2 x}{\cos x(1+\sin x)}.$$
This gives
$$RS = \frac{\sin x(1+\sin x) + \cos^2 x}{\cos x(1+\sin x)} = \frac{\sin x+\sin^2 x+\cos^2 x}{\cos x(1+\sin x)} = \frac{\sin x+1}{\cos x (1+\sin x)},$$
where we used $\sin^2 x+\cos^2x=1.$ Now dividign both the denominator and the numerator by $1+\sin x$ we get
$$RS=\frac{1}{\cos x} = \sec x$$
which is equal to the left side so we derived the formula.
Now the integral is
$$\int \sec x dx = \int \left(\frac{\sin x}{\cos x}+\frac{\cos x}{1+\sin x}\right) dx =\int \frac{\sin x}{\cos x} dx + \int \frac{\cos x}{1+\sin x} = \int \tan x dx +\int\frac{\cos x}{1+\sin x}dx.$$
The first integral is read directly from the table of integrals
$$\int\tan x dx = -\ln|\cos x|+c_1.$$
The second integral can be solved using substitution $t=1+\sin x$ and by differentiating $dt=(1+\sin x)'dx=\cos x dx.$ Putting this into the second integral we have
$$\int \frac{\cos x}{1+\sin x}dx = \int\frac{dt}{t} =\ln|t|+c_1 =\ln|1+\sin x|+c_2,$$
where in the end we expressed the substitution $t$ in terms of $x$ again.
The initial integral is now
$$\int\sec x dx = -\ln |\cos x|+c_1+\ln|1+\sin x| +c_2 = \ln\frac{|1+\sin x|}{|\cos x|}+c,$$
where we simply denoted $c=c_1+c_2$ the new arbitrary constant $c$. Now we will just transform the previous expression to get the formula from the problem:
$$\int\sec x dx = \ln\frac{|1+\sin x|}{|\cos x|}+c = \ln\left|\frac{1+\sin x}{\cos x}\right|+c= \ln\left|\frac{1}{\cos x}+\frac{\sin x}{\cos x}\right|+c = \ln|\sec x +\tan x| +c. $$
Where we used that $\frac{1}{\cos x}=\sec x$ and $\frac{\sin x}{\cos x} = \tan x.$