Problem 230
Medium Approximation and Higher Derivatives

Find dy for y = x^(a^x)-a^x, where a>0 and x>0

Find $dy$ for $y = x^{a^{x}}-a^{x}$, where $a>0$ and $x>0$.

Explanation of Method

A variable base carrying a variable exponent — logarithmic differentiation.

Step 1: Why the ordinary rules do not apply

In $x^{a^{x}}$ both the base and the exponent depend on $x$, so neither the power rule nor the exponential rule applies on its own. Logarithmic differentiation handles both at once.

Step 2: Take logarithms

Put $f = x^{a^{x}}$. Then

\[ \ln f = a^{x}\ln x. \]

Step 3: Differentiate both sides

The left side gives $f'/f$; the right side is a product, and $\bigl(a^{x}\bigr)' = a^{x}\ln a$: $\frac{f'}{f} = a^{x}\ln a\cdot\ln x + a^{x}\cdot\frac1x = a^{x}\left(\ln a\ln x + \frac1x\right)$.

\[ f' = x^{a^{x}}\cdot a^{x}\left(\ln a\ln x+\frac1x\right). \]

Step 4: The second term

\[ \frac{d}{dx}\bigl(-a^{x}\bigr) = -a^{x}\ln a. \]

Step 5: Combine and factor out $a^{x}$

\[ y' = x^{a^{x}}a^{x}\left(\ln a\ln x+\frac1x\right) - a^{x}\ln a = a^{x}\left[x^{a^{x}}\left(\ln a\ln x+\frac1x\right)-\ln a\right]. \]

Step 6: Verification

\[a = e,\ x = 1:\quad x^{a^{x}} = 1,\ a^{x} = e,\ \ln a = 1,\ \ln x = 0\]

\[y' = e\bigl[1\cdot(0+1)-1\bigr] = 0; \qquad \text{numerically } \frac{y(1.0001)-y(0.9999)}{0.0002} \approx 0.0000 \;\;\checkmark\]

\[a = 2,\ x = 2:\quad y' = 4\bigl[16\bigl(\ln^{2}2+\tfrac12\bigr)-\ln 2\bigr] \approx 4\bigl(16\cdot 0.9804530 - 0.6931472\bigr) \approx 59.97640 \;\;\checkmark\]


Result

Final answer:

\[\boxed{\,dy = a^{x}\left[x^{a^{x}}\left(\ln a\ln x+\dfrac{1}{x}\right)-\ln a\right]dx\,}\]

Remark

Remark. The special case $a = 1$ is degenerate: then $a^{x}\equiv1$, the function is just $y = x-1$, and the formula correctly gives $y' = 1\cdot\bigl[x(0+\tfrac1x)-0\bigr] = 1$. The case $a=e$ is the tidiest: $y = x^{e^{x}}-e^{x}$ with $y' = e^{x}\bigl[x^{e^{x}}\bigl(\ln x+\tfrac1x\bigr)-1\bigr]$.