# Differentiate the following functions with respect to x :

Question:

Differentiate the following functions with respect to $x$ :

$\log \sqrt{\frac{1-\cos x}{1+\cos x}}$

Solution:

Let $y=\log \sqrt{\frac{1-\cos x}{1+\cos x}}$

On differentiating $y$ with respect to $x$, we get

$\frac{d y}{d x}=\frac{d}{d x}\left(\log \sqrt{\frac{1-\cos x}{1+\cos x}}\right)$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{d}}{\mathrm{dx}}\left[\log \left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{\frac{1}{2}}\right]$

We know $\frac{\mathrm{d}}{\mathrm{dx}}(\log \mathrm{x})=\frac{1}{\mathrm{x}}$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{\frac{1}{2}}} \frac{\mathrm{d}}{\mathrm{dx}}\left[\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{\frac{1}{2}}\right]$ [using chain rule]

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{-\frac{1}{2}} \frac{\mathrm{d}}{\mathrm{dx}}\left[\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{\frac{1}{2}}\right]$

We know $\frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{x}^{\mathrm{n}}\right)=\mathrm{n} \mathrm{x}^{\mathrm{n}-1}$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{-\frac{1}{2}} \frac{1}{2}\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{\frac{1}{2}-1} \frac{\mathrm{d}}{\mathrm{dx}}\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)$ [using chain rule]

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{-\frac{1}{2}}\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)^{-\frac{1}{2}} \frac{\mathrm{d}}{\mathrm{dx}}\left(\frac{1-\cos \mathrm{x}}{1+\cos \mathrm{x}}\right)$

$\Rightarrow \frac{d y}{d x}=\frac{1}{2}\left(\frac{1-\cos x}{1+\cos x}\right)^{-1} \frac{d}{d x}\left(\frac{1-\cos x}{1+\cos x}\right)$

$\Rightarrow \frac{d y}{d x}=\frac{1}{2}\left(\frac{1+\cos x}{1-\cos x}\right) \frac{d}{d x}\left(\frac{1-\cos x}{1+\cos x}\right)$

Recall that $\left(\frac{\mathrm{u}}{\mathrm{v}}\right)^{\prime}=\frac{\mathrm{vu}^{\prime}-\mathrm{uv}^{\prime}}{\mathrm{v}^{2}}$ (quotient rule)

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1+\cos \mathrm{x}}{1-\cos \mathrm{x}}\right)\left[\frac{(1+\cos \mathrm{x}) \frac{\mathrm{d}}{\mathrm{dx}}(1-\cos \mathrm{x})-(1-\cos \mathrm{x}) \frac{\mathrm{d}}{\mathrm{dx}}(1+\cos \mathrm{x})}{(1+\cos \mathrm{x})^{2}}\right]$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}$

$=\frac{1}{2}\left(\frac{1+\cos x}{1-\cos x}\right)\left[\frac{(1+\cos x)\left(\frac{d}{d x}(1)-\frac{d}{d x}(\cos x)\right)-(1-\cos x)\left(\frac{d}{d x}(1)+\frac{d}{d x}(\cos x)\right)}{(1+\cos x)^{2}}\right]$

We know $\frac{d}{d x}(\cos x)=-\sin x$ and derivative of a constant is 0 .

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1+\cos \mathrm{x}}{1-\cos \mathrm{x}}\right)\left[\frac{(1+\cos \mathrm{x})(0+\sin \mathrm{x})-(1-\cos \mathrm{x})(0-\sin \mathrm{x})}{(1+\cos \mathrm{x})^{2}}\right]$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1+\cos \mathrm{x}}{1-\cos \mathrm{x}}\right)\left[\frac{(1+\cos \mathrm{x}) \sin \mathrm{x}+(1-\cos \mathrm{x}) \sin \mathrm{x}}{(1+\cos \mathrm{x})^{2}}\right]$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1+\cos \mathrm{x}}{1-\cos \mathrm{x}}\right)\left[\frac{(1+\cos \mathrm{x}+1-\cos \mathrm{x}) \sin \mathrm{x}}{(1+\cos \mathrm{x})^{2}}\right]$

$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=\frac{1}{2}\left(\frac{1+\cos \mathrm{x}}{1-\cos \mathrm{x}}\right)\left[\frac{2 \sin \mathrm{x}}{(1+\cos \mathrm{x})^{2}}\right]$

$\Rightarrow \frac{d y}{d x}=\frac{\sin x}{(1-\cos x)(1+\cos x)}$

$\Rightarrow \frac{d y}{d x}=\frac{\sin x}{1-\cos ^{2} x}$

$\Rightarrow \frac{d y}{d x}=\frac{\sin x}{\sin ^{2} x}\left(\because \sin ^{2} \theta+\cos ^{2} \theta=1\right)$

$\Rightarrow \frac{d y}{d x}=\frac{1}{\sin x}$

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}}=\operatorname{cosec} \mathrm{x}$

Thus, $\frac{\mathrm{d}}{\mathrm{dx}}\left(\log \sqrt{\frac{1-\cos x}{1+\cos x}}\right)=\operatorname{cosecx}$