I'm trying to differentiate $ x^{\sin x} $, with respect to $ x $ and $x > 0 $. My textbook initiates with $ y = x^{\sin x} $, takes logarithms on both sides and arrives at the answer $$ x^{\sin x - 1}.\sin x + x^{\sin x}.\cos x \ \log x $$
Why can't I use the power rule to proceed like this: $ y' = (\sin x) \ x^{\sin x-1} \cos x $.
Here, I've first differentiated $ x $ with respect to $ \sin x $ and then I've differentiated $ \sin x $ with respect to $ x $ to get $ \cos x $.