Derivative of $ \sin^x(x) $ I was trying to find the derivative for $\sin^x(x)$
I followed two methods, to get to different answers and after comparing the answer with Wolfram Alpha, I found the one which was correct and which was wrong, however I am unable to reconcile why the one which was wrong is incorrect.
The method which leads to the answer from Wolfram Alpha is as follows:
$ y = \sin^x(x) $
$ \implies \ln(y) = x\ln(\sin(x)) $
Taking derivative with respect to x on both sides, applying chain rule for the first term on the LHS:
$ \implies \frac{d}{dx}ln(y) = x.\frac{1}{\sin(x)}.\cos(x) + \ln(\sin(x)) $
$ \implies \frac{d}{dy}ln(y).\frac{dy}{dx} = x.\cot(x) +\ln(\sin(x)) $
$ \implies \frac{1}{y}.\frac{dy}{dx} = x.\cot(x) + \ln(\sin(x)) $
$ \implies \frac{dy}{dx} = y.[x.\cot(x) + \ln(\sin(x))] $
$ \implies \frac{dy}{dx} = \sin^x(x).[x.\cot(x) + \ln(\sin(x))]$
Which is the same as I get from Wolfram: https://www.wolframalpha.com/input/?i=derivative+of+sinx%5Ex
Now the second method I tried and it leads to a partial answer:
$ y = \sin^x(x) $
$ \frac{dy}{dx} = \frac{d}{dx}\sin^x(x) $
$ \frac{dy}{dx} = \frac{d}{dx}\sin(x).\sin^{x-1}(x) $
$ \frac{dy}{dx} =\sin(x).\frac{d}{dx}\sin^{x-1}(x) + \sin^{x-1}(x)\cos(x) $
$ \frac{dy}{dx} =\sin(x).\frac{d}{dx}\sin(x).\sin^{x-2}(x) + \sin^{x-1}(x)\cos(x)$
$ \frac{dy}{dx} =\sin(x).[\sin(x).\frac{d}{dx}\sin^{x-2} + \cos(x).\sin^{x-2}(x)] + \sin^{x-1}(x)\cos(x)$
$ \frac{dy}{dx} = \sin^2(x).\frac{d}{dx}\sin^{x-2} + 2.\sin^{x-1}(x).cos(x) $
Repeating this process
$ \frac{dy}{dx} = \sin^3(x).\frac{d}{dx}\sin^{x-3} + 3.\sin^{x-1}(x).cos(x) $
Again
$ \frac{dy}{dx} = \sin^4(x).\frac{d}{dx}\sin^{x-4} + 4.\sin^{x-1}(x).cos(x) $
until
$ \frac{dy}{dx} = \sin^{x-1}(x).\frac{d}{dx}\sin^{x-(x-1)} + (x-1).\sin^{x-1}(x).cos(x) $
$ \frac{dy}{dx} = \sin^{x-1}(x).\frac{d}{dx}\sin(x) + (x-1).\sin^{x-1}(x).cos(x) $
$ \frac{dy}{dx} = \sin^{x-1}(x).\cos(x) + (x-1).\sin^{x-1}(x).cos(x) $
$ \frac{dy}{dx} = x.\sin^{x-1}(x).cos(x) $
When I compare this with the previous result:
$ \frac{dy}{dx} = \sin^x(x).[x.\cot(x) + \ln(\sin(x))] $
$ \frac{dy}{dx} = x.\sin^{x-1}(x).\cos(x) + \sin^x(x)\ln(\sin(x)) $
There is this extra term
$ \sin^x(x)\ln(\sin(x)) $
Now looking at both terms:
$ x.\sin^{x-1}(x).\cos(x) $
and 
$ \sin^x(x)\ln(\sin(x)) $
I see the first one is something I would get from considering y to a be a polynomial in x and finding the derivative, while the second one is something I would get if I considered y to be an exponential in x and solved that.
Perhaps I am forgetting some basic calculus here, I hope someone can help me reconcile the reasoning here.
 A: 
Quote:

[...] Repeating this process
    $$ \frac{dy}{dx} = \sin^3(x)\cdot\frac{d}{dx}\sin^{x-3} + 3\cdot\sin^{x-1}(x).cos(x) $$
    Again
    $$ \frac{dy}{dx} = \sin^4(x)\cdot\frac{d}{dx}\sin^{x-4} + 4\cdot\sin^{x-1}(x)\cdot\cos(x) $$
    until
    $$ \frac{dy}{dx} = \sin^{x-1}(x)\cdot\frac{d}{dx}\sin^{x-(x-1)} + (x-1)\cdot\sin^{x-1}(x).cos(x) $$
    [...]


... "until" you decide arbitrarily that $x$ is a natural number which does not depend on $x$, thus making a major mistake.
A: You can use the following trick: take every instance of the variable ($x$) that appears in the expression, temporarily consider the others as constants, and differentiate. The desired derivative is the sum of all contributions.
$$\sin^x(x)$$ yields
$$(\sin^xc)'=\log\sin c\cdot\sin^xc\text{ (derivative of an exponential)},$$
$$(\sin^cx)'=c\sin^{c-1}x\cdot\cos x\text{ (derivative of power and chain rule)}.$$
Then by summation,
$$(\sin^xx)'=\log\sin x\cdot\sin^xx+x\sin^{x-1}x\cdot\cos x.$$

The problem with your second approach lies in the fact that you assume $x$ to be a constant integer so that the summation terminates. This doesn't hold and what you get is the term with the constant exponent.
