2

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.

  • You are assuming that $x-1$ is a specific natural number, but $x$ is a variable in a domain. By the other hand a notation like $f(x)^x$ is defined as the analytic expression $e^{x\ln(f(x))}$. – Masacroso Mar 06 '17 at 08:47
  • Thanks, that makes a lot of sense. I completely overlooked that. I knew it had to be something fundamental that I was overlooking – revelationnow Mar 06 '17 at 08:50

2 Answers2

4

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.

  • Thanks this was it, I realized this from Masacroso's comment to the question. I'll accept your answer if @Masacroso doesn't post an answer. – revelationnow Mar 06 '17 at 08:56
  • Oh, I didn't see that. Do as you wish, it doesn't really matter to me. –  Mar 06 '17 at 08:57
0

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.

  • Thanks, is there a proof for this: "The desired derivative is the sum of all contributions." I haven't seen this property before, would be helpful to find the background for this. – revelationnow Mar 06 '17 at 08:52
  • 1
    Take $f(x,y)=\sin^yx$, then $\mbox{d}f=\frac{\partial f}{\partial x}\mbox{d}x+\frac{\partial f}{\partial y}\mbox{d}y$; change $y$ back to $x$ and 'divide' by $\mbox{d}x$. – StackTD Mar 06 '17 at 08:56
  • @StackTD: quite right. Also written $f(u,v)=\sin^u v\implies df/dx=\partial f/\partial u\cdot du/dx+\partial f/\partial v\cdot dv/dx$, and when $u=v=x$, $df/dx=\partial f/\partial u|{u=x}+\partial f/\partial v|{v=x}$. –  Mar 06 '17 at 09:01
  • Thanks, this was useful. I did think of this formulation, but felt that this might not be valid since $ x $ and $ y $ aren't independent. I saw this http://math.stackexchange.com/a/1430322/422775 and perhaps your formulation reduces to it. – revelationnow Mar 06 '17 at 09:05