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)$$
 A: hint:
\begin{align}
& \cos\theta = \cos^2(\theta /2) - \sin^2(\theta/2)= (\cos (\theta/2) +\sin (\theta/2))(\cos (\theta/2) - \sin (\theta/2)), \\[10pt]
& 1 \pm\sin \theta = (\cos (\theta/2) \pm \sin(\theta/2))^2.
\end{align}
A: Let $\dfrac\theta2+\dfrac\pi4=y\implies\theta=2y-\dfrac\pi2$
$$\sin\theta=\cdots=-\cos2y,\cos\theta=\cdots=\sin2y$$
$$\dfrac{1+\sin\theta}{\cos\theta}=\dfrac{1-\cos2y}{\sin2y}=\dfrac{2\sin^2y}{2\sin y\cos y}=?$$
$$\dfrac{\cos\theta}{1-\sin\theta}=\dfrac{\sin2y}{1+\cos2y}=?$$
See also : Solve $\frac{\cos x}{1+\sin x} + \frac{1+\sin x}{\cos x} = 2$,
A: 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)
$$
A: LHS:
$$\frac{(1 + \sin\theta)(1-\sin\theta)}{\cos\theta(1-\sin\theta)} + \frac{\cos\theta}{1 - \sin\theta} = \frac{2\cos\theta}{1 - \sin\theta}.$$
RHS:
$$2\tan\left(\frac{\theta}{2} + \frac{\pi}{4}\right)=2\frac{\frac{\sin\frac{\theta}{2}}{\cos\frac{\theta}{2}}+1}{1-\frac{\sin\frac{\theta}{2}}{\cos\frac{\theta}{2}}}=2\frac{\sin\frac{\theta}{2}+\cos\frac{\theta}{2}}{\cos\frac{\theta}{2}-\sin\frac{\theta}{2}}=$$
$$2\frac{\left(\sin\frac{\theta}{2}+\cos\frac{\theta}{2}\right)\left(\cos\frac{\theta}{2}-\sin\frac{\theta}{2}\right)}{\left(\cos\frac{\theta}{2}-\sin\frac{\theta}{2}\right)^2}=\frac{2\cos\theta}{1 - \sin\theta}.$$
