Find $\frac{d y}{d x}$, when
$y=(\sin x)^{\cos x}+(\cos x)^{\sin x}$
let $y=(\sin x)^{\cos x}+(\cos x)^{\sin x}$
$\Rightarrow y=a+b$
where $a=(\sin x)^{\cos x} ; b=(\cos x)^{\sin x}$
$\frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{da}}{\mathrm{dx}}+\frac{\mathrm{db}}{\mathrm{dx}}$
$\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 a and $\mathrm{u}$ are any variables $\}$
$a=(\sin x)^{\cos x}$
Taking log both the sides:
$\Rightarrow \log a=\log (\sin x)^{\cos x}$
$\Rightarrow \log a=\cos x \log (\sin 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}(\cos \mathrm{x} \log (\sin \mathrm{x}))}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{a})}{\mathrm{dx}}=\cos \mathrm{x} \times \frac{\mathrm{d}(\log (\sin \mathrm{x}))}{\mathrm{dx}}+\log (\sin \mathrm{x}) \times \frac{\mathrm{d}(\cos \mathrm{x})}{\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}{\mathrm{a}} \frac{\mathrm{da}}{\mathrm{dx}}=\cos \mathrm{x} \times \frac{1}{\sin \mathrm{x}} \frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}+\log (\sin \mathrm{x})(-\sin \mathrm{x})$
$\left\{\frac{\mathrm{d}(\log \mathrm{u})}{\mathrm{dx}}=\frac{1}{\mathrm{u}} \frac{\mathrm{du}}{\mathrm{dx}} ; \frac{\mathrm{d}(\cos \mathrm{x})}{\mathrm{dx}}=-\sin \mathrm{x} ; \frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}=\cos \mathrm{x}\right\}$
$\Rightarrow \frac{1}{b} \frac{d b}{d x}=\tan x(-\sin x)+\cos x \log (\cos x)$
$\Rightarrow \frac{d b}{d x}=b\{-\sin x \tan x+\cos x \log (\cos x)\}$
Put the value of $b=(\cos x)^{\sin x}$ :
$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=(\cos \mathrm{x})^{\sin \mathrm{x}}\{\cos \mathrm{x} \log (\cos \mathrm{x})-\sin \mathrm{x} \tan \mathrm{x}\}$
$\frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{da}}{\mathrm{dx}}+\frac{\mathrm{db}}{\mathrm{dx}}$
$\Rightarrow \frac{d y}{d x}=(\sin x)^{\cos x}\{\cos x \cot x-\sin x \log (\sin x)\}+(\cos x)^{\sin x}\{\cos x \log (\cos x)$
$-\sin x \tan x\}$