Find $\frac{\mathrm{dy}}{\mathrm{dx}}$, when
$y=x^{\sin x}+(\sin x)^{x}$
let $y=x^{\sin x}+(\sin x)^{x}$
$\Rightarrow y=a+b$
where $a=x^{\sin x} ; b=(\sin x)^{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=x^{\sin x}$
Taking log both the sides:
$\Rightarrow \log a=\log x^{\sin x}$
$\Rightarrow \log a=\sin x \log x$
$\left\{\log x^{a}=a \log x\right\}$
Differentiating with respect to $x$ :
$\Rightarrow \frac{\mathrm{d}(\log a)}{d x}=\frac{d(\sin x \log x)}{d x}$
$\Rightarrow \frac{d(\log a)}{d x}=\sin x \times \frac{d(\log x)}{d x}+\log x \times \frac{d(\sin x)}{d x}$
$\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}=\sin x \times \frac{1}{x} \frac{d x}{d x}+\log x(\cos x)$
$\left\{\frac{\mathrm{d}(\log \mathrm{u})}{\mathrm{dx}}=\frac{1}{\mathrm{u}} \frac{\mathrm{du}}{\mathrm{dx}} \& \frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}=\cos \mathrm{x}\right\}$
$\Rightarrow \frac{1}{a} \frac{d a}{d x}=\frac{\sin x}{x}+\log x \cos x$
$\Rightarrow \frac{d a}{d x}=a\left(\frac{\sin x}{x}+\log x \cos x\right)$
Put the value of $a=x^{\sin x}:$
$\Rightarrow \frac{\text { da }}{\text { dx }}=x^{\sin x}\left(\frac{\sin x}{x}+\log x \cos x\right)$
$b=(\sin x)^{x}$
Taking log both the sides:
$\Rightarrow \log b=\log (\sin x)^{x}$
$\Rightarrow \log b=x \log (\sin x)$
$\left\{\log x^{a}=\operatorname{alog} x\right\}$
Differentiating with respect to $\mathrm{x}$ :
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{b})}{\mathrm{dx}}=\frac{\mathrm{d}(\mathrm{x} \log (\sin \mathrm{x}))}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{b})}{\mathrm{dx}}=\mathrm{x} \times \frac{\mathrm{d}(\log (\sin \mathrm{x}))}{\mathrm{dx}}+\log (\sin \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}{\mathrm{~b}} \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{x} \times \frac{1}{\sin \mathrm{x}} \frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}+\log (\sin \mathrm{x})$
$\left\{\frac{\mathrm{d}(\sin \mathrm{x})}{\mathrm{dx}}=\cos \mathrm{x}\right\}$
$\Rightarrow \frac{1}{\mathrm{~b}} \frac{\mathrm{db}}{\mathrm{dx}}=\frac{\mathrm{x}}{\sin \mathrm{x}}(\cos \mathrm{x})+\log (\sin \mathrm{x})$
$\Rightarrow \frac{1}{\mathrm{~b}} \frac{\mathrm{db}}{\mathrm{dx}}=\frac{\mathrm{x} \cos \mathrm{x}}{\sin \mathrm{x}}+\log (\sin \mathrm{x})$
$\Rightarrow \frac{1}{\mathrm{~b}} \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{x} \cot \mathrm{x}+\log (\sin \mathrm{x})$
$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{b}\{\mathrm{x} \cot \mathrm{x}+\log (\sin \mathrm{x})\}$
Put the value of $b=(\sin x)^{x}$ :
$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=(\sin \mathrm{x})^{\mathrm{x}}\{\mathrm{x} \cot \mathrm{x}+\log (\sin \mathrm{x})\}$
$\frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{da}}{\mathrm{dx}}+\frac{\mathrm{db}}{\mathrm{dx}}$
$\Rightarrow \frac{d y}{d x}=x^{\sin x}\left(\frac{\sin x}{x}+\log x \cos x\right)+(\sin x)^{x}\{x \cot x+\log (\sin x)\}$