# Differentiate the following functions with respect to x :

Question:

Differentiate the following functions with respect to $x$ :

$(\cos x)^{x}+(\sin x)^{1 / x}$

Solution:

Let $y=(\cos x)^{x}+(\sin x)^{\frac{1}{x}}$

$\Rightarrow y=a+b$

where $a=(\cos x)^{x} ; b=(\sin x)^{\frac{1}{x}}$

$\frac{d y}{d x}=\frac{d a}{d x}+\frac{d b}{d x}$

$\left\{\right.$ Using chain rule, $\frac{\mathrm{d}(\mathrm{u}+\mathrm{a})}{\mathrm{dx}}=\frac{\mathrm{du}}{\mathrm{dx}}+\frac{\mathrm{da}}{\mathrm{dx}}$ where $\mathrm{a}$ and $\mathrm{u}$ are any variables $\}$

$a=(\cos x)^{x}$

Taking log both the sides:

$\Rightarrow \log a=\log (\cos x)^{x}$

$\Rightarrow \log a=x \log (\cos x)$

$\left\{\log x^{a}=\operatorname{alog} x\right\}$

Differentiating with respect to $\mathrm{x}$ :

$\Rightarrow \frac{\mathrm{d}(\log \mathrm{a})}{\mathrm{dx}}=\frac{\mathrm{d}(\mathrm{x} \log (\cos \mathrm{x}))}{\mathrm{dx}}$

$\Rightarrow \frac{\mathrm{d}(\log \mathrm{a})}{\mathrm{dx}}=\mathrm{x} \times \frac{\mathrm{d}(\log (\cos \mathrm{x}))}{\mathrm{dx}}+\log (\cos \mathrm{x}) \times \frac{\mathrm{dx}}{\mathrm{dx}}$

$\left\{\right.$ Using product rule, $\left.\frac{\mathrm{d}(\mathrm{uv})}{\mathrm{dx}}=\mathrm{u} \frac{\mathrm{dv}}{\mathrm{dx}}+\mathrm{v} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$

$\Rightarrow \frac{1}{a} \frac{d a}{d x}=x \times \frac{1}{\cos x} \frac{d(\cos x)}{d x}+\log (\cos x)$

$\left\{\frac{\mathrm{d}(\log \mathrm{u})}{\mathrm{dx}}=\frac{1}{\mathrm{u}} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$

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

$\left\{\frac{d(\cos x)}{d x}=-\sin x\right\}$

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

$\Rightarrow \frac{d a}{d x}=a\{-x \tan x+\log (\cos x)\}$

Put the value of $a=(\cos x)^{x}:$

$\Rightarrow \frac{\mathrm{da}}{\mathrm{dx}}=(\cos \mathrm{x})^{\mathrm{x}}\{-\mathrm{x} \tan \mathrm{x}+\log (\cos \mathrm{x})\}$

$b=(\sin x)^{\frac{1}{x}}$

Taking log both the sides:

$\Rightarrow \log \mathrm{b}=\log (\sin \mathrm{x})^{\frac{1}{\mathrm{x}}}$

$\Rightarrow \log \mathrm{b}=\frac{1}{\mathrm{x}} \log (\sin \mathrm{x})\left\{\log x^{\mathrm{a}}=\operatorname{alog} x\right\}$

Differentiating with respect to $\mathrm{x}$ :

$\Rightarrow \frac{\mathrm{d}(\log \mathrm{b})}{\mathrm{dx}}=\frac{\mathrm{d}\left(\frac{1}{\mathrm{x}} \log (\sin \mathrm{x})\right)}{\mathrm{dx}}$

$\Rightarrow \frac{\mathrm{d}(\log \mathrm{b})}{\mathrm{dx}}=\frac{1}{\mathrm{x}} \times \frac{\mathrm{d}(\log (\sin \mathrm{x}))}{\mathrm{dx}}+\log (\sin \mathrm{x}) \times \frac{\mathrm{d}\left(\mathrm{x}^{-1}\right)}{\mathrm{dx}}$

$\left\{\right.$ Using product rule, $\left.\frac{\mathrm{d}(\mathrm{uv})}{\mathrm{dx}}=\mathrm{u} \frac{\mathrm{dv}}{\mathrm{dx}}+\mathrm{v} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$

$\Rightarrow \frac{1}{b} \frac{d b}{d x}=\frac{1}{x} \times \frac{1}{\sin x} \frac{d(\sin x)}{d x}+\log (\sin x)\left(-x^{-2}\right)$

$\left\{\frac{\mathrm{d}\left(\mathrm{u}^{\mathrm{n}}\right)}{\mathrm{dx}}=\mathrm{nu}^{\mathrm{n}-1} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$

$\Rightarrow \frac{1}{b} \frac{d b}{d x}=\frac{1}{x \sin x}(\cos x)-\frac{\log (\sin x)}{x^{2}}$

$\left\{\frac{d(\sin x)}{d x}=\cos x\right\}$

$\Rightarrow \frac{1}{b} \frac{d b}{d x}=\frac{\cos x}{x \sin x}-\frac{\log (\sin x)}{x^{2}}$

$\Rightarrow \frac{d b}{d x}=b\left\{\frac{\cot x}{x}-\frac{\log (\sin x)}{x^{2}}\right\}$

Put the value of $b=(\sin x)^{\frac{1}{x}}$ :

$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=(\sin \mathrm{x})^{\frac{1}{\mathrm{x}}}\left\{\frac{\cot \mathrm{x}}{\mathrm{x}}-\frac{\log (\sin \mathrm{x})}{\mathrm{x}^{2}}\right\}$

$\frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{da}}{\mathrm{dx}}+\frac{\mathrm{db}}{\mathrm{dx}}$

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