$$y = (\cos x)^{(\sin x)^x}$$
I'm not sure at all how to solve this problem. I know that the derivative of $a^x$ is $a^{x}ln(a)$. I know the derivative of $\cos(x)$ is $-\sin(x)$ and that the derivative of $\sin(x)$ is $\cos(x)$.
I assume that I start with $(\sin x)^x$. Will the derivative of that part be
$(\sin x)^{x}*\ln(\sin(x))*\cos(x)$
Does this rule work with the chain rule? Should I differentiate the $\ln(\sin(x))$ once more? I don't think so, but I'm quite confused, so a clarification would be nice.
This is the first problem which has so many "layers" and I'm not sure how to put the rest of the equation into the chain rule.
Thank you for the help.
You need a combination of chain rule as well as logarithmic differentiation. Let the function be denoted by $y = f(x)$ so that $$y = (\cos x)^{(\sin x)^{x}}$$ and on taking logs we get $$\log y = (\sin x)^{x}\log\cos x$$ Further taking logs gives us $$\log\log y = x\log\sin x + \log\log\cos x$$ and then we differentiate using chain rule to get $$\frac{1}{\log y}\cdot\frac{1}{y}\cdot\frac{dy}{dx} = \log \sin x + x\cot x + \frac{1}{\log \cos x}\cdot\frac{-\sin x}{\cos x}$$ and finally we get \begin{align} \frac{dy}{dx} &= y\log y\left(\log\sin x + x\cot x - \frac{\tan x}{\log\cos x}\right)\notag\\ &= (\cos x)^{(\sin x)^{x}}(\sin x)^{x}\log \cos x\left(\log\sin x + x\cot x - \frac{\tan x}{\log\cos x}\right)\notag\\ \end{align}
Update: Note that the method of logarithmic differentiation is symbolic and does not take care of fine details. It does produce the correct answer, but there is a subtle mistake in above argument.
First of all note that the function $y = f(x) = (\cos x)^{(\sin x)^{x}}$ is defined only when both $\sin x$ and $\cos x$ are positive which means that $x$ lies in the first quadrant (excluding end points of the quadrant). Even if we assume that the value of $x$ is in first quadrant then $\log \cos x$ is defined but already negative and hence taking a second log is not justified so that we can't have an expression like $\log\log\cos x$. The way out is to differentiate $\log y = (\sin x)^{x}\log \cos x$ using product rule taking $$u = (\sin x)^{x}, v = \log\cos x, \log y = uv$$ In order to proceed further we need find $\dfrac{du}{dx}$ and for that we take logs to get $\log u = x\log \sin x$ and on differentiating we get $$\frac{1}{u}\cdot\frac{du}{dx} = x\cot x + \log \sin x$$ or $$u' = \frac{du}{dx} = (\sin x)^{x}(x\cot x + \log \sin x)$$ We then have $$\frac{1}{y}\cdot\frac{dy}{dx} = uv' + u'v = (\sin x)^{x}(-\tan x) + (\sin x)^{x}(x\cot x + \log \sin x)\log\cos x$$ or $$\frac{dy}{dx} = y(\sin x)^{x}\log\cos x\left(x\cot x + \log \sin x - \frac{\tan x}{\log\cos x}\right)$$ and putting value of $y$ we get the same answer as before.