# Power Rule for trig powers

While learning the power rule, one thing popped up in my mind which is confusing me. We know what the power rule states :

$$\frac{\mathrm{d}}{\mathrm{d}x}(x^n) = nx^{n-1}$$ where $n$ is a real number.

But instead of $n$, if we have a trig function like $\sin(x)$, will the power rule still apply?

Eg. We have a function $y = x^{\sin(x)}$, and thus by the power rule;

$$\frac{dy}{dx} = sin(x)x^{sin(x)-1}$$.

Is this possible? Please tell me if even the function I wrote above really does exist or not.

I know this may seem a stupid question to many, but please help because I cannot find any explanation to this.

• put $at the start and at the end of every math notation please. – petru Feb 17 '17 at 16:51 • If$y=x^{\sin x} = \exp(\sin x \ln x)=xe^{\sin x}$and use the chain and product rule. – Kevin Feb 17 '17 at 16:53 • Here's what I found on Wolfram Alpha - wolframalpha.com/input/?i=d+%7Bx%5Esin(x)%7D%2Fdx – Saksham Feb 17 '17 at 17:03 • Regarding the highlighted question: No. Note the difference: in the first case ($y=x^n$),$n$is a constant. In the second case,$y= x^{\sin x}$,$\sin x$is a non-constant function. – Namaste Feb 17 '17 at 17:15 ## 6 Answers Let me answer for any variable exponent$n(x)$: no, $$(x^{n(x)})'=n(x) x^{n(x)-1}$$ doesn't hold. As a counterexample, consider the function $$n(x):=\frac1{\ln(x)}$$ remarking that $$x^{n(x)}=x^{1/\ln(x)}=e^{\ln(x)/\ln(x)}=e.$$ The wrong rule would yield $$\frac1{\ln(x)}x^{1/\ln(x)-1}=\frac1{\ln(x)}e^{1-\ln(x)}.$$ But on another hand, the derivative of a constant is$0$. The correct rule can be found by means of logarithms: $$(x^{n(x)})'=(e^{\ln(x)n(x)})'=(\ln(x)n(x))'e^{\ln(x)n(x)}=\left(\frac{n(x)}x+\ln(x)n'(x)\right)x^{n(x)}.$$ • Strictly speaking, this is not a proof that it won't work for trigonometric functions (for this see the second part), but I wanted to keep it simple. – Yves Daoust Feb 17 '17 at 17:24 one possibility is taking the logarithm on both sides $$\ln(y)=\sin(x)\ln(x)$$ and by the chain rule we get $$\frac{y'}{y}=\cos(x)\ln(x)+\sin(x)\cdot \frac{1}{x}$$ you must multiply this equation by $$y(x)$$ I think you must start with$y=x^x$then$y=f(x)^{g(x)}$$$y=x^x \to \ln y=\ln x^x\\\ln y=x\ln x \to (\ln y=x\ln x')\\ \dfrac{y'}{y}=(1.\ln x+x .\dfrac1x) \\y'=y\times (\ln x+1) \\y'=x^x(\ln x+1)$$then for $$y=f(x)^{g(x)} \to \ln y=\ln f(x)^{g(x)} \\\ln y = g(x)\ln f(x) \to (\ln y = g(x)\ln f(x))'\\\dfrac{y'}{y}=(g'(x)\ln f(x)+g(x)\dfrac{f'(x)}{f(x)}) \\so\\ y'=y \times (g'(x)\ln f(x)+g(x)\dfrac{f'(x)}{f(x)}) \\y'=f(x)^{g(x)}\times (g'(x)\ln f(x)+g(x)\dfrac{f'(x)}{f(x)})$$ $$y=x^{\sin x} \to \ln y=\sin x \times \ln x \\$$apply derivation $$\dfrac{y'}{y}=\cos x \ln x+ \sin x \times\dfrac{1}{x} \\ \to y'=y(\cos x \ln x+ \sin x \times\dfrac{1}{x})\\y'=x^{\sin x}(\cos x \ln x+ \sin x \times \dfrac{1}{x})$$ No. It will not maintain the rule as you pointed out. The reason for that is that the derivative act on a function like an operator much more generalized as the power rule: It is a limit of some quantity. Because of that if you change the power to some function you will have to understand how this new functions changes as the limit is been taken. The function$\sin(x)x^{\sin(x)-1}$exists and is the function plotted below But if you make the calculations of the derivative of$x^{\sin(x)}$the function that you'll get is$x^{\sin(x)-1}(\sin(x)+x\ln(x)\cos(x))$plotted below So note how you have to use the full tolls to get the correct answer, these two functions are different because that you have to think that, because the power is now a function, other tools pointed out in other answers will have to be used. It is important to understand the power rule of differentiation $$\frac{d}{dx}x^{n} = nx^{n - 1}\tag{1}$$ The$n$in exponent is independent of$x$. There is another power rule where$n$is base namely $$\frac{d}{dx}n^{x} = n^{x}\log n\tag{2}$$ Here also the base$n$is independent of$x$. Note that there is no power rule to deal with $$\frac{d}{dx}u^{v}$$ where both$u, v$are non-constant functions of$x$. But that does not mean that we can't differentiate$u^{v}$. The right approach is to use the definition$u^{v} = \exp(v\log u)$and then differentiate via chain rule (and product rule) to get $$\frac{d}{dx}u^{v} = u^{v}\left(\frac{v}{u}\frac{du}{dx} + \log u\cdot\frac{dv}{dx}\right)\tag{3}$$ Note that if$u$(or$v$) is constant then one of the terms in parenthesis vanishes and we essentially get one of the formulas$(1)$and$(2)\$.

No, you cannot temporarily assume one of two variables to be constant when differentiating with respect exponent or argument in base function separately.

To handle both at the same time, take logarithm on both sides

$$\ln y =\sin x \ln x$$ and by the chain rule we get

$$\frac{y'}{y}=\cos x \ln x+\sin x\cdot \frac1{x}$$

$$y^{\prime}= \left( \cos x \ln x+\sin x\cdot \frac1{x} \right) x^ {\sin x}$$