TITLE: Find the derivative of the following function w.r.t $x:$ $y=(\sin x)^{(\cos x)^{(\cos x)^{(\cos x)^{\cdots\infty}}}}$
QUESTION [7 upvotes]: Find $\frac{dy}{dx},$ if
$y=(\sin x)^{(\cos x)^{(\cos x)^{(\cos x)^{\cdots\infty}}}}$
My attempt:
If the base and power were the same function,then we could find it's derivative with respect to $x$ as $y=x^y.$ But,here in the question,$\sin x$ and $\cos x$ are two different functions.So,I have no idea how to differentiate it with respect to $x.$
Also,I don't know if this function exist or not.If exist,then find its derivative.
Any help would be appreciated.Thank you!

REPLY [4 votes]: Here's how I would do it:
As @Blitzer said, define:
$$f(x) = (\cos x)^{(\cos x)^{(\cos x)^{\dots}}} = (\cos x)^{f(x)}$$
such that $y=(\sin x)^{f(x)}$
Now differentiate this like so:
$$\ln (f(x)) = f(x) \ln (\cos x) \implies \frac{f'(x)}{f(x)} = -f(x) \tan x + f'(x) \ln (\cos x)$$
$$\implies f'(x) = -(f(x))^2 \tan x + f(x) f'(x) \ln (\cos x)$$
So upon solving for $f'(x)$ we have:
$$f'(x) = \frac{(f(x))^2 \tan x}{f(x) \ln (\cos x)-1}$$
Using the same trick:
$$\ln (y) = f(x) \ln (\sin x) \implies \frac{y'}{y} = f(x) \cot (x) + f'(x) \ln (\sin x)$$
$$\implies \frac{dy}{dx} = f(x) (\sin x)^{f(x)} \cot(x)+f'(x) (\sin x)^{f(x)} \ln (\sin x)$$
Upon plugging in our expression of $f'(x)$, we have:
$$\frac{dy}{dx} =  f(x) (\sin x)^{f(x)} \cot(x)+\left(\frac{(f(x))^2 \tan x}{f(x) \ln (\cos x)-1}\right) (\sin x)^{f(x)} \ln (\sin x)$$
Thus finally, by plugging in $f(x)$, we obtain the rather horrible expression
$$\frac{dy}{dx} =  \left((\cos x)^{(\cos x)^{(\cos x)^{\dots}}}\right) (\sin x)^{\left((\cos x)^{(\cos x)^{(\cos x)^{\dots}}}\right)} \cot(x)+\left(\frac{\left((\cos x)^{(\cos x)^{(\cos x)^{\dots}}}\right)^2 \tan x}{\left((\cos x)^{(\cos x)^{(\cos x)^{\dots}}}\right) \ln (\cos x)-1}\right) (\sin x)^{\left((\cos x)^{(\cos x)^{(\cos x)^{\dots}}}\right)} \ln (\sin x)$$