# What is the derivative of y=(sinx)^x?

Jul 27, 2015

$\frac{\mathrm{dy}}{\mathrm{dx}} = \left(\ln \left(\sin x\right) + x \cot x\right) {\left(\sin x\right)}^{x}$

#### Explanation:

Use logarithmic differentiation.

$y = {\left(\sin x\right)}^{x}$

$\ln y = \ln \left({\left(\sin x\right)}^{x}\right) = x \ln \left(\sin x\right)$ (Use properties of $\ln$)

Differentiate implicitely: (Use the product rule and the chain ruel)

$\frac{1}{y} \frac{\mathrm{dy}}{\mathrm{dx}} = 1 \ln \left(\sin x\right) + x \left[\frac{1}{\sin} x \cos x\right]$

So, we have:

$\frac{1}{y} \frac{\mathrm{dy}}{\mathrm{dx}} = \ln \left(\sin x\right) + x \cot x$

Solve for $\frac{\mathrm{dy}}{\mathrm{dx}}$ by multiplying by $y = {\left(\sin x\right)}^{x}$,

$\frac{\mathrm{dy}}{\mathrm{dx}} = \left(\ln \left(\sin x\right) + x \cot x\right) {\left(\sin x\right)}^{x}$

Jul 27, 2015

$\frac{d}{\mathrm{dx}} {\left(\sin x\right)}^{x} = \left(\ln \left(\sin x\right) + x \cot x\right) {\left(\sin x\right)}^{x}$

#### Explanation:

The easiest way to see this is using:

${\left(\sin x\right)}^{x} = {e}^{\ln \left({\left(\sin x\right)}^{x}\right)} = {e}^{x \ln \left(\sin x\right)}$

Taking the derivative of this gives:

$\frac{d}{\mathrm{dx}} {\left(\sin x\right)}^{x} = \left(\frac{d}{\mathrm{dx}} x \ln \left(\sin x\right)\right) {e}^{x \ln \left(\sin x\right)}$

$= \left(\ln \left(\sin x\right) + x \frac{d}{\mathrm{dx}} \left(\ln \left(\sin x\right)\right)\right) {\left(\sin x\right)}^{x}$

$= \left(\ln \left(\sin x\right) + x \frac{\frac{d}{\mathrm{dx}} \sin x}{\sin} x\right) {\left(\sin x\right)}^{x}$

$= \left(\ln \left(\sin x\right) + x \cos \frac{x}{\sin} x\right) {\left(\sin x\right)}^{x}$

$= \left(\ln \left(\sin x\right) + x \cot x\right) {\left(\sin x\right)}^{x}$

Now we must note that if ${\left(\sin x\right)}^{x} = 0$, $\ln \left({\left(\sin x\right)}^{x}\right)$ is undefined.

However, when we analyse the behaviour of the function around the $x$'s for which this holds, we find that the function behaves well enough for this to work, because, if:

${\left(\sin x\right)}^{x}$ approaches 0

then:

$\ln \left({\left(\sin x\right)}^{x}\right)$ will approach $- \infty$

so:

${e}^{\ln \left({\left(\sin x\right)}^{x}\right)}$ will approach 0 as well

Furthermore, we note that if $\sin x < 0$, $\ln \left({\left(\sin x\right)}^{x}\right)$ will be a complex number; however, all the algebra and calculus that we have used work in the complex plane as well, so this is not a problem.

Aug 14, 2017

More generally...

#### Explanation:

$\frac{d}{\mathrm{dx}} \left[f {\left(x\right)}^{g} \left(x\right)\right] = \left[g \frac{x}{f} \left(x\right) f ' \left(x\right) + g ' \left(x\right) \ln \left(f \left(x\right)\right)\right] \left[f {\left(x\right)}^{g} \left(x\right)\right]$