<s>[INST] Differentiating $\;y = x a^x$ My attempt:
$$\eqalign{
  y &= x{a^x}  \cr 
  \ln y &= \ln x + \ln {a^x}  \cr 
  \ln y &= \ln x + x\ln a  \cr 
  {1 \over y}{{dy} \over {dx}} &= {1 \over x} + \left(x \times {1 \over a} + \ln a \times 1\right)  \cr 
  {1 \over y}{{dy} \over {dx}} &= {1 \over x} + \left({x \over a} + \ln a\right)  \cr 
  {1 \over y}{{dy} \over {dx}} &= {1 \over x} + \left({{x + a\ln a} \over a}\right)  \cr 
  {1 \over y}{{dy} \over {dx}} &= {{a + {x^2} + ax\ln a} \over {ax}}  \cr 
  {{dy} \over {dx}} &= {{a + {x^2} + ax\ln a} \over {ax}} \times x{a^x}  \cr 
  {{dy} \over {dx}} &= {{x{a^{x + 1}} + {x^3}{a^x} + {a^{x + 1}}{x^2}\ln a} \over {ax}}  \cr 
  {{dy} \over {dx}} &= {a^x} + {x^2}{a^{x - 1}} + {a^x}x\ln a  \cr 
  {{dy} \over {dx}} &= {a^x}\left(1 + {x^2}{a^{ - 1}} + x\ln a\right)  \cr 
  {{dy} \over {dx}} &= {a^x}\left({{a + {x^2} + x\ln a} \over a}\right) \cr} $$
However the answer in the back of the book is:
$${dy \over dx} = a^x (1 + x\ln a)$$
What have I done wrong?
 [/INST] $y=xa^x$
$$y'=x'a^x+x(a^x)'=a^x+xa^x\ln a=a^x(1+x\ln a)$$
</s>