Proving a trigonometric identity: $\frac{\cos x}{1-\sin x} -\tan x = \sec x$

I am trying to prove a trig identity that is confusing me. The identity is $$\frac{\cos(x)}{(1-\sin(x))}-\tan(x)=\sec(x)$$ Here is my attempt.

I did $$\frac{\cos(x)}{(1-\sin^2(x))}=\frac{\cos(x)}{\cos^2(x)}=\frac{1}{\cos(x)}=\sec(x)=(\sec(x)+\tan(x))(1+\sin(x))\\\sec(x)=\sec(x)+\sec(x)\sin(x)+\tan(x)+\tan(x)\sin(x)\\0=\tan(x)+\tan(x)+\tan(x)\sin(x)$$ but this does not make sense to me. Can somebody please help me with this thing?


Solution 1:

For fun, I found a "trigonograph" of this identity (for acute $\theta$).

In the diagram, $\overline{AB}$ is tangent to the unit circle at $P$. The "trig lengths" (except for $|\overline{AQ}|$) should be clear.

enter image description here

We note that $\angle BPR \cong \angle RPP^\prime$, since these inscribed angles subtend congruent arcs $\stackrel{\frown}{PR}$ and $\stackrel{\frown}{RP^\prime}$. Very little angle chasing gives that $\triangle APQ$ is isosceles, with $\overline{AP} \cong \overline{AQ}$ (justifying that last trig length). Then, $$\triangle SPR \sim \triangle OQR \implies \frac{|\overline{SP}|}{|\overline{SR}|} = \frac{|\overline{OQ}|}{|\overline{OR}|} \implies \frac{\cos\theta}{1-\sin\theta} = \frac{\sec\theta+\tan\theta}{1}$$

Solution 2:

We have
$$\begin{align}\frac{\cos x}{1-\sin x}-\tan x & = \frac{\cos x}{1-\sin x}-\frac{\sin x}{\cos x} \\[1.5ex] & =\frac{\cos^2 x-\sin x(1-\sin x)}{\cos x(1-\sin x)} \\[1.5ex] & =\frac{\cos^2 x+\sin^2 x-\sin x}{\cos x(1-\sin x)} \\[1.5ex] & =\frac{1-\sin x}{\cos x(1-\sin x)} \\[1.5ex] & =\frac{1}{\cos x} \\[2.8ex] & =\sec x\end{align}$$