**Question:**

Differentiate the function with respect to *x*.

$x^{x}-2^{\sin x}$

**Solution:**

Let $y=x^{x}-2^{\sin x}$

Also, let $x^{x}=u$ and $2^{\sin x}=v$

$\therefore y=u-v$

$\Rightarrow \frac{d y}{d x}=\frac{d u}{d x}-\frac{d v}{d x}$

$u=x^{X}$

Taking logarithm on both the sides, we obtain

$\log u=x \log x$

Differentiating both sides with respect to *x*, we obtain

$\frac{1}{u} \frac{d u}{d x}=\left[\frac{d}{d x}(x) \times \log x+x \times \frac{d}{d x}(\log x)\right]$

$\Rightarrow \frac{d u}{d x}=u\left[1 \times \log x+x \times \frac{1}{x}\right]$

$\Rightarrow \frac{d u}{d x}=x^{x}(\log x+1)$

$\Rightarrow \frac{d u}{d x}=x^{x}(1+\log x)$

$v=2^{\sin x}$

Taking logarithm on both the sides with respect to *x*, we obtain

$\log v=\sin x \cdot \log 2$

Differentiating both sides with respect to *x*, we obtain

$\frac{1}{v} \cdot \frac{d v}{d x}=\log 2 \cdot \frac{d}{d x}(\sin x)$

$\Rightarrow \frac{d v}{d x}=v \log 2 \cos x$

$\Rightarrow \frac{d v}{d x}=2^{\sin x} \cos x \log 2$

$\therefore \frac{d y}{d x}=x^{x}(1+\log x)-2^{\sin x} \cos x \log 2$

Click here to get exam-ready with eSaral

For making your preparation journey smoother of JEE, NEET and Class 8 to 10, grab our app now.