<s>[INST] How to Compute $\frac{d}{dx}\left(\left(1+x^2\right)^x\right)$? This is what I worked out:
Let $y = (1 + x^2)^x$ and let $a = 1 + x^2$
Then, by the chain rule of differentiation:
$\frac{dy}{dx} = \frac{dy}{da}\cdot\frac{da}{dx} = a^x\cdot ln(a) \cdot 2x$
$\frac{dy}{dx} = (1 + x^2)^x \cdot ln(1 + x^2) \cdot 2x $
But when I try to verify the result on WolframAlpha, I get this.
What have I done wrong?
 [/INST] In order to calculate $\frac{d}{dx}\left(\left(1+x^2\right)^x\right)$ then this expression can be placed into the form
\begin{align}
\frac{d}{dx} \left(\left(1+x^2\right)^x\right) &= \frac{d}{dx}\left[ e^{x \, \ln(1+x^2)} \right] \\
&= e^{x \, \ln(1+x^2)} \, \left[ x \, \frac{d}{dx} \ln(1+x^2) + \ln(1+x^2) \right] \\
&= (1+x^2)^{x} \, \left[ \frac{2 \, x^2}{1+x^2} + \ln(1+x^2) \right]
\end{align}
</s>