<s>[INST] Trig Identity Proof $\frac{1 + \sin\theta}{\cos\theta} + \frac{\cos\theta}{1 - \sin\theta} = 2\tan\left(\frac{\theta}{2} + \frac{\pi}{4}\right)$ I've been working on this for like half an hour now and don't seem to be getting anywhere. I've tried using the double angle identity to write the LHS with $\theta/2$ and have tried expanding the RHS as a sum. The main issue I'm having is working out how to get a $\pi$ on the LHS or removing it from the right to equate the two sides. 
$$\frac{1 + \sin\theta}{\cos\theta} + \frac{\cos\theta}{1 - \sin\theta} = 2\tan\left(\frac{\theta}{2} + \frac{\pi}{4}\right)$$
 [/INST] Set $\theta=\pi/2-x$, so the left-hand side becomes
$$
\frac{1+\cos x}{\sin x}+\frac{\sin x}{1-\cos x}
$$
Now recall that
$$
\tan\frac{x}{2}=\frac{\sin x}{1+\cos x}=
\frac{1-\cos x}{\sin x}
$$
so the left-hand side is actually
$$
2\cot\frac{x}{2}=2\tan\Bigl(\frac{\pi}{2}-\frac{x}{2}\Bigr)=
2\tan\Bigl(\frac{\pi}{2}+\frac{\theta}{2}-\frac{\pi}{4}\Bigr)
$$
</s>