If $y=\frac{\cos x+\sin x}{\cos x-\sin x}$, show that $\frac{d y}{d x}=\sec ^{2}\left(x+\frac{\pi}{4}\right)$
Let $y=\frac{\cos x+\sin x}{\cos x-\sin x}, u=\cos x+\sin x, v=\cos x-\sin x$
Formula:
$\frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}=\cos \mathrm{x}$ and $\frac{\mathrm{d}(\cos \mathrm{x})}{\mathrm{dx}}=-\sin \mathrm{x}$
According to the quotient rule of differentiation
If $y=\frac{u}{v}$
$\mathrm{dy} / \mathrm{dx}=\frac{\mathrm{v} \times \frac{\mathrm{du}}{\mathrm{dx}}-\mathrm{u} \times \frac{\mathrm{dv}}{\mathrm{dx}}}{\mathrm{v}^{2}}$
$=\frac{(\cos x-\sin x) \times(-\sin x+\cos x)-(\cos x+\sin x) \times(-\sin x-\cos x)}{(\cos x-\sin x)^{2}}$
$=\frac{(\cos x-\sin x)^{2}+(\cos x+\sin x)^{2}}{(\cos x-\sin x)^{2}}$
$=\frac{\left(\cos ^{2} x+\sin ^{2} x-2 \cos x \sin x\right)+\left(\cos ^{2} x+\sin ^{2} x+2 \cos x \sin x\right)}{(\cos x-\sin x)^{2}}$
$=\frac{2\left(\cos ^{2} x+\sin ^{2} x\right)}{(\cos x-\sin x)^{2}}$
$=\frac{(1)}{(\cos x-\sin x)^{2} / 2}\left(\cos ^{2} x+\sin ^{2} x\right)=1$
$=\frac{1}{\left(\frac{\cos x}{\sqrt{2}}-\frac{\sin x}{\sqrt{2}}\right)^{2}}$
$=\frac{1}{\left(\frac{\cos x \cos 45^{\circ}}{1}-\frac{\sin x \sin 45^{\circ}}{1}\right)^{2}}$
$=\frac{1}{\cos ^{2}\left(x+\frac{\pi}{4}\right)}[\cos a \cos b-\sin a \sin b=\cos (a+b)]$
$=\sec ^{2}\left(x+\frac{\pi}{4}\right)$
HENCE PROVED.