Q:

Where have I gone wrong in finding the derivative of $2^{\sin x}$?

I was finding the derivative of $2^{\sin x}$.
My attempt $(1)$-
$$y=2^{\sin x}$$
$$\implies\ln y=\ln2^{\sin x}$$
$$\implies\log_ey=\ln2^{\sin x}$$
$$\displaystyle\implies e^{\ln2^{\sin x}}=y$$
$$\implies\frac{d}{dx}y=\frac{d}{dx}e^{\ln 2^{\sin x}}$$
Now,I know $\frac{d}{dx}e^x=e^x$ but what about $\frac{d}{dx}e^{\ln 2^{\sin x}}$.
How do I simplify it?
My attempt $(2)$-
$$2^{\sin x}=y$$
$$\log_2y=\sin x$$
$$\frac{d}{dx}\log_2y=\frac{d}{dx}\sin x$$
Now,I feel that chain rule can be used some how in the LHS to get $\frac{dy}{dx}$ which is our required derivative,but I am having trouble applying chain rule.
What to do?
Thanks a lot for any help!!

A:

I feel like it will be easier to go off of Attempt 1, so I'm going to do that:
$$\frac{dy}{dx}=\frac{d}{dx}e^{\ln 2^{\sin x}}$$
Now, we know that $\ln2^{\sin x}=\sin x\ln 2$, so make the substitution:
$$\frac{dy}{dx}=\frac{d}{dx}e^{\sin x\ln 2}$$
At this point, we have the right-side function in the form of $e^{g(x)}$ where $g(x)=\sin x\ln 2$. This means we can use chain rule:
$$\frac{dy}{dx}=\frac{d}{dg}e^{g(x)}\frac{d}{dx}\left(\sin x \ln 2\right)$$
It is a common identity that $\frac{d}{dg}e^{g(x)}=e^{g(x)}$. Also, it is a common identity that $\frac{d}{dx}\sin x=\cos x$, so we can use constant multiplication rule to get that $\frac{d}{dx}\left(\sin x \ln 2\right)=\ln 2\cdot \cos x$:
$$\frac{dy}{dx}=e^{g(x)}\ln 2\cdot \cos x$$
Finally, substitute back in $g(x)=\sin x\ln 2$:
$$\frac{dy}{dx}=e^{\sin x\ln 2}\ln 2\cdot \cos x$$
Now, to finish it off, we need to simplify. Note that $e^{\sin x \ln 2}=\left(e^{\ln 2}\right)^{\sin x}=2^{\sin x}$:
$$\frac{dy}{dx}=2^{\sin x}\ln 2\cdot \cos x$$

