Differentiate $\sqrt{\frac{1 +\sin x}{1 -\sin x}}$

Why make things complicated if there is a easy way? By the half-angle formulae we obtain

$$\sqrt{\frac{1-\sin(x)}{1+\sin(x)}}=\sqrt{\frac{1-\cos\left(x+\frac\pi2\right)}{1+\cos\left(x+\frac\pi2\right)}}=\tan\left(\frac x2-\frac\pi4\right)$$

And I suppose you can differentiate the tangent function ;)


As pointed out by Simply Beautiful Art and mathcounterexamples.net by using the half-angle formula we ran into serious issus concerning the sign.


Logarithmic differentiation makes things easier $$y=\sqrt{\dfrac{1 +\sin (x)}{1 -\sin (x)}}\implies \log(y)=\frac 12 \left(\log(1+\sin(x)) -\log(1-\sin(x))\right)$$ $$\frac {y'}{y}=\frac 12 \left(\frac{\cos(x)}{1+\sin(x) }+\frac{\cos(x)}{1-\sin(x) }\right)$$ Simplify as much as you can and, when finished, use $$y'=y\times \frac {y'}{y}$$


Alternatively, using the product rule: $$\begin{align}\left(\sqrt{\dfrac{1 +\sin x}{1 -\sin x}}\right)' &=(\sqrt{1+\sin x})'\cdot (1-\sin x)^{-1/2}+\sqrt{1+\sin x}\cdot ((1-\sin x)^{-1/2})'=\\ &=\frac{\cos x}{2\sqrt{1+\sin x}}\cdot \frac1{\sqrt{1-\sin x}}+\sqrt{1+\sin x}\cdot \frac{\cos x}{2(1-\sin x)\sqrt{1-\sin x}}=\\ &=\frac{\cos x}{2\sqrt{\cos ^2x}}+\frac{\cos x\sqrt{(1+\sin x)^2}}{2(1-\sin x)\sqrt{1-\sin ^2x}}=\\ &=\frac12+\frac{1+\sin x}{2(1-\sin x)}=\\ &=\frac1{1-\sin x}=\cdots =\\ &=\frac{1}{2}\sec^2\left(\frac{\pi}{4}+\frac{{x}}{2}\right)\end{align}$$ Can you show the equality of the last two expressions using what you stated you know?

Answer (see the hidden area):

$$\frac1{1-\sin x}=\frac{1}{\sin^2x+\cos^2x-2\sin \frac{x}{2}\cos \frac{x}{2}}=\frac{1}{(\sin \frac x2-\cos \frac x2)^2}=\\=\frac{1}{2(\frac{1}{\sqrt{2}}\sin \frac x2-\frac{1}{\sqrt{2}}\cos \frac x2)^2}=\frac{1}{2\cos^2(\frac{\pi}{4}+\frac x2)}=\frac12\sec^2(\frac{\pi}{4}+\frac x2).$$