Find $\frac{d y}{d x}$, when
$y=x^{n}+n^{x}+x^{x}+n^{n}$
let $y=x^{n}+n^{x}+x^{x}+n^{n}$
$\Rightarrow y=a+b+c+m$
where $a=x^{n} ; b=n^{x} ; c=x^{x} ; m=n^{n}$
$\frac{d y}{d x}=\frac{d a}{d x}+\frac{d b}{d x}+\frac{d c}{d x}+\frac{d m}{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=x^{n}$
Taking log both the sides:
$\Rightarrow \log a=\log x^{n}$
$\Rightarrow \log a=n \log x$
$\left\{\log x^{a}=a \log x\right\}$
$\Rightarrow \log a=n \log x\{\log e=1\}$
Differentiating with respect to $x$ :
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{a})}{\mathrm{dx}}=\frac{\mathrm{d}(\mathrm{n} \log \mathrm{x})}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{a})}{\mathrm{dx}}=\mathrm{n} \frac{\mathrm{d}(\log \mathrm{x})}{\mathrm{dx}}$
$\left\{\right.$ Using chain rule, $\frac{\mathrm{d}(\mathrm{au})}{\mathrm{dx}}=\mathrm{a} \frac{\mathrm{du}}{\mathrm{dx}}$ where $\mathrm{a}$ is any constant and $\mathrm{u}$ is any variable $\}$
$\Rightarrow \frac{1}{a} \frac{d a}{d x}=n \times \frac{1}{x} \frac{d x}{d x}$
$\left\{\frac{\mathrm{d}(\log \mathrm{u})}{\mathrm{dx}}=\frac{1}{\mathrm{u}} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$
$\Rightarrow \frac{1}{\mathrm{a}} \frac{\mathrm{da}}{\mathrm{dx}}=\frac{\mathrm{n}}{\mathrm{x}}$
$\Rightarrow \frac{\mathrm{da}}{\mathrm{dx}}=\frac{\mathrm{an}}{\mathrm{x}}$
Put the value of $a=x^{n}$
$\frac{\mathrm{da}}{\mathrm{dx}}=\frac{\mathrm{n} \mathrm{x}^{\mathrm{n}}}{\mathrm{x}}$
$\frac{\mathrm{da}}{\mathrm{dx}}=\mathrm{n} \mathrm{x}^{\mathrm{n}-1}$
$\left\{\frac{d\left(u^{n}\right)}{d x}=n u^{n-1} \frac{d u}{d x}\right\}$
$b=n^{x}$
Taking log both the sides:
$\Rightarrow \log \mathrm{b}=\log n^{x}$
$\Rightarrow \log \mathrm{b}=x \log n$
$\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 \mathrm{n})}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{b})}{\mathrm{dx}}=\log \mathrm{n} \times \frac{\mathrm{dx}}{\mathrm{dx}}$
$\left\{\right.$ Using chain rule, $\frac{\mathrm{d}(\mathrm{au})}{\mathrm{dx}}=\mathrm{a} \frac{\mathrm{du}}{\mathrm{dx}}$ where $\mathrm{a}$ is any constant and $\mathrm{u}$ is any variable $\}$
$\Rightarrow \frac{1}{\mathrm{~b}} \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{b}(\log \mathrm{n})$
$\left\{\frac{\mathrm{d}(\log \mathrm{u})}{\mathrm{dx}}=\frac{1}{\mathrm{u}} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$
$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{b}(\log \mathrm{n})$
Put the value of $b=n^{x}$ :
$\Rightarrow \frac{\mathrm{db}}{\mathrm{dx}}=\mathrm{n}^{\mathrm{x}}(\log \mathrm{n})$
$\mathrm{c}=\mathrm{x}^{\mathrm{x}}$
Taking log both the sides:
$\Rightarrow \log c=\log x^{x}$
$\Rightarrow \log c=x \log x$
$\left\{\log x^{a}=\operatorname{alog} x\right\}$
Differentiating with respect to $\mathrm{x}$ :
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{c})}{\mathrm{dx}}=\frac{\mathrm{d}(\mathrm{x} \log \mathrm{x})}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{d}(\log \mathrm{c})}{\mathrm{dx}}=\mathrm{x} \times \frac{\mathrm{d}(\log \mathrm{x})}{\mathrm{dx}}+\log \times \times \frac{\mathrm{dx}}{\mathrm{dx}}$
$\left\{\right.$ Using product rule, $\left.\frac{\mathrm{d}(\mathrm{uv})}{\mathrm{dx}}=\mathrm{u} \frac{\mathrm{d} \mathrm{v}}{\mathrm{dx}}+\mathrm{v} \frac{\mathrm{du}}{\mathrm{dx}}\right\}$
$\Rightarrow \frac{1}{c} \frac{d c}{d x}=x \times \frac{1}{x} \frac{d x}{d x}+\log x$
$\left\{\frac{d(\log u)}{d x}=\frac{1}{u} \frac{d u}{d x}\right\}$
$\Rightarrow \frac{1}{c} \frac{d c}{d x}=1+\log x$
$\Rightarrow \frac{d c}{d x}=c\{1+\log x\}$
Put the value of $c=x^{x}$
$\Rightarrow \frac{\mathrm{dc}}{\mathrm{dx}}=\mathrm{x}^{\mathrm{x}}\{1+\log \mathrm{x}\}$
$\mathrm{m}=\mathrm{n}^{\mathrm{n}}$
$\Rightarrow \frac{\mathrm{dm}}{\mathrm{dx}}=\frac{\mathrm{d}\left(\mathrm{n}^{\mathrm{n}}\right)}{\mathrm{dx}}$
$\Rightarrow \frac{\mathrm{dm}}{\mathrm{dx}}=0$
$\left\{\frac{d u}{d x}=0\right.$ if $u$ is any contant $\}$
$\frac{\mathrm{dy}}{\mathrm{dx}}=\frac{\mathrm{da}}{\mathrm{dx}}+\frac{\mathrm{db}}{\mathrm{dx}}+\frac{\mathrm{dc}}{\mathrm{dx}}+\frac{\mathrm{dm}}{\mathrm{dx}}$
$\Rightarrow \frac{d y}{d x}=n x^{n-1}+n^{x}(\log n)+x^{x}\{1+\log x\}+0$
$\Rightarrow \frac{d y}{d x}=n x^{n-1}+n^{x}(\log n)+x^{x}\{1+\log x\}$