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?
The problem is, that $y$ does not only depend on $a$, but also on $x$. Note that you have $y = a^x = g(a,x)$, that is $y$ is not a function of $a$, you have $g(a(x), x)$, not $g(a(x))$, as you must have for an application of the one variable chain rule.
What you can do are two different things: (1) If you know the multivariable chain rule, you can use it, giving $$ \frac{dy}{dx} = \frac{\partial y}{\partial a}\frac{da}{dx} + \frac{\partial y}{\partial x} $$
(2) If you do not know it (or are not allowed to use it anyway), then look at $\log y = x\log(1+x^2)$. By the (single-variable) chain and the product rule, you get $$ \frac{y'}y = (\log y)' = \bigl(x\log(1+x^2)\bigr)' = \log(1 + x^2) + \frac x{1+x^2} \cdot 2x $$