Problem. Compute $\frac{d}{dx} x^{a^x}$.
Method 1: Logarithmic Differentiation (Correct):
\begin{align*} y&= x^{a^x} \\ \ln(y)&=a^x \cdot \ln(x) \\ \frac{1}{y} \frac{dy}{dx} &=a^x \frac{1}{x} + \ln(x) \ln(a) a^x \\ \frac{dy}{dx} &= y\left(\frac{1}{x} a^x + \ln(a) \ln(x) a^x\right) \\ \frac{dy}{dx} &= x^{a^x}\left(\frac{1}{x} a^x + \ln(a) \ln(x) a^x\right) \\ \frac{dy}{dx} &= a^x x^{a^x}\left(\frac{1}{x} + \ln(a) \ln(x)\right) \\ \frac{dy}{dx} &= a^x x^{a^x-1}\left(1 + x\ln(a) \ln(x) \right) \\ \end{align*}
Method 2: Chain Rule (Incorrect):
\begin{align*} y&= x^{a^x} \\ \frac{dy}{dx} &= a^x x^{a^x-1} \cdot \left[\ln(a) \cdot a^x\right] \end{align*}
Method 2 is incorrect because it $x^{a^x}$ is not a power function, so we cannot apply power rule (thanks @Alann_Rosas and @Parcly_Taxel).
My Question: Can Ninad Munshi's answer here be adopted to correct method 2 without the use of logarithmic differentiation? What is the name (and/or proof) of this generalized version of chain rule?
Thank you!
As suggested, one can use the answer in Why the chain rule does not work for this question? to solve this problem.
\begin{align*} \frac{d}{dx} x^{a^x} &= a^x \cdot x^{a^x-1} + x^{a^x} \cdot \ln(x) \cdot \frac{d}{dx} a^x \\ &= a^x \cdot x^{a^x-1} + x^{a^x} \cdot \ln(x) \cdot \ln(a) \cdot a^x \end{align*}
This is a special case of the multivariable chain rule.