Pls discuss just the method below, and refrain from other methods. The alternate solution below looks wrong to me, because both the exponent and base are $x$! So how can you possibly pretend or playact that they're not, and treat the exponent and base separately as constants?
I once asked students to find the derivative of $x^x$ (with respect to $x$). One student figured that if the exponent were a constant then the answer would be $xx^{x-1}$ which is to say $x^x$, while if the base were constant the answer would be $x^x\log x$, so she added the two together to get $x^x+x^x\log x$. I was just about to mark the answer as wrong, when I realized that she had arrived at the correct answer – and, later, realized that it wasn't a coincidence, her unorthodox method actually works in a more general setting.
More generally$$\frac{d}{dx}f[g(x),\,h(x)]=\frac{\partial f}{\partial g}\frac{dg}{dx}+\frac{\partial f}{\partial h}\frac{dh}{dx}.$$Because each term vanishes if either $g$ or $h$ accordingly is constant, this result is the sum of two wrong-assumption results. For example,$$\frac{d}{dx}u^a=au^{a-1}u^\prime,\,\frac{d}{dx}a^v=a^v\ln a\cdot v^\prime,\,\frac{d}{dx}u^v=vu^{v-1}u^\prime+u^v\ln u\cdot v^\prime=u^v(vu^\prime/u+v^\prime\ln u).$$